SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    question about reaching data i loaded through XML -as3

    i cant reach my data - i loaded it with:
    Code:
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    xmlLoader.load(new URLRequest("gallery.xml"));
    var infoXML:XML;
    
    function xmlLoaded(evt:Event):void{
    	infoXML = new XML(xmlLoader.data);
    }
    i know it is working because rollover a button with :
    Code:
    var targetNumber:Number;
    function btn_Roll(event:MouseEvent):void{
    	targetNumber = event.currentTarget.name.slice(4,6);
    	rollClip_mc.roll_txt.text = infoXML.city.title[targetNumber];
    }
    so i know infoXML.city.title[targetNumber];reaches the data i want, and for what i understand infoXML is like an Array.
    but if i try to call it from another place it gives me an error or null.
    so i dont know how i can reach the data??

  2. #2
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,547
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    Are you accessing it from the other place before it has had time to be parsed?

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you! you were right....


Bookmarks

Posting Permissions

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