如何在 enter_frame 侦听器“animatesmoke”中获取“smokeobject”的速度属性,以引用电影剪辑“whitesmoke”,这也是“smokeobject”的属性
这是我的代码
public function createRocketSmoke()
{
var smokeObject:Object = new Object();
smokeObject.whiteSmoke = new Bitmap(new WhiteSmoke(0,0));
smokeObject.whiteSmoke.x=targetX + Math.random()*4-8;
smokeObject.whiteSmoke.y=targetY + Math.random()*4-8;
smokeContainer=new MovieClip();
smokeContainer.addChild(smokeObject.whiteSmoke);
addChild(smokeContainer);
var randomScale = Math.random();
if(randomScale<.5)
randomScale = randomScale+.5;
smokeObject.whiteSmoke.scaleX= randomScale;
smokeObject.whiteSmoke.scaleY= randomScale;
smokeObject.speed = Math.random();
smokeObject.whiteSmoke.rotation = Math.random()*360;
smokeObject.whiteSmoke.addEventListener(Event.ENTER_FRAME,animateSmoke);
}
public function animateSmoke(event:Event):void
{
//here i want the speed property of the 'smokeObject'
}