using XML and movieClips/Objects?
Im not really sue how to go about this..
assuming this is a valid XML document:
code:
<products>
<product1>
<image>image1.jpg</image>
<name>Example Shirt 1</name>
<price>$19.99</price>
<size>small</size>
<description>etc..etc..etc.</description>
</product1>
<product2>
<image>image2.jpg</image>
<name>Example Shirt 2</name>
<price>$24.99</price>
<size>medium</size>
<description>etc..etc..etc.</description>
</product1>
</products>
I have never used or played with XML before...anywhere...whether in HTML(schemas) or in/through FLASH.....but sort liek loading a varObject correct? then pathing to whatever node/element I need?
1.) Can FLASH actually create or EDIT an XML document? or is it the same rules that apply to text files (read only) (needs to be prepared prior)
2.) My main focus of this is:
I would like to just be able to edit/update the XML file to add more products (same layout as above).. and have FLASH read how many products there are(an array Im assuming) ..and create an OBJECT (productObject) using the info INSIDE each of the product NODES. (I guess using attachMovieClip or duplicateMovieClip?)
So I would like to have a base MOVIECLIP or OBJECT that has a little visual layout that is STATIC for EVERY product and DUPLICATE this for EACH product NODE...."AS WELL AS" have each product NODE match the details in that element
So FLASH reads the XML file..sees ther is 3 products 1, 2 and 3...
It will then create (duplicate??) this BASE object modle hat has the same BG color, same tex, and graphics...but then take the value in the <image> element and place this inside the productObject...same for price, name & desc. ...then move onto product node 2 and do the same thing to poulate a NEWLY created clip (object ?)
I know this needs (for me at least) to be tackled in several steps... but would like some oversight on where to get started on this.
Would I need to use some sort of array.length property to get how many "productNodes" there are...and then either attach or duplicate a premade "shell" movieClip to match that number..?
never used much of either (attach or duplicate)...so would I go about populating these "dups" with the new characteristics of each node in the XML document? (product elements)
heres a link to an image of the type of "SHELL" I want to create, then duplicate (and then ultimately, populate with the values from the XML document)
http://www.flashkit.com/board/attach...chmentid=37353
IMAGE (being a blankClip that gets an .jpg loaded into it.)
Name
Price
Description
are all dynamic text fields being, and 4 of these get their content form the XML file (nodes)
The DropDown Color & DropDown Size are pre-made (static value) drop down boxes or components...and the buy button (also never changing) that grabs all the values and sends them off to "wherever..paypal for all I care for now)
any help is appreciated
Thanks