Skip navigation
DMB89
Currently Being Moderated

Switching XML sheets

Jul 17, 2012 12:47 AM

Hi people. I will try and explain as simply as possible on this one...

 

i have the following AS2 script:

 

ManualPlay.onRelease = function(){

    myXML.load("../../config/settings/page_list.xml");

    _global.xmlVersion = assets;

    trace(xmlVersion);

}

AutoPlay.onRelease = function(){

    myXML.load("../../config/settings/page_list_auto.xml");

    _global.xmlVersion = assets_auto;

    trace(xmlVersion);

}

 

i then have another script that detects if the xmlVersion is assets_auto and if true stop the timeline else continue playing:

 

stop();

 

if (_global.xmlVerson == assets_auto)

{

    trace("auto mode");

     _root.gotoAndPlay(2);

}

else

{

     trace("manual mode");

    play();  

}

 

All the traces seem to come back correct but the actions dont seem to take affect. it always goes to manual mode and the timeline continues to play.

 

i think i need to convert the assets_auto etc value to a string or something but i dont really understand what i need to do.

 

any help will be amazing thank you

 
Replies
  • Currently Being Moderated
    Jul 17, 2012 4:26 AM   in reply to DMB89

    If you do not have quotations around your "assets" and "assets_auto" everywhere they appear, then you probably need to, unless those are names of variables that have other values assigned somewhere else.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2012 4:51 AM   in reply to DMB89

    You should trace the value of _global.xmlVersion just before the conditional to see what it is...

     

    stop();

     

    trace(_global.xmlVersion)

     

    if (_global.xmlVerson == "assets_auto")

     

    and if you are still missing the quotes which I show above, they need to be there (the forum does remove quotes at times)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points