Advertisement

05.27.2008 at 01:48PM PDT, ID: 23436309
[x]
Attachment Details

Removing the addChild Displayobject from inside a function

Asked by rgarimella in Macromedia Flash

Hi All,

I have a loader function in AS3. See code below

I also have a next button. I need to remove the pictLdr when I click on the next button. How do I do that ?

Thanks

RGStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
next_btn.addEventListener(MouseEvent.CLICK, nextFunction);
 
function nextFunction(event:MouseEvent):void 
{
    removeChild(pictLdr); // Does not work
}
 
 
function loadImage(event:Event):void
{
	var pictLdr:Loader = new Loader();
	var pictURLReq:URLRequest = new URLRequest(pictURL);
	pictLdr.load(pictURLReq);
	
	addChild(pictLdr);
	
}
[+][-]05.28.2008 at 06:07AM PDT, ID: 21659984

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Macromedia Flash
Sign Up Now!
Solution Provided By: tagit
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628