help!!
- Started
- Last post
- 9 Responses
- freshmode
Ok, I have been searching for a week now. I need to animate a button on roll over. I want to do this with actionscript.
I am sure that it's easy. I already have the code that allows it to scale on rollover. I just cannot figure out how to animate it with script.
I have searched and searched and nothing. Can someone please help me out with this?
Here is the code I have right now that scales it. But it looks like a boring ass rollver.
::
on (rollOver){
with (xf9e){
_xscale = 100;
_yscale = 100;
_alpha = 100
}
}
:::If you can, please help. A link to a script, or if you have done this before, please donate to the cause.
Thanks in advance.
FRESH!
- o0o0
well... what do you mean by "animate it?" you want it to move when you mouseover? You already got it to scale...
- freshmode0
I need the scale to animate. Right now it just pops. It doesn't animate the scale.
Someone has to know how to do this... please help!
FRESH!
- ok_static0
I pretend I know what you mean.
Why not make it a MC and use a blankbutt with tell target?
I hope you know what i mean as well.
- freshmode0
I just want it to be as simple as possible. All I want is to animate the scale. That is it. I have this effect happening to 23 other buttons as well. So I don't want to bother with changing the buttons to movie clips, then making blank buttons and adding script to both.
their has to be a way to animate a scale on a button.
All I need is the script that will make it animate. I can figure out how it works and how to make it work with my art, i just don't know how to make something animate with script.
Word!
- chilaquil0
why does it have to be with actionscript as opposed to having a movie clip in the over stage of the button, (or something like that?)
- Bluejam0
Your best bet is to create an empty movieclip X which has, say, twelve frames. Each frame has the code you are using already...the first frame will have scale 10, the second frame will scale 20...etc.
The button then just needs to call and play movie clip X.
Introducing a variable would also allow you use just this one movie clip X for all the buttons that need to use this action...
- autonoma0
Put the button in a movie clip. On that movie clip, add this script:
onClipEvent (enterFrame) {
if (over) {
this._xscale += (150-this._xscale)*.30;
this._yscale += (150-this._yscale)*.30;
}
if (!over) {
this._xscale += (100-this._xscale)*.30;
this._yscale += (100-this._yscale)*.30;
}
}Then add this script to the button:
on (rollOver) {
over = true;
}
on (rollOut) {
over = false;
}That's it.
- rudin0
whow, thanks autonoma... You spared me wasting time on writing a useful answer... you already did it. whoow. i love you! :]
- freshmode0
right on... thanks for the help.
The script works good.
FRESH!