Hi all thanks for taking the time to look at my post.
I have a small problem that i can not figure out and i need some one to look from outside of the box as i am getting frustrated and making mistakes.
THE PROBLEM: i have a working video page for my webpage but i can not get the video description to change when i select a different video from my video list.
I have a dynamic text field called GameInfo_txt that should change the text to the videos description.
Here is my Action Script:
//----------Creating The Video Source To Run----------//
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(30);
ns.onStatus = function(info){
if(info.code == "NetStream.Buffer.Full"){
bufferclip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty"){
bufferclip._visible = true;
}
if(info.code == "NetStream.Play.Stop"){
ns.seek(0);
}
}
theVideo.attachVideo(ns);
//----------Controls For Video Player----------//
rewind_btn.onRelease = function(){
ns.seek(0);
}
play_btn.onRelease = function(){
ns.pause();
}
stop_btn.onRelease = function(){
ns.seek(0);
ns.pause();
}
//forward_btn.onRelease = function(){
//ns.seek(0);
//ns.pause();
//)
//----------Video Progress Bar----------//
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus(){
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 267.6;
loader.scrub._x = ns.time / duration * 267.6;
}
//----------The Scrubber - Moving Button To Move The Video Along Its Time Line----------//
var scrubInterval;
loader.scrub.onPress = function(){
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,257,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function(){
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit(){
ns.seek(Math.floor((loader.scrub._x/257)*duration));
}
//----------Right Click PopUp Menu On Video----------//
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;
var i1:ContextMenuItem = new ContextMenuItem(".: Video Controls :.",trace);
theMenu.customItems[0]=i1;
var i2:ContextMenuItem = new ContextMenuItem("Play / Pause Video",pauseIt,true);
theMenu.customItems[1]=i2;
var i3:ContextMenuItem = new ContextMenuItem("Replay Video",repalyIt);
theMenu.customItems[2]=i3;
var i4:ContextMenuItem = new ContextMenuItem("Copyright 2006 The OAPS Clan",trace,true);
theMenu.customItems[3]=i4;
function pauseIt(){
ns.pause();
}
function repalyIt(){
ns.seek(0);
}
//----------Sound Interaction----------//
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns) ;
var so:Sound = new Sound(vSound);
so.setVolume(100);
mute.onRollOver = function(){
if(so.getVolume() == 100){
this.gotoAndStop("onOver");
}
else {
this.gotoAndStop("muteOver")
}
}
mute.onRollOut = function(){
if(so.getVolume() == 100){
this.gotoAndStop("on");
}
else {
this.gotoAndStop("mute")
}
}
mute.onRelease = function(){
if(so.getVolume() == 100){
so.setVolume(0);
this.gotoAndStop("muteOver")
}
else {
so.setVolume(100);
this.gotoAndStop("onOver")
}
}
//----------Load XML Files Into List Component----------//
var vList:XML = new XML();
var inFO:Array = new Array;
var daTE:Array = new Array;
var whoIsOn:Number;
vList.ignoreWhite = true;
vList.onLoad = function(){
var videos:Array = this.firstChild.childNodes;
for(i=0;i<videos.length;i++){
videoList.addItem(videos*.attributes.desc,videos*.attributes.url,videos*.attributes.info);
inFO.push(videos*.attributes.info);
daTE.push(videos*.attributes.date);
}
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
GameInfo_txt.text = inFO[0];
whoIsOn = 0;
}
var vidList:Object = new Object;
vidList.change = function(){
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
}
videoList.addEventListener("change",vidList);
vList.load("video.xml");
//----------Button To Scroll Video Infomation----------//
Info_mc.down_btn.onRelease = function(){
Info_mc.infomation_txt.scroll+=1
}
Info_mc.up_btn.onRelease = function(){
Info_mc.infomation_txt.scroll-=1
}
MY XML CODE:
<?xml version="1.0" encoding="utf-8"?>
<videos>
<video url="GVideos/battlefield1942_pc02_trailer1OAPS.flv" desc="Battlefield 1942 Intro" date="27/1/07" info="Battlefield 1942 testing to work" />
<video url="GVideos/bf2142_om_pc_092906_0.flv" desc="Battlefield 2142" date="28/1/07" info="DDDDDDDDDDDDD" />
<video url="GVideos/bfvietnam_pc32104_cut1OAPS.flv" desc="Battlefield Vietnam Intro" date="27/1/07" info="AAAAAAAAAA" />
<video url="GVideos/bfvietnam_pc31604_6OAPS.flv" desc="Battlefield Vietnam 2" date="27/1/07" info="BBBBBBBBBB" />
<video url="GVideos/cod2_ot_mul_092705OAPS.flv" desc="Call of Duty 2" date="28/1/07" info="CCCCCCCCCCC" />
<video url="GVideos/169_crysis_ot_pc_032806OAPS.flv" desc="Crysis 1" date="28/1/07" info="The workings of crysid" />
<video url="GVideos/169_crysis_om_mul_010507OAPS.flv" desc="Crysis 2" date="28/1/07" info="In game footage" />
<video url="GVideos/guildwars_ot_pc_040805OAPS.flv" desc="Guild Wars" date="28/1/07" info="Game Intro" />
<video url="GVideos/169_ut2007_ot_082406OAPS.flv" desc="Unreal Tournament 2004" date="28/1/07" info="In game footage" />
</videos>
Really appreciate any help with this thanks :thumb2:
Dunkyb123