0
如何在引用movieclip'whitesmoke'的enter_frame偵聽器'animatesmoke'內獲得'smokeobject'的速度屬性,該屬性也是' smokeobject獲取數據對象的屬性參考as3中同一對象的其他屬性
這裏是我的代碼
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'
}