As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Flash Actionscript Q

ProhassProhass Registered User regular
edited April 2007 in Help / Advice Forum
Just a quick Q for Flash actionscript, say I want to do to do the opposite of;
if (_currentframe == 5){
do stuff;
}

to..
if (the previous frame WAS == 6){
do stuff;

Any help would be greatly appreciated!

Prohass on

Posts

  • Options
    SzechuanosaurusSzechuanosaurus Registered User, ClubPA regular
    edited April 2007
    Not quite sure I completely understand, but you could just store the current frame as a variable at the end of each frame and then check the previousFrame variable in the next frame.

    So at the end of any actionscript in every frame have
    {[i]whatever[/i]
    }
    
    previousFrame=_currentframe;
    

    then in whatever frame you want to check the value of the previous frame, just call the previousFrame value:
    if (previousFrame == 6){
    doronronronyoudoronron;
    }
    

    Szechuanosaurus on
Sign In or Register to comment.