-
I'm trying to make some simple little buttons made of cubes that spin depending on their state
basically the cube is static until mouseover, where it changes colour and spins.
on mouseoff I want it to revert to the original colour and slow-down to a stop (rather than the default instant stop flash applies on mouseoff)
already sitting in my library are the static, spinning, and slow-down animations ready to go.
my question is, how do I script the button to show the required animation for the corresponding state?
I'm somewhat of a scripting pleb :/
any help appreciated
thanks for your time
-
Can you not simply swap the static graphic for the movie of the animated revolving cube in the over state of your button?
I can further if your not sure what I mean.
-
showing the spinning cube isn't the issue
showing the slow-down after the mouse moves off the button is the part I can't work out
-
You can solve that problem by using the tell("target") { } command. I would show an example of code, but I don't know how the tags work. If someone tells me, I can show you.
[EDIT]tell(target) is depreciated. so, you can use the "dot notation," such as
Code:
on(rollOut) {
instanceName.gotoAndPlay(1);
}
[Edited by alex_rocks on 06-28-2002 at 09:02 PM]
-
Hi,
This problem is rather complicated, as the exact state of the movieclip playing (the spinning cube) has to determine where the slowdown occurs. The only way that I can see to do it accurately is to have a movieclip that has the following setup:
First Frame: Static state of cube, "stop()" action
Second Through n-th Frame: Spinning state of cube
N-th Frame: code:
Code:
if (hit) {
gotoAndPlay (2);
}
N+1 through M frame: Slow down animation (from N-th frame state)
And then the following actions on the movieclip:
Code:
onClipEvent (mouseMove) {
if (!hit && this.hitTest (_root._xmouse, _root._ymouse, true)) {
this.play()
hit = 1;
} else if (hit && !this.hitTest (_root._xmouse, _root._ymouse, true)) {
hit = 0;
}
}
This will make the cube spin for as long as it needs to, just make sure that the loop from frame n to frame 2 is smooth, and then when the user rolls off, it will continue to spin at the same speed until the playhead reaches frame n, where it will realize that it is time to slow down and will keep playing, eventually reaching the static state again. Hope this helps, and for an example, post the .fla of what you are working with, and I will see what I can do. Chuckles8421
-
-
The world goes - hm..
Telltarget is dead and gone and has been for two versions now. Isn't there a board for Flash 4 here somewhere? That's where it belongs...
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
|