"Upload" means to send data to a server. I don't think that's what you mean.
Do you mean that you want to have this xml file on a server and load it into flash? Then flash will parse the xml and make links from it?
First, change your xml. Don't use unique tags for each link, use the same tag. That will let you get an XMLList of all the links easily.
Code:
<xml>
<link>
<movie_title>###</movie_title>
<movie_URL>###</movie_URL>
<movie_desc>###</movie_desc>
</link>
<link>
<movie_title>###</movie_title>
<movie_URL>###</movie_URL>
<movie_desc>###</movie_desc>
</link>
</xml>
Once you've got it loaded into an XML variable, you can get the list of links like this:
Code:
var linkNodes:XMLList = myXMLVariable.link;
Then once you have those, you can make a function to build your clickable link objects.
Code:
function makeLinks(lnodes:XMLList):Array{
var toreturn:Array = [];
for (var i:int=0; i < lnodes.length(); i++){
var linkData:XML = lnodes[i];
var link:Link = new Link(linkData.movie_title.toString(), linkData.movie_url.toString(), linkData.movie_desc.toString());
toreturn.push(link);
}
return toreturn;
}
Of course, you will need to make a Link class. Here's a very basic one that ignores the description part for now.
Code:
public class Link extends Sprite{
private var tf:TextField;
private var url:URLRequest;
private var description:String;
public function Link(title:String, url:String, desc:String){
this.tf = new TextField();
tf.autoSize = TextFieldAutoSize.LEFT;
tf.text = title;
addChild(tf); //forgot this line initially
this.url = new URLRequest(url);
this.description = desc;
tf.addEventListener(MouseEvent.CLICK, openURL);
}
private function openURL(e:MouseEvent):void{
navigateToURL(url);
}
}