1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| var conn:NetConnection = new NetConnection();
conn.connect(null);
var stream:NetStream = new NetStream(conn);
var metaListener:Object = new Object();
stream.client = metaListener;
var st:SoundTransform = new SoundTransform();
stream.soundTransform = st;
var video:Video = new Video();
video.attachNetStream(stream);
video.width = 352;
video.height = 288;
//A click listener telLs the movie when an item is clicked
function onClick(e:tree3DItemEvent) {
if (e.item.data.attribute("videok")!= undefined && boovideo==true ){
boovideo=false;
video_mc.addChild(video);
stream.play(new URLRequest(e.item.data.attribute("videok")));
trace(e.item.data.attribute("videok"));
function sousvideoclic(event:MouseEvent):void {
if (boovideo==false){
video_mc.removeChild(video);
stream.close();
boovideo=true;
sousvideo.y=-700;
}}
sousvideo.y=0;
sousvideo.addEventListener(MouseEvent.CLICK, sousvideoclic);
} |