AS3 Rotation problems

3 posts

Flag Post

Well I have a class with a function that looks a little like this:

if (flightHeight <= 5 && flightHeight >= -5) {

if(goingLeft) { this.rotation -= 9;} else { this.rotation += 9;}
trace(flightHeight);

}

Which works fine until I try to add a MC with multiple frames. Right now, “this” is just a simple drawing of an arrow with only one frame. However, I would like to add a multiple frame drawing of a flame to go on top of the arrow head.

When I do that though, the rotation doesn’t occur and the arrow just gets stuck in the air.

I’ve tried adding the flame on the timeline and in the Arrow class. Is it impossible to rotate an object with multiple frames in AS3?

 
Flag Post

Maybe the rotation is reseted someway when changing frames. (I have just tried rotating an object with multiple frames and it worked fine, so no idea)
Something like this might work:

var rot:Number;
function onEnterFrame(e:Event):void {
this.rotation = rot;
}

And then modifying rot instead of rotation.

 
Flag Post

You should really respond to your old thread rather than making a new one.

Now to follow up on my previous guess:

Double-check the timeline in the arrow movie clip, or whatever movie clip has multiple frames. Do any of these frames have an “a” on them? If so, post the actionscript on those frames.

If not, are there any movie clips within the multi-frame movie clip? Press ctrl+A on each frame, and check for any white circles in what you selected. If you find any, check their timelines for actionscript as well.