-
Can a button play a mc on a different layer?
Hi
I don't know if this is possible, but can you have a button on one layer play a mc on another layer?
I am trying to build a file where when my button is clicked, it will move the x and y axis of a movie clip on the layer below.
I'm working in CS4 action script 3.0 (no drop down menu option?)
Any help would be totally totally appreciated!
-
Yes, it's possible. You have to give an instance name to your movie (for example - mc) and add a click listener to your button, like this:
Actionscript Code:
playButton.addEventListener(MouseEvent.CLICK, startPlay);
function startPlay(e:MouseEvent):void { mc.play(); }
-
I know my code is wrong, but I don't know how to correct it.
My btn instance name is: art_btn_cfo
My mc instance name is: work_mc
When the btn is clicked, I'd like the work_mc to move it's x and y coordinates.
Here is what I've got:
play.art_btn_cfo.addEventListener (MouseEvent.CLICK, cfoClick);
function cfoClick(e:MouseEvent):void
{
work_mc.play(moveContent(187,53));
}
Can you help out - I'm lost.
Thanks so much.
-
Code:
art_btn_cfo.addEventListener(MouseEvent.CLICK, cfoClick);
function cfoClick(e:MouseEvent):void {
work_mc.x = 187;
work_mc.y = 53;
work_mc.play();
}
-
That's what I needed! Thanks so so much. You just saved me a lot of profanities!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|