Flash XML swfs
- Started
- Last post
- 13 Responses
- vaporstouch
bear with me here. i have one XML doc, and two swfs accessing it. the swfs are both loaded into MCs in the main timeline. the nodes in the XML are grouped into sections with children who are items with info in attributes. EX:
(project label="Misc")
(item label="IPS Mural" url="images/projects/project_img... link="www" resp="info")My description is here
(/item)(/project)one swf("navSwf") goes through the XML and generates a menu of link using html textboxes and hrefs. thats fine. the other swf("displaySwf") take the nodes info and displays it. that works fine. on the nav hrefs i currently have asfunctions(which do nothing, i am thinking its the way to go), and i am trying to pass the info of the selected item from the navSwf to displaySwf. EX: in navSwf i click on item 3, so i need to tell the displaySwf to access that item 3 node and parse/display its attributes. it is here where i am lost, how can i do this?
i may not be setting this up the best i understand, but any help to get this working is greatly appreciated. thanks for taking the time to read this novel.
- unformatted0
i stopped reading after like 5 lines. might want to link a txt file so it's easier to read.
- vaporstouch0
youve got Gmail.
any ideas are welcome.
thanks
- function820
well for starters the XML you gave as an example isnt formed properly
not ()
- function820
ah.. that explains it perhaps
- function820
reading deeper, i dont really understand why you're using multiple swf files. Are they being loaded into one swf (onLoad) or are they seperate completly, and why do you need 2 swfs?
- unformatted0
well i meant an actual txt file with your AS too.
but you could do this w/o the ASFunction.
asuming you are using attachMovie to make your nav, assign an onRelease event to it and pass the info to those movieclips.
then when you click the button call a function that loads the info that was passed from the movieclip.
i wouldn't do this in 2 swfs unless you need to.
- unfittoprint0
to construct a multi level xml you'll have to 'copy' the xml structure when parsing. How?
I always separate the data 'retrieving' from the layout constuction. First you should use nested for loops to construct a multidimensional array [as in multi levels]. After the onLoad function, run each level of your array [using a for loop] and use the the library linked items to populate your menu's items and subitems.
- vaporstouch0
thank you for the responses. let me explain a bit about the swfs. in my main timeline i have 3 empty MCs. one loads a main nav swf, one that loads a sub nav swf, and one that loads content...so if i someone clicks on the "project section", the subnav project swf loads, parses the project XML. the content swf also parses the project XML to load the first project's info. which works fine, but the subnav swf is a html text box with hrefs, and i need to pass the node info that selected in the subnav to the content swf. maybe it would be best to have the subnav and content in one swf?
thanks again
- ********0
that's some too much XML for one thread, post the XML link. something.xml
- vaporstouch0
sorry dont have hosting right now...the XML consists of project nodes, which encompass item nodes...:
(xmldoc)
(project label="Misc")
(item label="IPS Mural" url="images/projects /project_img.jpg" link="www" resp="info")My description is here
(/item)//then another item
//then another tem, etc
(/proj)
(/xmldoc)
- vaporstouch0
simply, can i pass info from one loaded swf to another?..such as when a user clicks on a href, call an asfunction to somehow parse the project info, then pass that to the content swf...?
or should i combine those 2 swfs...?
- unfittoprint0
the content could reside in the main movie and be targetedby the loaded movie either using _parent or making the variable/object global.
less work.
- vaporstouch0
thanks unfit, will give it a shot....