FORUMS: list search recent posts

Arrays and xml maybe?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
FishcakeUK
Arrays and xml maybe?
on Sep 4, 2007 at 10:19:39 am

I have to build a CD-rom, which firstly shows a list of products and a brief summary of each.

The user will be able to select products to add them to a list (I was thinking an array here).

Once they've compiled their list they click a button and get further details of just those products in their list, this info really needs to be pulled from an xml file or similar as it will be updated from time to time.

Does anyone have any idea, examples of the best was of doing this as I'm fairly new to the more complicated actionscript.

Thanks in advance.

James



Return to posts index

Doccie
Re: Arrays and xml maybe?
on Sep 4, 2007 at 1:36:45 pm

Best thing for you to do is create everything in XML. Load in your XML, then compile a list of selectable products from that XML (that way, if you add new products, the list gets updated right away). Then, indeed, use an array to store the selected products and in the end, loop through the XML object again using the following actionscript:

for(i=0; i for(j=0; j if(xmlRoot.childNodes[i].firstChild.childValue == selectArray[j]){
//print stuff
}
}
}

This is largely pseudo-code of course. For one, I can't do much if I don't know the structure of your XML file :) But also, you caught me right in the middle of a busy period.

For more on XML, look for XML.load in the Flash help files.



Return to posts index

Doccie
Re: Arrays and xml maybe?
on Sep 4, 2007 at 1:39:32 pm

Hmmm, well... that got messed up pretty bad... :-)
apparantely Creative COW doesn't allow 'smaller then' signs.

for(i=0; i 'smaller then' xmlRoot.childNodes.length; i++){ for(j=0; j 'smaller then' selectArray.length; j++){
if(xmlRoot.childNodes[i].firstChild.childValue == selectArray[j]){
//print stuff
}
}
}



Return to posts index


FishcakeUK
Re: Arrays and xml maybe?
on Sep 7, 2007 at 2:50:17 pm

Thanks for the advice. I don't suppose you / anyone could point me in the direction of a demo or tutorial?

Thanks


Return to posts index

Doccie
Re: Arrays and xml maybe?
on Sep 7, 2007 at 5:10:31 pm

For that particular problem? No, I don't think so :) If you give me some time - at least until next weekend - I will try to put something together for you.

In the mean time... Have a look at this basic tutorial (actionscript.org)



Return to posts index

FishcakeUK
Re: Arrays and xml maybe?
on Sep 10, 2007 at 6:53:31 am

If you could put something together that would be great, I would be forever in your debt!!

Thanks for the link also, I will have a read through.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]