Copy link to clipboard
Copied
Hello,
I have a file with 3 movie clips and three buttons that control them to play...with the script below It is working fine.
stop()
function startImageOne(Event:MouseEvent):void
{
imageOne_mc.play();
}
function startImageTwo(Event:MouseEvent):void
{
imageTwo_mc.play();
}
function startImageThree(Event:MouseEvent):void
{
imgThree_mc.play();
}
start1_btn.addEventListener(MouseEvent.CLICK, startImageOne);
start2_btn.addEventListener(MouseEvent.CLICK, startImageTwo);
start3_btn.addEventListener(MouseEvent.CLICK, startImageThree);
Then, I wanted to stop a movieClip, if another one was selected to play..so I inserted stop options to the function, which I thought would work, but doesn't. Does any one know why...See this code below..
thanks
stop();
function startImageOne(Event:MouseEvent):void
{
imageOne_mc.play();
imageTwo_mc.stop();
imgThree_mc.stop();
}
function startImageTwo(Event:MouseEvent):void
{
imageTwo_mc.play();
imageOne_mc.stop();
imgThree_mc.stop();
}
function startImageThree(Event:MouseEvent):void
{
imgThree_mc.play();
imageOne_mc.stop();
imageTwo_mc.stop();
}
start1_btn.addEventListener(MouseEvent.CLICK, startImageOne);
start2_btn.addEventListener(MouseEvent.CLICK, startImageTwo);
start3_btn.addEventListener(MouseEvent.CLICK, startImageThree);
thanks
Babs
Copy link to clipboard
Copied
There's nothing wrong with the code except that you might possibly have mixed up the naming of things (using img versus image). What goes on in the animations themselves?
Copy link to clipboard
Copied
Hi Ned,
I checked the names and they are all correct...(I named one of the instances img instead of image, but it is all fine.
The movie clips are simple...They have a stop action in the first frame, and then it is just an image that fads in and fades out..
Pretty simple?
The code looks fine, so I can't figure out, why the movie clip that is currently playing doesn't stop, when another button is activated.
It seems like is should work??
I'll keep playing .. thanks!!
babs
Copy link to clipboard
Copied
Are those timeline-based fades or actionscript-based fades? I have been assuming they are timeline-based.
Copy link to clipboard
Copied
Yes, they are all timeline based.