1
我想在actionscript中將對象放入我的庫中,並放到單擊的舞臺上。似乎很容易?對?完全消失。任何幫助將是真棒:) 我的代碼到目前爲止是:AS3對象出現onClick鼠標在舞臺上點擊的位置
package code {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Main extends MovieClip {
public var redBox: Box = new Box(mouseX, mouseY);
public function Main() {
// constructor code
stage.addEventListener(MouseEvent.CLICK, mouseClickEvent);
}
public function mouseClickEvent(e:MouseEvent):void {
addChild(redBox);
}
}
}
即主,然後框代碼是:
package code {
import flash.display.MovieClip;
public class Box extends MovieClip{
public function Box(myX:Number, myY:Number) {
// constructor code
myX = x;
myY = y;
}
}
}