Wednesday, April 22, 2009

WED. Scripts Frame 2

var req:URLRequest = new URLRequest("squares.swf");
var loader:Loader = new Loader();



loader.load(req);
addChild(loader);




btnWhite.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerE);
function mouseDownHandlerE(event:MouseEvent):void {
    loader.unload();
}

btnBlack.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandlerG);
function mouseDownHandlerG(event:MouseEvent):void {
    addChild(loader);
}

No comments:

Post a Comment