Help please! Loading videos externally using xml

Hi all,

Just wondering if anyone could help me out here!? I’ve created an application (adapted from one of the tutorials at gotoandlearn.com) which loads icons from an external xml script onto the screen! When the mouse rolls over an icon, the name of that icon appears on the screen! When an icon is clicked, all the other icons fade away and that icon moves to the left centre of the screen - what I also want to do is for a video to play as well?? I’ve created a video object called theVideo on the stage but can’t seem to get any videos to load!! The code in my xml file is

[COLOR=red]<?xml version=“1.0” encoding=“ISO-8859-1”?>[/COLOR]
[COLOR=red]<icons>[/COLOR]
[COLOR=red]<icon image=“icon1.png” tooltip=“object1” video=“video_basics_1.flv” />[/COLOR]
[COLOR=red]</icons>[/COLOR]

[COLOR=black]The following code opens up my netstream connection - the video objects alpha is zero originally as i only want it viewed when an icon is clicked[/COLOR]

[COLOR=red]var nc:NetConnection = new NetConnection();[/COLOR]
[COLOR=red]nc.connect(null);[/COLOR]
[COLOR=red]var ns:NetStream = new NetStream(nc);[/COLOR]
[COLOR=red]theVideo.attachVideo(ns);[/COLOR]
[COLOR=red]theVideo._alpha = 0;[/COLOR]

[COLOR=black]The following code both create my xml object and is my onload function - the code relating to loading the videos is shown in blue[/COLOR]

[COLOR=red]var xml:XML = new XML();[/COLOR]
[COLOR=red]xml.ignoreWhite = true;[/COLOR]
[COLOR=red]xml.onLoad = function()[/COLOR]
[COLOR=red]{[/COLOR]
[COLOR=red]var nodes:Array = this.firstChild.childNodes;[/COLOR]
[COLOR=red]numOfItems = nodes.length;[/COLOR]
[COLOR=red]for(var i=0;i<numOfItems;i++)[/COLOR]
[COLOR=red]{[/COLOR]
[COLOR=red]var t = home.attachMovie(“item”,“item”+i,i+1);[/COLOR]
[COLOR=red]t.angle = i * ((Math.PI2)/numOfItems);[/COLOR]
[COLOR=red]t.onEnterFrame = mover;[/COLOR]
[COLOR=red]t.toolText = nodes
.attributes.tooltip;[/COLOR]
[COLOR=red][COLOR=navy]// Here’s where i load my videos[/COLOR]
[COLOR=red]t.theVideo.loadMovie(nodes*.attributes.video);[/COLOR]
t.icon.inner.loadMovie(nodes*.attributes.image);
t.ref.inner.loadMovie(nodes*.attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}[/COLOR]

[COLOR=black]The following is then my release function - numerous things happen in this function! All icons not clicked, and the name of the icon, fade out and disappear and the clicked icon moves over to the left centre of the stage! The code relevant to loading the videos is again shown in blue[/COLOR]

[COLOR=red]function released()[/COLOR]
[COLOR=red]{[/COLOR]
[COLOR=red]home.tooltip._alpha = 0;[/COLOR]
[COLOR=red]for(var i=0;i<numOfItems;i++)[/COLOR]
[COLOR=red]{[/COLOR]
[COLOR=red]var t:MovieClip = home[“item”+i];[/COLOR]
[COLOR=red]t.xPos = t._x;[/COLOR]
[COLOR=red]t.yPos = t._y;[/COLOR]
[COLOR=red]t.theScale = t._xscale;[/COLOR]
[COLOR=red]delete t.icon.onRollOver;[/COLOR]
[COLOR=red]delete t.icon.onRollOut;[/COLOR]
[COLOR=red]delete t.icon.onRelease;[/COLOR]
[COLOR=red]delete t.onEnterFrame;[/COLOR]
[COLOR=red]if(t != this._parent)[/COLOR]
[COLOR=red]{[/COLOR]
[COLOR=red]var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);[/COLOR]
[COLOR=red]var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._xscale,0,1,true);[/COLOR]
[COLOR=red]var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);[/COLOR]
[COLOR=red]}[/COLOR]
[COLOR=red]else[/COLOR]
[COLOR=red]{[/COLOR]
[COLOR=red]var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._yscale,100,1,true);[/COLOR]
[COLOR=red]var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);[/COLOR]
[COLOR=red]var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);[/COLOR]
[COLOR=red]var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,320,1,true);[/COLOR]
[COLOR=red][COLOR=navy]var tw5:Tween = new Tween(theVideo,"_alpha",Strong.easeOut,0,100,1,true);[/COLOR]
[COLOR=red]// Above the video is faded onto the stage and below is the line to play the video[/COLOR]
[COLOR=red]ns.play(t.getItemAt(t.selectedIndex).data);[/COLOR]
var s:Object = this;
tw.onMotionStopped = function()
{
s.onRelease = unReleased;
}
}
}
}[/COLOR]

[COLOR=black]I know there’s a lot to read through in this post but if anyone has any idea what i’m doing wrong or how I could get this working it would be greatly appreciated!!??? [/COLOR]
What I’m trying to do is to play a specific video when it’s corresponding icon is clicked?? Any ideas anyone??? Thanks a mil in advance, jus can’t seem to figure this out!!!

Derm