all groups > flash actionscript > february 2007 >
You're in the

flash actionscript

group:

Stopping one movieclip from another


Stopping one movieclip from another jrmcintosh
2/11/2007 7:31:07 PM
flash actionscript:
This seems really simple but it's getting a bit frustrating for me.

I have two separate movieclips on a stage. One has three graphics that are
cycled through every 4 seconds using an interval. This movie is named adsmc. I
have another movieclip called btnset that has a pause button in it. What I want
btnset to do is that when pause is clicked adsmc stops completely. This doesn't
currently happen, it continues to cycle. Now if I take the interval code out,
the btnset stops adsmc when clicked. How can I stop the cycling of adsmc while
keeping my time intervals? Actionscript included below...

adsmc code(I have three actionscripts here on frames 1, 5, and 10, they are
basically the same except for telling the movie what frame to go to.):

stop();
var interval:Number = setInterval(function () {
gotoAndPlay(5);
clearInterval(interval);
}, 4000);


btnset code:

stop();

btnpause.onPress = function () {
trace(_root.adsmc._currentframe);
_root.adsmc.stop();
}
Re: Stopping one movieclip from another kglad
2/11/2007 11:36:36 PM
use:



// adsmc

stop();
clearInterval(interval);
var interval:Number = setInterval(function () {
gotoAndPlay(5);
clearInterval(interval);
}, 4000);


// btnset code:

stop();
btnpause.onPress = function () {
trace(_root.adsmc._currentframe);
clearInterval(_root.adsmc.interval)
}
Re: Stopping one movieclip from another Sketchsta
2/12/2007 1:48:25 AM
WhoooA!!!! holy cr**...you can do that??? trace( directory_path ) ...???
That's kool!!!

you're full of knowledge kglad... Thanx!!

sorry for butting in... =P

cya!!
good luck jrmcintosh!!!
Re: Stopping one movieclip from another kglad
2/14/2007 5:08:11 AM
AddThis Social Bookmark Button