I'm attempting to manually load an XML object via a string. I appear to be
successfully completing this process: my XML is well-formed, and
myxmlobject.toString() returns a result, as do attempts to traverse the
attributes and nodes.
What isn't working is the XML object itself when I attempt to use it to
build a kirupa.com-style XML menu, or when I attempt to run the
.getBytesTotal() method on the object. My menuing and code works just fine
when I load the same XML from an external file and set up an onLoad event,
but it breaks when I use the XML as a string and attempt parseXml. The code
copied below returns undefined on the trace.
What I think I may be running into is Flash attempting to use the object
before it is parsed and loaded into memory, and I need the equivalent of
onParseComplete. Or maybe it's something else. Can anyone help on this
puzzling problem?
Thanks in advance for any assistance you can offer.
menu_xml = new XML();
menu_xml.ignoreWhite = true;
mymenuxml = (?xml version=\1.0\? menu name=\links\ menu
name=\About the UW\ action=\gotoURL\
variables=\http://www.washington.edu/home/about.html\;
item name=\Missions, Stats, Facts\ action=\gotoURL\
variables=\http://www.washington.edu/home/about.html\/ item
name=\Office of the President\ action=\gotoURL\
variables=\http://www.uwnews.org/Uwnews/sites/OOP/index.asp?sm=38\/
item name=\Visit the UW\ action=\gotoURL\
variables=\http://www.washington.edu/home/about.html\/
item name=\Diversity\ action=\gotoURL\
variables=\http://www.washington.edu/diversity/\/
item name=\UW Events\ action=\gotoURL\
variables=\http://www.washington.edu/home/events.html\/
item name=\Museums and Exhibits\ action=\gotoURL\
variables=\http://www.washington.edu/home/about.html\/
item name=\Administration and Governance\ action=\gotoURL\
variables=\http://www.washington.edu/home/about.html\/ item
name=\Emergency Information\ action=\gotoURL\
variables=\http://www.washington.edu/admin/business/oem/\/
/menu menu name=\Academics and Research\
action=\gotoURL\
variables=\http://www.washington.edu/home/departments/\;
item name=\Colleges, Schools, Departments\ action=\gotoURL\
variables=\http://www.washington.edu/home/departments/departments.html\/
item name=\Office of Research\ action=\gotoURL\
variables=\http://www.washington.edu/research/\/ item
name=\Office of Technology Transfer\ action=\gotoURL\
variables=\http://depts.washington.edu/techtran/\/
item name=\Office of Libraries\ action=\gotoURL\
variables=\http://www.lib.washington.edu/\/ /menu
menu name=\Admissions\ action=\gotoURL\
variables=\http://www.washington.edu/students/admissions.html\;
item name=\Admissions\ action=\gotoURL\
variables=\http://www.washington.edu/students/admissions.html\/
item name=\Campus Tours\ action=\gotoURL\
variables=\http://www.washington.edu/univrel/visitors/ctours.html\/
item name=\New Freshman Options\ action=\gotoURL\
variables=\http://www.tacoma.washington.edu/options/\/
item name=\Transfer Enrollment\ action=\gotoURL\
variables=\http://www.tacoma.washington.edu/transfer/\/
item name=\UW Bothell\ action=\gotoURL\
variables=\http://www.bothell.washington.edu/\/
item name=\UW Tacoma\ action=\gotoURL\
variables=\http://www.tacoma.washington.edu/\/item
name=\Continuing Education\ action=\gotoURL\
variables=\http://www.outreach.washington.edu/pc/uwhome/conted_fly/\/
/menu menu name=\UW Medicine\ action=\gotoURL\
variables=\http://www.uwmedicine.org/\; item
name=\Patient Care\ action=\gotoURL\
variables=\http://www.uwmedicine.org/PatientCare/PatientCareOverview/\/
item name=\Education\ action=\gotoURL\
variables=\http://www.uwmedicine.org/Education/EducationOverview/\/
item name=\Medical Research\ action=\gotoURL\
variables=\http://www.uwmedicine.org/Research/ResearchOverview/\/
item name=\Health Sciences Schools\ action=\gotoURL\
variables=\http://healthlinks.washington.edu/index.cfm?id=09769476-d91b-4f8
5-8e0b-2e1261cfe493\/ /menu
/menu)
menu_xml.parseXML (mymenuxml);
myxmlsize = menu_xml.getBytesTotal();
trace (myXMLSize+ myxmlsize);
[code above returns undefined]
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com