Advertisement

05.13.2008 at 02:24AM PDT, ID: 23397081
[x]
Attachment Details

Loading/Unloading Movieclips

Asked by gelitup in Macromedia Flash, Miscellaneous Web Development

Tags: Adobe, Flash, CS3, Actionscript 3

I have the navigation set up as an external movie clip, loading external SWFs into the main container. Loading-in part is fine. Problem comes in when I cant unload the movie-clips while loading another clip through another movie-clip "button".

I've tried removeChild(); removeChildAt(); parent.removeChild(); but to no avail. Does anyone have any insight on this?

I've attached the code below. Thanks in advance.
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
var p01:MovieClip = new project01();
 
	p01.x = 0;
	p01.y = 0;
	addChild(p01);
	
var p02:MovieClip = new project02();
 
	p02.x = 50;
	p02.y = 0;
	addChild(p02);
	
var p03:MovieClip = new project03();
 
	p03.x = 100;
	p03.y = 0;
	addChild(p03);
	
p02.addEventListener(MouseEvent.MOUSE_OVER, p02Over);
p02.addEventListener(MouseEvent.MOUSE_OUT, p02Out);
 
function p02Over(Event:MouseEvent):void {
	
	p02.alpha = 0.5;
	}
 
function p02Out(Event:MouseEvent):void {
	
	p02.alpha = 1;
	}
	
p02.addEventListener(MouseEvent.CLICK, p02Click, false, 0, true);
 
function p02Click(Event:MouseEvent):void {
	
	if(parent.contains(gallery01)) {
		removeChild(gallery01);
	}
	
	var gallery02:Loader = new Loader();
 
	gallery02.load(new URLRequest("galleryHolder02.swf"))
	
	gallery02.x= 155;
	gallery02.y = 0;
	this.addChildAt(gallery02, 2);
 
}
[+][-]05.13.2008 at 06:40PM PDT, ID: 21560612

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 07:18PM PDT, ID: 21560783

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 08:40PM PDT, ID: 21561086

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

Zones: Macromedia Flash, Miscellaneous Web Development
Tags: Adobe, Flash, CS3, Actionscript 3
Sign Up Now!
Solution Provided By: Vulturous
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.14.2008 at 07:31AM PDT, ID: 21564610

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628