473,507 Members | 2,416 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Duplicating Movieclips to Match Imported XML Data

16 New Member
Hi All

I am writing a program to load in an xml file from the server and create an animation to represent this data (for use as a 'front end' for the data).

I have loaded in the XML data into the script no worries. I have also managed to duplicate 1 set of movieclips relating to this data. In this case there are 10 childnodes in the xml therefore 10 clips appear on stage.

Each of the childnodes has a different number of their own childnodes. I have populated an array using for loops (can also use while loops) with the amount of children of each childnode. I have also managed to populate an array of all the names of these further children.

That works fine, heres the problem....

I have a piece of code that when the button is clicked it will search the XML file for the correct childnode and then search this node further to return all children into an array. The code will create a duplicate of a movieclip for each of the children.......or at least it should!!!

I know the code is working correctly as the array is being populated and the trace i inserted is returning the correct amount of times. However when i debug i realise that instead of duplicating the clip say 10 times, it duplicates it once and moves it 9 spaces to the right, reusing the same instance each time.....

I am so sorry if i have confused anyone...This is realy causing me a problem....Maybe i am overlooking something simple?

Heres the function in question:

Expand|Select|Wrap|Line Numbers
  1. _global.courseDuplication = function() {
  2.  
  3.   for (var a=0;a<_global.categoryCount;a++){
  4.  
  5.     if(_global.currentName == vleXML.firstChild.childNodes[a].attributes.id) {
  6.  
  7.       for(var b=0; b < vleXML.firstChild.childNodes[a].childNodes.length; b++) {
  8.  
  9.         _root.courses_mc.duplicateMovieClip(vleXML.firstChild.childNodes[a].childNodes[b].attributes.id, this.getNextHighestDepth(), {_x:a*12});
  10.  
  11.         trace("duplicated!");
  12. }
  13. a = _global.categoryCount;
  14. _global.duplicationFunction = 0;
  15. }
  16. }
  17. }
NOTE: _global.categoryCount is populated with the number of firstChild.childNodes (in this case 10).

I would greatly appreciate any ideas....

Cheers

Gav
Sep 19 '08 #1
0 1826

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1363
by: johkar | last post by:
New to XSL and in need of assistance. I am building the tags fine iterating from a to b to c, now just need to keep the values from repeating if previously matched. Note that within the...
1
2205
by: bjam | last post by:
Hi, today I was able to abstract out into a separate xsl file a template that I specifically perform a call templates for, this worked with import no problem. However, when trying to do the same...
4
1740
by: Misto . | last post by:
Hi folks! Short: There is a way to dumplicate a module ? I tried copy.deepcopy(module) but hangs with an error (also with standard modules ).. The only solution that I have by now is...
6
2496
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
0
1223
by: Stewart Allen | last post by:
Hi there Opinions on the best way to do this. I want to import data from an Excel spreadsheet into Access and want the data to be tested before the tables are updated. At the moment all the...
2
4482
sumaiya
by: sumaiya | last post by:
I know how to load dynamic images in a movieclip sPhoto.loadMovie('http://localhost/1.jpg'); I have two movieclips "mcMain" and "mcArticle" mcMain ---- mcArticle --- mcPhoto mcPhoto is...
0
3548
by: sschus1 | last post by:
I keep getting a "Missing ; from statement" Also how do you reference the linkage id? I'm completely stuck. What i am trying ot do is write a script that selects a movieclip from the library,...
0
2680
by: gouthamgrs | last post by:
Can any one help me how to do drag and drop for multiple movie clips which are inserted dynamically. (Like match the following for example For question A (which is in lift side of the stage) answer...
1
2355
AutumnsDecay
by: AutumnsDecay | last post by:
Hey there. I have a flash project that I'm working on and I'm getting a weird error. I have a flash document with two movieclips. Inside each movieclip is a dynamic text field, which will allow...
0
7111
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.