A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Loading vars from xml file on _level1

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    18
    Hi guys,

    Shortly, I have some variables place holders in my movie and they are linked to xml file.
    Like...
    NewsXML = new XML();
    NewsXML.load("news.xml");...and so on..

    So it all works fine but when this movie is loaded on _level 1, xml data is not loaded.
    I am 100% sure about xml script.
    So xml object works only with _level0?...No.

    Could anyone clarify it to me, please.


    Thanks!




    Trump

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    You want to make sure that the onLoad callback handler is referenced absolutely - and not relatively.

    Targeting is the biggest mistake made with stuff like this.

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Location
    Romania
    Posts
    154
    vaykent, just wanted to let you know: THANK YOU!!! had the same problem, and looks like a very simple advice like this one just made everything happen the way it should be.. thx!

  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    No problem - Flash has some funky routing....

  5. #5
    Junior Member
    Join Date
    Mar 2001
    Posts
    2

    Re: Uhh...

    I am having the same problem. Can you elaborate on what you mean by "make sure that the onLoad callback handler is referenced absolutely - and not relatively"?

    Should he have done:
    NewsXML.onload = _level1.handleXMLloaded

    I tried this and it didn't work. Thanks.

  6. #6
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    A lot of people reference things 'relatively'... this will lead to problems if you're not sure where things are...

    ... and when you're dealing with XML - a lot of people get lsot about where things are.

    If you wanted to reference a function called 'myFunc' then you might do it this way:

    nameOfYourXMLObject.onLoad = myFunc;

    BUT - if you're havnig problems triggering the function then you should try referencing it absolutely, like htis:

    nameOfYourXMLObject.onLoad = _root.pathToTheFrameOrClip.myFunc;

    That will eliminate the worry of having to know where things are...

    I hope that made more sense.

  7. #7
    Junior Member
    Join Date
    Mar 2001
    Posts
    2
    I think I discovered the problem. There seems to be a bug in the Stand-alone player that screws up the path of the onLoad callback function. I tried using the browser flash player by way of opening the swf embeded in an html and it worked fine.

  8. #8
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    Like I said - it's too much of a pain to figure out the paths.. and you can avoid that if you use absolute references.

  9. #9
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    In regard to your flash player version, you probably find that the player that shipped with Flash is V5.0.31 while the browser has been updated along the way and is at 5.0.41+ there are a number of things that work better in .41 in regards to XML.

    Thanks

    Luke

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