How to prevent flash animation from refreshing when returning to a screen?

love
love Community Member Posts: 7
I have a screen where I play an animation and when it is done, I want the animation to stay open where it ended. It's an animation of a briefcase opening with a dollar amount showing. I have to come back to this page (Main Menu) 16 times during the course but whenever I come back the page and of course the animation refreshes and goes to the beginning. Is there any way to control this .swf so it doesn't refresh? I want the user to see that this briefcase has been opened and the contents have already been shown so they will select a new briefcase to open. I have a total of 16 of these identical animations that the user can choose to open upon returning to the screen.



Any and all help would be greatly appreciated.

Comments

  • andymuir
    andymuir Community Member Posts: 30
    This is doable. In Lectora set up a variable, lets call it donePlaying and set it to 0.



    In flash on first frame add this code



    Code:

    import flash.external.*;

    var tmp = flash.external.ExternalInterface.call("VardonePlaying.getValue");

    if (tmp == 1) {
    gotoAndStop(yourLastFrame);
    }




    On the last frame, set the Lectora variable to 1



    Code:


    flash.external.ExternalInterface.call("VardonePlaying.set", 1);




    Remember to add the variable as a Required Variable in the swf properties in lectora