dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: xml code that used to work in 6+7 now doesnt in 8

  1. #1
    Slinky Designs slinky2000's Avatar
    Join Date
    Jun 2001
    Location
    Ireland
    Posts
    1,227

    xml code that used to work in 6+7 now doesnt in 8

    I've an old xml interactive piece here that was devolped last year in flash 6 AS1

    it was totally dependant by called the node id like for example:

    _root.panel_001.myXML.tabTitle0.childNodes

    but I can't get it to work in f8, I can if I type in the direct adress i.e.

    _root.panel_001.myXML.childNodes[0].childNodes[0].childNodes[1].childNodes

    but I'd rather get this old example working the way it was designed to save me a weeks work!

    any ideas? did f8 change the way it calls nodes?
    Last edited by slinky2000; 03-21-2006 at 06:47 AM.

  2. #2
    Slinky Designs slinky2000's Avatar
    Join Date
    Jun 2001
    Location
    Ireland
    Posts
    1,227
    ok not a perfect solution but has sorta worked none the less. I came across this tutorial using the XPAth in Flash. I've never heard of it before.

    http://www.informit.com/articles/art...?p=169633&rl=1

    basically it involves setting a path to the node content, searching for it, putting the answer into an array and then retrieving it out of it again.

    for example to get the node "tabTitle0" that I was trying to get above:

    ----------------------------------------------------------------

    path = "/step/locale/step-text[@id='tabTitle0']"
    arNodes = mx.xpath.XPathAPI.selectNodeList(this.firstChild, path);
    mynode = arNodes[0].firstChild.nodeValue
    trace(mynode)

    ----------------------------------------------------------------

    A bit long winded considering I've about 100 of these nodes to get, so I've to change my 100 odd lines of code callign 100 different id names to 300 lines to get the same content.

    what the hell happened here!

    I knows its not a great idea the way it was done in the first place but it was a long time ago when we were first introduced to xml and flash.

    I blame tupps for reading his tutorial on xml and id tags, lol
    Last edited by slinky2000; 03-21-2006 at 08:14 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center