Link to home
Start Free TrialLog in
Avatar of skel
skel

asked on

Is it possible to make flash applet to remember its state?

Hi all...

I have a web page that has some flash applets in it. One of them plays a sound that is possible to stop by pressing a bottom present inside the flash.

The page contains some sections that when they are clicked, the whole page is refreshed with an ID parameter in the query string. Suppose a visitor presses the button in the applet to stop the sound, when he selects a section and the page is refreshed, the flash will start playing the sound again.

How can I make the page to remember that the visitor has pressed the off sound button? maybe with an event that is sent to the page from the flash and captured using JavaScript? other suggestion?

Any help would be greatly appreciated
Thanks

Jaime
Avatar of furmiga
furmiga

You can call your swf again with a param like my_swf.swf?play_song=false& and inside your swf you will put a conditional if(play_song==true){...}

If the movie that will reload the whole page is not the one with the sound you can dynamically insert in your page a javascript that changes the form and then process the new call for your swf.

Now, lemmi know how you are reloading the page. Are you calling an ASP or something?
Avatar of skel

ASKER

Thanks "furmiga" for your answer. The part to restore the sound state will be solved with what you say, but, how can the page know that the user clicks the OFF button in the SWF? The SWF has to send an event to the page when the sound is turned OFF.

The page is actually a PHP page, but that doesn't matter because what I have to do is only by mean of JavaScript.

Jaime
ASKER CERTIFIED SOLUTION
Avatar of furmiga
furmiga

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The only condition of this code that might not work is for Mac users running IE. For all others, this code runs just fine (Mozilla, IE, Netscape, Opera) running on both OS's. The browser must be JavaScript enabled as well.