Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    22
    Thanks
    5
    Thanked 0 Times in 0 Posts

    using 2 different xml scripts

    i would like to use 2 different xml scripts, one loads automatically and one loads when a button is pressed. however when i run the application the two xml scripts merge together???? i would like one to replace the other.


    Code:
    var xml:XML;
    
    
    function onLoaded(e:Event):void
    {
    	
    
    	
    	xml = new XML(e.target.data);
    	trace(xml);
    	
    	ilist = xml.item;
    
    for(var i:uint=0;  i<ilist.length(); i++)
    	{
    		lbox.addItem({data:ilist.link.text()[i], data:ilist.path.text()[i],
    					 label:ilist.title.text()[i]});
    		
    	}
    
    }
    
    
     
    
     
    on_auction.addEventListener(MouseEvent.CLICK, auctionlist);
    
    	function auctionlist(e:Event):void
    	{
    		
    		loader.load(new URLRequest("http://localhost/playlista_xml.php?u=12345"));
    	}
    			
    //loader.load(new URLRequest("http://localhost/playlist.php?u="+valueStr)); 
    loader.load(new URLRequest("http://localhost/playlist_xml.php?u=maroccano1"));

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    You could delete the variable before reloading.

    Code:
    delete lbox;
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

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