A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: XML not working with relative paths?

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    5
    Hey all... I've set up an XML object inside an MC that onLoad calls a function inside the same MC. This works, the function gets called every time (checked with a simple trace)... The problem is when I try to reference that XML object (named chatMe) inside the function (called checkXML)... It just won't return anything, except when I place everything on the _root, it WILL return the correct result...
    The code is use is this:
    for setting & loading the XML object:
    Code:
    chatMe = new XML();
    chatMe.onLoad = checkXML;
    chatMe.load("chatter.xml");
    Like I said, this DOES fire the checkXML function, which is on the same timeline (_root.f) as the chatMe XML-object, I can also see this in the debugger...
    And the code inside checkXML is this:
    Code:
    function checkXML () {
    	trace("checkXML "+chatMe.firstChild.nodeName);
    }
    I can *see* in my debugger that chatMe is inside the same timeline as checkXML, yet it won't return anything, BUT when I change checkXML to:
    Code:
    function checkXML () {
    	trace("checkXML "+_root.f.chatMe.firstChild.nodeName);
    }
    so I reference chatMe with its absolute path, it DOES work, even tho checkXML & chatMe are on the same timeline!!!
    Can somebody please explain this to me?? It just sounds very very lame to me.. Also since using ANY kind of relative path (this.chatMe.first... or _parent.f.chatMe.first..) won't work either...
    This wouldn't be SUCH a problem if I can actually use absolute paths, but this swf will be built inside another swf (loaded into a targetMC) and the targetMC could potentially be one of a series of targetMC's.
    Does anyone know the solution or a workaround or encountered the same problem?

    Hope it is all (somewhat) clear...

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    I have seen something like this before, it seems that this referencing has a problem when loading movies into different levels other than level0.

    I haven't looked much further than this as the problem wasn't mine but the main thing was fix it and fix it fast! Changing the load movie so it loads on Level0 fixed it.

    Thanks

    Luke

  3. #3
    Junior Member
    Join Date
    Oct 2001
    Posts
    1
    i've been experiencing the exact same behavior : everything works fine at root level, but embedding it in a movieclip doesn't work. Furthermore, i've tried loading the same movie on another level (even with XML call at _root). doesn't work either. bugged. mailto:chose@obstacle.com
    [Edited by chose on 10-31-2001 at 03:04 PM]

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