PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Help translating from AS3 to AS2
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Help translating from AS3 to AS2

  1. #1
    Senior Member
    Join Date
    Feb 2004
    Posts
    133

    Help translating from AS3 to AS2

    Hey guys...

    Sorry if does not make any sense (don't know much about AS)... But is it possible to "translate" the following code from AS3 to AS2? Thanks in advance!

    //tell mc to run stopMe when it hits its final frame (the measure is 0-based)
    mc.addFrameScript ( mc.totalFrames - 1 , stopMe ) ;

    //stopMe is called on the final frame of mc, but it is not a 'callback'
    function stopMe ( )
    {
    //tell mc to stop ( ) ;
    mc.stop ( ) ;
    }

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Actionscript Code:
    mc.onEnterFrame = function(){
        if(this._currentframe == this._totalframes){
            this.stop();
            delete this.onEnterFrame;
        }
    }
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Senior Member
    Join Date
    Feb 2004
    Posts
    133
    Thanks, man

    Still, I really can't use onEnterFrame. Is that a way to do it without the onEnterFrame?

    Thanks again!

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Not really, because you have to keep checking if the movieclip is on the last frame. The only other option, that I know of, would be to paste the code on the last frame of the movieclip:

    Actionscript Code:
    stop();

    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center