Advertisement

09.04.2008 at 07:24AM PDT, ID: 23702724
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.9

Dynamically create/manipulate image movieclips

Asked by Oneiroid in Macromedia Flash, ActionScript

Tags: , ,

I have a working slideshow that currently uses manually-created image movieclips which reside in the symbol library. For these, I use attachMovie so that I can use them as slides in the slideshow.

I am now trying to modify my slideshow so that it uses XML information to locate external PNG files, then turn them into movieclips for use as slides in the slideshow.

The XML part appears to be working well, but I am having difficulties manipulating the newly created 'slides'. The snippet I've included indicates that all of the movieclips should be created on the stage, but are not visible. However, when the code is run, the slides are still visible, stacked up on top of each other (showing the last one loaded). Oddly, the trace data shows expected values.

Ive also tried loading the images using an instance of the MovieClipLoader, but I get the very same results.  Any ideas?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:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
// Code that loads the XML and generates the image movieclips
 
var dataNum = 1;
var img:Array = new Array();
var data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success){
	if(success) {
		hcl_data = this.firstChild.childNodes;
		no_data = hcl_data.length;
		NumRemove=no_data;
		slideshowSpeed=hcl_data[0].attributes.slideshowSpeed;	
		for(n=1;n<no_data;n++) {
			img[n-1]=hcl_data[n].attributes.img;
			holder.createEmptyMovieClip("slide"+dataNum,dataNum);
			holder["slide"+dataNum].loadMovie(img[dataNum-1]);
			holder["slide"+dataNum]._visible=false;
			trace(img[n-1]);
			trace(  "visible: " + holder["slide"+dataNum]._visible + 
				", level: "+holder["slide"+dataNum].getDepth());
			dataNum++;
		}
		// Start slide show commented out for testing
	}
	else { trace("XML load error");	}
}
data_xml.load("XML/Slideshow.xml");  
 
 
 
// Trace data
 
img/slideshow/1_dog.png
visible: false, level: 1
img/slideshow/2_fat.png
visible: false, level: 2
img/slideshow/3_frameslbanks2.png
visible: false, level: 3
img/slideshow/4_lisa.png
visible: false, level: 4
img/slideshow/5_mimzy.png
visible: false, level: 5
img/slideshow/6_startrek.png
visible: false, level: 6
img/slideshow/7_true.png
visible: false, level: 7
img/slideshow/8_body.png
visible: false, level: 8
img/slideshow/9_grant2.png
visible: false, level: 9
img/slideshow/10_grind2.png
visible: false, level: 10
img/slideshow/11_mich.png
visible: false, level: 11
img/slideshow/12_vengeance.png
visible: false, level: 12
img/slideshow/13_tdh.png
visible: false, level: 13
 
 
[+][-]09.05.2008 at 06:09AM PDT, ID: 22398395

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

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

 
[+][-]09.05.2008 at 10:10PM PDT, ID: 22406154

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, ActionScript
Tags: Adobe, Flash, Actionscript 2.0 / CS3
Sign Up Now!
Solution Provided By: aneeshchopra
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628