Hi. I'm relativly new to flash and actionscript. and im currently trying to build a video site where users can register and log in and load and save a playlist of thier favorite videos. I found several examples of makeing a registration page and log in page but im not at that point yet. I've made the site load video information like url, artist and title. Where the XML has this format:

<vidoes>
<video url="song_artist1.flv" title="song1" artist="artist1" />
<video url="song_artist2.flv" title="song2" artist="artist2" />
<video url="song_artist3.flv" title="song3" artist="artist3" />
<video url="song_artist4.flv" title="song4" artist="artist4" />
<video url="song_artist5.flv" title="song5" artist="artist5" />
<video url="song_artist6.flv" title="song6" artist="artist6" />
<videos>

This XML is loaded and then for each item a button is made in a custom scrollbox. i got this part working perfectly

this is the AS for it.

Code:
function vidInfoContent(inUrl, inDesc, inArtist, inNum){
	this.url = inUrl;
	this.desc = inDesc;
	this.num = inNum;
	this.artist = inArtist;
	return this;
}

var vidInfo = new Object();
vidInfo.content = new Array();

vlist.onLoad = function() 
{
	var videos:Array = vlist.firstChild.childNodes;
	for(i=0;i<videos.length;i++) 
	{
		vidInfo.content[i] = new vidInfoContent(vlist.firstChild.childNodes[i].attributes.url,vlist.firstChild.childNodes[i].attributes.desc,vlist.firstChild.childNodes[i].attributes.artist,i);

		scrollbox.videoList.attachMovie("playlistItem", "item" + i, (i+1), vidInfo.content[i]);
		scrollbox.videoList["item"+i]._y = i * 12;
		scrollbox.videoList["item"+i]._x = 0;
		if(i == (videos.length - 1))
		{
//This Interval can be ignored
		populateInterval = setInterval(populateList,50);
		}
	}

}
Now what i want to do is make a "favorites" list. When the user presses a button i want it to save the information on a database/xml or wherever or however. Becuase i dont know how to use mysql or php, i tired to save the data on a different xml with the following format:


<User id = "User1">
<song url="SDB_Crazy.flv" desc="Crazy" artist="Son DamBi"/>
<song url="SNSD_Gee.flv" desc="Gee" artist="SoNyeoShiDae"/>
</User>
<User id = "User2">
<song url="SDB_Crazy.flv" desc="Crazy" artist="Son DamBi"/>
<song url="SNSD_Gee.flv" desc="Gee" artist="SoNyeoShiDae"/>
</User>
<User id = "User3">
<song url="SDB_Crazy.flv" desc="Crazy" artist="Son DamBi"/>
<song url="SNSD_Gee.flv" desc="Gee" artist="SoNyeoShiDae"/>
</User>
<User id = "User4">
<song url="SDB_Crazy.flv" desc="Crazy" artist="Son DamBi"/>
<song url="SNSD_Gee.flv" desc="Gee" artist="SoNyeoShiDae"/>
</User>

when the xml is loaded it will search the xml for the user id when it finds it. it will use the attributes of the child nodes to create new buttons in a seperate "favorites" scrollbox.

for testing purposes i made a function "addSong" to add a Song and when ever it is called it will add a new <song> tag under the correct <user>. i tired using the XML.insertBefore method, but i cant seem to get it to work.

Code:
function addSong(inUrl, inDesc, inArtist) {
	var insertPoint:XMLNode = favlist.firstChild;
	var newNode:XML = new XML("<song url=" + inUrl + " desc=" + inDesc + " artist=" + inArtist + " />");
	favlist.insertBefore(newNode, insertPoint);
}
there are two areas in the code im having problems with.
first:
var insertPoint:XMLNode = favlist.????.

i dunno wut to put in the ???? area. to be able to put it between the corrent <user> </user> tags.

second:
the newNode:XML = new XML(...); the code above doenst work. but im sure u know wut im trying to do. how would i go about doing this?


those are my two main problems, but im not sure if im going in the right direction... becuase i dont think i can save the changes to the XML file after a new favorite is added.



I would appreciate some insight. If i cant do this with a single XML file, or with XML files in general, how would i save such information to a MySQL database?


I've been stuggleing with this for a few days now. And usually i enjoy the challenge of figureing things out myself but this is one that i cannot do on my own without some assistance.

and im using AS 2.0, not 3.0.
thanks ^ ^;