Search code examples
actionscript-3flash-cs4

AS3 - how to start all over again a flash movie


This may be very simple, but I have no idea how to do this.

I created a photo gallery in AS3, everything is on one keyframe. In this photo gallery I have a link to home. My goal is, when someone clicks the "home" link I want everything to start over. Any ideas on how to do this in AS3?

Appreaciate it.

L.


Solution

  • call flash player container
    usually the HTML page and use JavaScript to reload the flash player

    flash.external.ExternalInterface.call(jsFuncRestart);
    

    jsFuncRestart is a JavaScript function in the HTML file

    and now in the js function just create a new object and replace the current flash object
    with the new one