all groups > flash actionscript > may 2006 >
You're in the

flash actionscript

group:

Rotate movie clip with a button mouse over?



Re: Rotate movie clip with a button mouse over? tralfaz
5/17/2006 2:56:07 PM
flash actionscript: [quoted text, click to view]

Here is the way I would do it.
wheel movieclip has instance name of 'wheel'
2 buttons with instance names of btn1 and btn2
All code is in frame 1, nothing attached to anything.
tralfaz

// ************* wheel stuff ***********
this.wheel.onEnterFrame = function()
{
this._rotation += _root.direction;
}

// ************* button 1 stuff ***********
btn1.onRollOver = function()
{
direction = 5;
}

btn1.onRollOut = function()
{
direction = 0;
}

btn1.onRelease = function()
{
direction = 0; // if you want to stop wheel when button is pressed
}

// ************* button 2 stuff ***********
btn2.onRollOver = function()
{
direction = -5;
}

btn2.onRollOut = function()
{
direction = 0;
}

btn2.onRelease = function()
{
direction = 0; // if you want to stop wheel when button is pressed
}
// ***********************************



Rotate movie clip with a button mouse over? shawnA2
5/17/2006 7:46:33 PM
If anyone has any ideas about how to code this, it'd be greatly appreciated.

I have a one frame swf with a few buttons and two movie clips of a wheel. The
wheel needs to spin when you mouse over the buttons and stop when not hovering.

I tried setting the property rotation of the clip on roll over, but it doesn't
move the wheels continuously or stop where it lands.

Anybody have any ideas? Thanks!
Re: Rotate movie clip with a button mouse over? gregmax17
5/17/2006 7:51:42 PM
I think it would easier to make the button a movie clip, unless that is what
you have, good job. Then try this:

wheel.onRollOver = function() { wheel._roration = wheel._rotation + 25; }
wheel.onRollOut = function() { wheel._roration = wheel._rotation + 0; }
whell.onPress = funciton() { /*what you want it to do*/ };

That is my suggestion.
Re: Rotate movie clip with a button mouse over? shawnA2
5/17/2006 8:03:57 PM
Re: Rotate movie clip with a button mouse over? shawnA2
5/17/2006 8:04:09 PM
AddThis Social Bookmark Button