php vars to flash

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anfetienne
    Contributor
    • Feb 2009
    • 424

    php vars to flash

    how can i post my $random_digit var to flash so that it can be used within flash actionscript?
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    Don't really use flash so can't help, but PHP can only output text, so you would need something like:
    Code:
    [flash]"random_var = <?php echo( $random_digit ); ?> "[/flash]

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Originally posted by TheServant
      Don't really use flash so can't help, but PHP can only output text, so you would need something like:
      Code:
      [flash]"random_var = <?php echo( $random_digit ); ?> "[/flash]
      You're correct, but PHP is not run within flash. You have to pass the variable to the SWF file though flashvars - or something like. Flash is great :D Try it out.

      Comment

      • anfetienne
        Contributor
        • Feb 2009
        • 424

        #4
        lol i know php is not run in flash.....i know how to get my flash variables to php.....ive made plenty of contact forms, my fav being one that sends a receipt of what was entered into the form to the user.

        but going from php to flash is harder than flash to php and as I am a newbie at programming php outside of contact forms and mysql databases i wouldn't know where to start lol

        i appreciate all your help guys......thank s

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          So, as a conclusion (so I don't have to merge the thread from the flash forum - yawn):
          PHP will not directly interact with flash, nor can it be used within flash. You can however output from PHP into a variable, be it <param>, etc., and have flash read that.

          Thread on how to pass the vars here.

          Comment

          • TheServant
            Recognized Expert Top Contributor
            • Feb 2008
            • 1168

            #6
            lol, I was thinking that, but wan't sure cos I never use it... It is next on my list once I have OOP done ;)

            Comment

            • Markus
              Recognized Expert Expert
              • Jun 2007
              • 6092

              #7
              Originally posted by TheServant
              lol, I was thinking that, but wan't sure cos I never use it... It is next on my list once I have OOP done ;)
              It's a long and dubious road, OOP. I'd say I'm about 3/4 way to understanding it and being able to use it consistently. That's enough off-topic for now :D

              Comment

              Working...