3 Replies Latest reply on Oct 25, 2007 3:03 PM by scrfix

    PHP and Actionsripting...

    james_grubb_III
      Hey fellow Flash friends... I have a flash banner that I have sitting on my gaming clans website I did. The forums are PHP and when ever anyones views a new topic or post of does anything to refresh the browser it reloads the movie and plays again. I'd like the movie to just play once when you first get there and not everytime someone post something. Is there a actionscript of some way around this? I've searched everywhere and have come to a wall. LOL Any help will be appreciated thanks!

      http://www.shadowops.org/Forums/index.php
        • 1. Re: PHP and Actionsripting...
          Noah_B
          It may be possible to use actionscript, but if you are familiar with PHP there is an easier way. Whenever someone loads a page, give them a cookie. When the page loads, have it search for the cookie. If it finds the cookie, make it play a separate flash file that begins where you want it. If it doesn't find the cookie, make it play the whole file.
          • 2. Re: PHP and Actionsripting...
            james_grubb_III Level 1
            thanks for the response... yeah, I know thats probably going to be the work around. I just thought there might be something easier inside of flash that I could script into the movie to do the same. Not a big programer so, I have research the PHP code stuff. LOL But , thanks any ways...
            • 3. Re: PHP and Actionsripting...
              scrfix Level 1
              There is an even easier way to do this without using cookies. Use Session IDs. PHP should be able to keep the session OR keep an active variable from one page to another. Use the variable to control the flash video.

              I am presuming that you will want the movie to continue playing in the same exact place as they left.

              I don't know about AS2 or 3 if it can handle this however, here is how you would accomplish it.

              IF AS3 can accomplish this than here is what you can do.

              1. When the movie is playing, IF AS3 can detect when the movie stops have it send out the frame number and the mc name to PHP.
              Store that in PHP variables.
              Transfer those variables via POST and GET methods to the reloading page.
              Check to see if those variables are active. Send those variables back to the flash movie on the refreshed page using flash vars and tell the ActionScript to start the same exact movie and the same exact frame.

              That is the only way that I can think of doing that.

              Wayne