I'm having a problem removing an image that it is called up externally. Here is the code on the first frame:
Code: stop();
import flash.net.URLRequest;
import flash.display.Loader;
var myFileRequest = new URLRequest("SampleImage.jpeg");
var myFileLoader:Loader = new Loader();
home.addEventListener(MouseEvent.CLICK, goToHome);
function goToHome(event:MouseEvent):void
{
SoundMixer.stopAll();
gotoAndStop("home");
if (contains(myFileLoader))
{
removeChild(myFileLoader);
}
}
about.addEventListener(MouseEvent.CLICK, goToAbout);
function goToAbout(event:MouseEvent):void
{
SoundMixer.stopAll();
gotoAndStop("about");
}
animation.addEventListener(MouseEvent.CLICK, goToAni);
function goToAni(event:MouseEvent):void
{
gotoAndStop("boat");
if (contains(myFileLoader))
{
removeChild(myFileLoader);
}
}I call the image up on the 6th frame by clicking the about button, here is the code:
Code: myFileLoader.load(myFileRequest);
addChild(myFileLoader);
trace(myFileLoader.numChildren);
myFileLoader.scaleX = 0.5;
myFileLoader.scaleY = 0.5;
myFileLoader.x = 200;
myFileLoader.y = 150;When I click on the home button it does not get rid of the image, please help.
Problem removing child
Wednesday, June 13, 2012
[Action Script] Problem removing child June,2012
Posted by Bimo Hery Prabowo at 7:13 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment