Hey, I’ve been having this problem, and I cant come up with a resonable answer and I was wondering If I could pick at your guys brains.
Im trying to make a cradle effect where I have an object rotate from 0 degrees to 90 degrees and back again. Once I roll over, I want it to go from its current position weather is 27 degrees, 78 degrees or 90, and have it come back down to 0 and sit there, until the mouse leaves. I’ve attached my current code - I also linked a demo file to my webspace if you wish to download and take a look. Thank you to whom ever can help!
function globeSpin() {
var halfSpin = 1;
globe.onEnterFrame = function() {
if (this._rotation == 90) {
halfSpin = -1;
}
if (this._rotation == 0) {
halfSpin = 1;
}
this._rotation = this._rotation+halfSpin;
};
}
function btnName() {
var resetSpin = -10;
btn.onRollOver = function() {
globe.onEnterFrame = function() {
if (this._rotation == 90) {
resetSpin = -10;
//this._rotation == 0;
}
if (this._rotation == 0) {
//I think this is where it may be messing up
resetSpin = stop();
}
this._rotation = this._rotation+resetSpin;
};
};
}
globeSpin();
btnName();