dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: stop "onEnterFrame"

  1. #1
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448

    stop "onEnterFrame"

    Hi,

    I have this script for a collapsable menu:

    menu.kinase.onPress=function(){
    menu.gotoAndPlay("play");
    }
    menu.channel.onPress=function(){
    menu.onEnterFrame=function(){
    this.prevFrame();
    if(this._currentframe==2){
    trace(_currentframe);
    this.gotoAndStop("stop");
    }
    }
    }

    it works fine. When I press kinase, it will play and unfold and when I press channel, it will go back and fold. However, when i press kinase again, it does not unfold. Is there a different way than this.gotoAndStop("stop"); to stop onEnterFrame and reset everything as it was? "stop" is frame 1.

    Thanks.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  2. #2
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food
    Posts
    3,789
    Code:
    menu.kinase.onPress = function() {
    	menu.gotoAndPlay("play");
    };
    menu.channel.onPress = function() {
    	menu.onEnterFrame = function() {
    		this.prevFrame();
    		if (this._currentframe == 2) {
    			trace(_currentframe);
    			this.gotoAndStop("stop");
    			delete this.onEnterFrame;
    		}
    	};
    };

  3. #3
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Perfect, thanks !
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

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