Trailer : Adobe flash cs4 tutorial XML Video Player






dapat bagaimana mudahnya untuk membuat video player XML didorong adobe flash cs4 menggunakan 3 actionscript




var loader:URLLoader = new URLLoader();

loader.addEventListener(Event.COMPLETE,xmlloaded);



var xml:XML = new XML();

var amountofvid:Number=0;

var currentvideo:Number=0;



btn1.addEventListener(MouseEvent.CLICK,nextvid);

btn2.addEventListener(MouseEvent.CLICK,prevvid);



function xmlloaded(e:Event) {

xml=XML(e.target.data);

amountofvid=xml.video.length()-1;

changevid();

}



function nextvid(e:Event) {

currentvideo++;

changevid();

}



function prevvid(e:Event) {

currentvideo--;

changevid();

}



function changevid():void {

var cv:Number=Math.abs(currentvideo);



if (cv>amountofvid) {

currentvideo=cv=0;

}

if (currentvideo<0) { currentvideo=cv=amountofvid; } t_txt.text=xml.video.@title[cv]; vid.source =xml.video.@src[cv] ; } loader.load(new URLRequest('videos.xml'));

Blog Archive