-
button starts a movieclip
Hello everyone.
This must me simple but i can't find it
I have on the stage a button and a movie clip. What action do i have to put to the button so as to: when the mouse goes over the button, the movieclip starts pplaying and when the mouse goes out of the button, movie clip stops playing.
Thanks in advance.
-
[Horse Thief]
something like -
(placed in empty keyframe) :
Code:
yourButton_btn.onRollOver = function () {
yourMovieClip_mc.play();
}
yourButton_btn.onRollOut = function () {
yourMovieClip_mc.stop();
}
or if you like putting code on elements (like movie clips or button instances), which personally, I don't, but the syntax would be :
Code:
on (rollOver) {
_root.yourMovieClip_mc.play();
}
on (rollOut) {
_root.yourMovieClip_mc.stop();
}
"_root" would be the path of your movie clip - if the movie clip was inside "somethingElse" you would say:
_root.somethingElse_mc.yourMovieClip_mc.play();
make sure & check your Instance Names!
1 Infinite Loop, Cupertino is a portal of Hell.
-
wow that was really fast.
Thank you!
-
[Horse Thief]
let me know if you still have troubles, i'll make you a little sample file if you need.
1 Infinite Loop, Cupertino is a portal of Hell.
-
Just one more thing, What do i have to add so as to, when the mouse goes out, to stop to the 1st frame of the mc.
-
[Horse Thief]
heh, I almost heard you asking that when I typed my first post - I almost mentioned it :
yourButton_btn.onRollOut = function () {
yourMovieClip_mc.gotoAndStop(1);
}
OR
on (rollOut) {
_root.yourMovieClip_mc.gotoAndStop(1);
}
1 Infinite Loop, Cupertino is a portal of Hell.
-
Thank you very much gotoAndCrash.
-
[Horse Thief]
you're very welcome
come back soon!
1 Infinite Loop, Cupertino is a portal of Hell.
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
|