8 Replies Latest reply on Oct 24, 2008 3:02 PM by Laura_Killmaster

    flashvars won't pass value

    Laura_Killmaster
      I am trying to retrieve a value from the current URL and pass it from my php file to the embedded flash movie using flashvars.

      the flash code is on frame 2. No matter what I've tried (for 3 days), nothing works. assigning a new variable in flash
      inside and outside of the function. I know the $_GET['orderId'] yields the correct value, however, this value never reaches flash.

      This is driving me mad. I tried for a couple days using loadVars with no luck either. Is it because the code is on frame 2? or do I have to declare _level0 (I did try this but no luck)? I'm just stabbing in the dark here so any help is greatly appreciated...

      Here are code fragments:

      from php then from my flash file...

        • 1. Re: flashvars won't pass value
          clbeech Level 3
          ok - a couple of things here. first you should be able to call the php script directly from Flash and return the value without having to pass it through the html and use FlashVars. you were on the right track with using the LoadVars class and this is an excellent way to do so. however, in the php script the echo should be set up slightly different in order to get the value to be read by Flash - so I'll write a quick example of how to do this, and i t shouldn't matter that the code is on frame2 - since you will call to the php from that script, and the return will be directed to the return FlashVar object.
          • 2. Re: flashvars won't pass value
            Laura_Killmaster Level 1
            I really appreciate this!

            I'm still not able to get it to work using this example. As far as I can tell, flash is not getting the value. If we hard code the return value and take out if(this.orderId != null), everything works ok so it must not be getting the variable passed correctly. The echo in the php file echoes the correct value however so I suspect that part is working ok. These two lines pertaining to flashvars look suspicious to me:

            <param name="FlashVars" value="orderId=<?php echo $orderId; ?>" />
            <embed src="previews.swf>" quality="high" pluginspage=" http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="884" height="553" flashvars="orderId=<?php echo $orderId; ?>" />"></embed>



            • 3. Re: flashvars won't pass value
              clbeech Level 3
              hey np :)

              hmmmm... when you ran the new test code, was the html still in place, declaring the FlashVar? that may be overwriting/interfering with the code I used above - with the above there is no need to use a FlashVar at all. so i think your right, they do seem suspicious :)

              can you run the test publish in the IDE? without the embed code - i would check it that way and run some traces on the return to see if it's getting through. At the very least I'd pull the FlashVars out and try a run ...

              unless... is the php script written into the html code above? i mean are they not separate documents? that would explain the above php code in the Flashvar declaration - because as far as i can tell here there would be no value available for echo using that script (unless the other code is within the same doc)
              • 4. Re: flashvars won't pass value
                clbeech Level 3
                hey np :)

                hmmmm... when you ran the new test code, was the html still in place, declaring the FlashVar? that may be overwriting/interfering with the code I used above - with the above there is no need to use a FlashVar at all. so i think your right, they do seem suspicious :)

                can you run the test publish in the IDE? without the embed code - i would check it that way and run some traces on the return to see if it's getting through. At the very least I'd pull the FlashVars out and try a run ...

                unless... is the php script written into the html code above? i mean are they not separate documents? that would explain the above php code in the Flashvar declaration - because as far as i can tell here there would be no value available for echo using that script (unless the other code is within the same doc)
                • 5. Re: flashvars won't pass value
                  clbeech Level 3
                  hey np :)

                  hmmmm... when you ran the new test code, was the html still in place, declaring the FlashVar? that may be overwriting/interfering with the code I used above - with the above there is no need to use a FlashVar at all. so i think your right, they do seem suspicious :)

                  can you run the test publish in the IDE? without the embed code - i would check it that way and run some traces on the return to see if it's getting through. At the very least I'd pull the FlashVars out and try a run ...

                  unless... is the php script written into the html code above? i mean are they not separate documents? that would explain the above php code in the Flashvar declaration - because as far as i can tell here there would be no value available for echo using that script (unless the other code is within the same doc)
                  • 6. Re: flashvars won't pass value
                    clbeech Level 3
                    hey np :)

                    hmmmm... when you ran the new test code, was the html still in place, declaring the FlashVar? that may be overwriting/interfering with the code I used above - with the above there is no need to use a FlashVar at all. so i think your right, they do seem suspicious :)

                    can you run the test publish in the IDE? without the embed code - i would check it that way and run some traces on the return to see if it's getting through. At the very least I'd pull the FlashVars out and try a run ...

                    unless... is the php script written into the html code above? i mean are they not separate documents? that would explain the above php code in the Flashvar declaration - because as far as i can tell here there would be no value available for echo using that script (unless the other code is within the same doc)
                    • 7. Re: flashvars won't pass value
                      clbeech Level 3
                      hey np :)

                      hmmmm... when you ran the new test code, was the html still in place, declaring the FlashVar? that may be overwriting/interfering with the code I used above - with the above there is no need to use a FlashVar at all. so i think your right, they do seem suspicious :)

                      can you run the test publish in the IDE? without the embed code - i would check it that way and run some traces on the return to see if it's getting through. At the very least I'd pull the FlashVars out and try a run ...

                      unless... is the php script written into the html code above? i mean are they not separate documents? that would explain the above php code in the Flashvar declaration - because as far as i can tell here there would be no value available for echo using that script (unless the other code is within the same doc)
                      • 8. Re: flashvars won't pass value
                        Laura_Killmaster Level 1
                        The php coder on the project ended up writing it in his code. I can't explain exactly what he did but now my flash calls for a hardcoded blahblah.php page and it works. I tried to get him to write and explanation that could help someone else in this situation but he is too busy at the moment. Thanks for your time and help.