Groups | Blog | Home
all groups > flash actionscript > april 2006 >

flash actionscript : stop ()


mkoooool
4/1/2006 11:39:37 PM
hello everyone,
i currently have 2 scenes in my flash 8 document, and so i want it that when
the movie reaches the end of the first scene, it will stop, and when the user
clicks on a movie clip it will move to the next scene (using onPress function).
so i created a new layer and on a keyframe on the last active frame of the
first scene, i entered the actionscript stop();

additionally, in the layer of the movie clip which directs the user to the
next scene, i have

mc.onRelease=function(){
gotoAndPlay ("Scene 2",1);
};

now comes the problem...
when i preview it, it does stop at the last frame for a few seconds. but after
that, if i don't do anything and just remain idle, one after the other, the
movie clips on the screen disappear and reappear in a fixed order (the loop
option is off!). if i click the mc, it moves on to the next scene, so that
works fine, but toward the end of the second scene, the same thing happens!

i have no idea what's happening, does anyone else?

thanks a lot, i'm really confused!

mukul
kglad
4/2/2006 1:32:06 AM
mkoooool
4/2/2006 5:16:48 AM
here's a http://www.geocities.com/mkoooool/ to my fla file.

kglad
4/2/2006 9:19:57 PM
your stop() on frame 140 is working. your _root timeline does not progress
beyond frame 140 unless a button is pressed.

your problems are caused by the initiation of onEnterFrame() handlers all of
which fail to terminate when they are no longer needed. attached to the
appropriate frames you should use the following to remedy this problem. you
should use similar actions to delete your other onEnterFrame handers when they
are no longer needed, too.




homeText._alpha=0;
homeText.onEnterFrame=function(){
trace(this._alpha);
this._alpha+=10;
if(this._alpha>100){
delete this.onEnterFrame;
}
}

and

function assembleDown(mc:MovieClip) {
mc.onEnterFrame = function() {
if (this._height<56) {
this._height += 2;
}
this._alpha += 5;
if (this._alpha>100) {
delete this.onEnterFrame;
}
};
}
blackboxHome1._alpha = 0;
blackboxHome2._alpha = 0;
blackboxHome3._alpha = 0;
blackboxHome4._alpha = 0;
blackboxHome5._alpha = 0;
blackboxHome6._alpha = 0;
blackboxHome7._alpha = 0;
blackboxHome8._alpha = 0;
blackboxHome1._height = 14;
blackboxHome2._height = 14;
blackboxHome3._height = 14;
blackboxHome4._height = 14;
blackboxHome5._height = 14;
blackboxHome6._height = 14;
blackboxHome7._height = 14;
blackboxHome8._height = 14;
assembleDown(blackboxHome1);
assembleDown(blackboxHome2);
assembleDown(blackboxHome3);
assembleDown(blackboxHome4);
assembleDown(blackboxHome5);
assembleDown(blackboxHome6);
assembleDown(blackboxHome7);
mkoooool
4/3/2006 2:21:19 AM
hey kglad thanks that works! i definitely never would have figured that out myself...and thanks for the quick response as well. i appreciate your time!

kglad
4/3/2006 4:39:52 AM
AddThis Social Bookmark Button