How do I move and scale properly in ActionScript?
function scale(e:Event):void{
pla开发者_开发百科ne1_mc.scaleX += .1;
plane1_mc.scaleY += .1;
plane1_mc.x -= 5;
plane1_mc.y -= 3;
}
function prop(evt:Event):void{
plane1_mc.prop_mc.rotation += 100;
}
plane1_mc.prop_mc.addEventListener(Event.ENTER_FRAME, prop);
plane1_mc.addEventListener(Event.ENTER_FRAME, scale);
this is what im using to try to get plane1_mc to scale and move. it was doing both before but now its only doing the scale. Anybody feel free to tell me
Your code is correct. Try increasing the amount you move it and post what happens. Something like this:
plane1_mc.x -= 50;
plane1_mc.y -= 30;
Also make sure you aren't scaling plane1_mc anywhere else. It's possible that another event is being fired instead of this one, so it looks like the scaleX and scaleY values are being modified from this function when they really aren't. I'd suggest putting some trace statements in this function and seeing if they show up.
精彩评论