PDA

View Full Version : Want to create a rolling ball effect.. (newb)


Chronos
06-10-2003, 02:32 AM
Hi, I just got flash today and i've been fudging around with it for about 9 hours. Anyhow, I can get a ball to move with arrow keys, but I want it to rotate to he direction I press also. This is what I have been trying, but it doesnt work.

function roll() {
if (Key.isDown(Key.LEFT)) {
this._x += this.speed;
}
if (Key.isDown(Key.LEFT)) {
this._rotate += 5;
}

}
hams_mc.speed = 20;
hams_mc.onEnterFrame = roll;

function roll() {
if (Key.isDown(Key.LEFT)) {
this._x += this.speed;
}
if (Key.isDown(Key.LEFT)) {
this._rotate += this.speed;
}

}
hams_mc.speed = 20;
hams_mc.onEnterFrame = roll;

I just want it to rotate going right and left, I, hopefully, will be writing some games in flash in the future.

Any help appreciated! Thank you, expect a lot more questions from me in the future.

farafiro
06-10-2003, 08:29 AM
Chronos
welcome to the forums

the property called _rotation not just rotate

Chronos
06-10-2003, 05:53 PM
Hahahaha, thank you much, sir!