Groups | Blog | Home
all groups > flash actionscript > september 2007 >

flash actionscript : Mouseover Actionscript 3.0 thingy for Buttons?


hoax_1337
9/19/2007 9:32:48 PM
He guys,
I've got a Problem: I wanna do an animated Button in flash. I'm new to it, and
i'm done with the "graphical" work now. But I've got a Problem with the
Actionscript now, I know how to set it up that the Animation of the Button will
start to play when the mouse is over the Button (with that .addeventlistener
MOUSE_OVER thingy), but i don't know how to stop it. It loops.

thanks, hoax
SymTsb
9/19/2007 9:43:00 PM
hoax_1337
9/20/2007 12:00:00 AM
mhm, I didn't really understand what you mean...

I have 3 layers at the moment. One for ActionScript, one for the invisble
click Button, and one for the animation of the Button. Should I enter the "edit
mode" of the animation, and then put stop actions in every last keyframe of
every layer of the animation?

This does not really work for me..I don't know why... it still keeps looping :(
SymTsb
9/20/2007 3:10:14 PM
hoax_1337
9/20/2007 7:25:23 PM
I think the reason why it loops is easy...

[quote]
import flash.events.IEventDispatcher;
import flash.display.MovieClip;
Button.stop();

if (MouseEvent.ROLL_OVER){
Inv_btn.addEventListener(MouseEvent.ROLL_OVER,startclip);
function startclip(e:MouseEvent):void {
Button.play();
}
}
[/quote]

"Button" is the name of the animation.
"Inv_btn" is my invisible button.

As you can see, the reason why it loops is really easy.. I only added a play
command, not a stop command, and the reason why I did this is because i don't
know how to do it different ^^. I wasn't able to find a "don't loop the
animation " action :(

As you can maybe see, i'm really new to Ascript, but i'm looking forward for
your answer! :D

greetings hoax
scotparker
10/8/2007 2:51:46 AM
AddThis Social Bookmark Button