我收到了一條錯誤消息,說「嘗試訪問不可訪問的方法旋轉通過帶有靜態類型的引用flash.display:Sprite.ssd.rotation(90) }「 我只想知道如何在雙擊它時旋轉我的圖像90度。Actionscript 3.0旋轉圖像90度,從url加載
var shootingstar:Loader = new Loader();
shootingstar.load(new URLRequest("http://i51.tinypic.com/m8jp7m.png"));
shootingstar.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete);
var ssd:Sprite = new Sprite();
function onLoadingComplete(event:Event):void
{
ssd.addChild(event.currentTarget.loader.content);
ssd.addEventListener(MouseEvent.MOUSE_DOWN, drag);
ssd.addEventListener(MouseEvent.MOUSE_UP, drop);
ssd.addEventListener(MouseEvent.DOUBLE_CLICK, rotate)
ssd.height=180
ssd.width=124
}
function drag(event:MouseEvent):void{
ssd.startDrag()
}
function drop(event:MouseEvent):void{
ssd.stopDrag()
}
function rotate():void{
ssd.rotation(90)
}
sd.doubleClickEnabled = true; 我需要啓用doubleclick – starfox55 2010-11-10 22:57:31