473,800 Members | 2,332 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....Mayb e 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.categor yCount is populated with the number of firstChild.chil dNodes (in this case 10).

I would greatly appreciate any ideas....

Cheers

Gav
Sep 19 '08 #1
0 1840

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

Similar topics

0
1372
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 Extensions nodes, I am only concerned with those with fieldTypeCode of 10-17. There will be a maximum of four fieldTypeCode that will meet this criteria. Thank you What I want outputted:
1
2223
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 operation with a template that I use a match template on, IE was giving me the following error for the style sheet. Does anyone know how to import or include a match template versus a call named template? Thanks in advance for your help The...
4
1758
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 creating two files and importing them.
6
2509
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 products). Tables: tblCategoryDetails CategoryID SpecID
0
1241
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 data is validated via the data entry form where the BeforeUpdate event is used for some fields and also in the form. I know these events won't fire if the data is imported via code.
2
4502
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 inside mcArticle and is suppose load an image dynamicaly I am using the above code but it does not work. Please Help. My code is given below onClipEvent(load) {
0
3568
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, exports it as a Flash movie (swf) to an external folder and names the swf as the linkage ID in the moveiclip, then iterate through the rest of the movie clips in the library until it has exported all movieclips in the library. Here is what i have so...
0
2706
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 is B5(which is in right side of the stage)). When i drag the question A line should be generate from the the drag position. Please check the code attached with this. ... a = 0; b = 0; depth = 1000; for (i=0; i<6; i++) { if (i<3) { var...
1
2366
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 me to load text via variables. My issue is this: when I have both movieclips, flash cs 4 crashes. if I delete on of the layers the problem doesn't exist. The code for movieclip layer 1 is:
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10035
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9090
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2945
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.