|
|
 |
Re: FN-FORUM: Flash & XML
date posted 24th June 2003 23:40
longshot...always good to have your function before its called. IE put
loadMenuArray before catList.onLoad = loadMenuArray;
hth
Paul
>From: John Kyle [EMAIL REMOVED]
>Reply-To: [EMAIL REMOVED]
>To: FN-FORUM / [EMAIL REMOVED] [EMAIL REMOVED]
>Subject: Re: FN-FORUM: Flash & XML
>Date: 24 Jun 2003 22:38:27 -0000
>
>Hello Dan,
>
>I have the following in frame 1:
>
>// load in product categories from xml file
>var myArray = new Array();
>var catList;
>catList = new XML();
>catList.ignoreWhite = true;
>catList.load("menu.xml");
>catList.onLoad = loadMenuArray;
>
>function loadMenuArray() {
> menuArray = new Array();
> menuYPos = 0;
> for (var count01=0; count01 if(this.childNodes[count01].nodeName == "testTable") {
> // create object and store at array position
> var tmpChild = catList.childNodes[count01].childNodes;
> var tmpId = tmpChild[0].childNodes[0].nodeValue;
> var tmpName = tmpChild[1].childNodes[0].nodeValue;
> menuArray[count01] = new Array(tmpId,tmpName);
>
> //need to duplicate and position menu movie clip
> catCopyClip.duplicateMovieClip("menuId"+count01,count01);
>
> // reposition movie clip
> tmpMovie = eval("menuId" + count01);
> tmpMovie._y = menuYPos;
> tmpMovie._x = 0;
> tmpMovie.catTitle.text = tmpChild[1].childNodes[0].nodeValue;
> tmpMovie.catId = tmpChild[0].childNodes[0].nodeValue;
> tmpMovie.catName = tmpChild[1].childNodes[0].nodeValue;
> menuYPos+=18;
>
> }
> }
> myArray = menuArray;
>}
>
>the myArray = menuArray amounts to nothing
>
>In frame 2 I have:
>
>trace(myArray);
>stop();
>
>The trace outputs nothing; however, if i add a trace to the building up of
>the menuArray - I get all of the variables I am after after parsing the xml
>file. I am stumped, any ideas????
>
>Best Regards
>
>John Kyle (iMS Ltd)
>
>
>==========
>Graduate & Professional Financial Services - Specialists in MORTGAGES for
>FREELANCERS. House purchase, re-mortgage (including debt consolidation and
>capital raising), Buy to Let, flexible offset and current account
>mortgages.
>Visit our website at http://www.gradprof.co.uk?fnet
>
>To advertise here: http://www.freelancers.net/advertising.html
>
> |
 |
|