비트 맵을 스테이지에로드 한 다음 AS 코드를 사용하여 완전히 트위닝하려고합니다. 다음은 작동하지만 스테이지에 새로운 비트 맵 이미지를 추가하면 마지막 비트 맵 이미지가 남겨져 동일한 비트 맵이로드됩니다.기본 ActionScript 3 스프라이트 트위닝
아이디어가 있으십니까? 나는 "removeChild (myLoader);"를 추가하려고 시도했다. 그러나 그것은 아무것도하지 않았다. 많은 감사합니다. 당신이 실제로 하나의 객체를 이동하는 것이 아니라, 서로 다른 위치에 여러 개체를로드 -
import flash.display.MovieClip;
import flash.events.*;
stage.frameRate = 31;
var a =0;
btn111.addEventListener(MouseEvent.CLICK, go);
function go(event:MouseEvent):void
{
this.addEventListener(Event.ENTER_FRAME, drawrect);
function drawrect(evt:Event)
{
// Create a new instance of the Loader class to work with
var myLoader:Loader=new Loader();
// Create a new URLRequest object specifying the location of the external image file
var myRequest:URLRequest=new URLRequest("logo.png");
// Call the load method and load the external file with URLRequest object as the parameter
myLoader.load(myRequest);
// Add the Loader instance to the display list using the addChild() method
addChild(myLoader);
// Position image
myLoader.x = 100;
myLoader.y = a++;
if(a > 50)
{
//removeChild(box);
removeEventListener(Event.ENTER_FRAME, drawrect);
}
}
}