digitalpencil
Programmer
Hi,
I've been developing a project that displays FLVs through a video object using the netstream/netconnection method. New FLVs are loaded into the display via buttons in a side-nav MC which, trigger a new netstream path.
In order that I didn't have to apply individual code to each of these buttons, I instead wrote the following actionscript that looks at the instance name of the button that was onReleased, and takes the number on the end of the instance name and uses it as the path to the FLV..
//------- SETUP NETSTREAM/CONTROLLER FUNCTIONS/LOADING BAR/SCRUB/TXT -----------
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(15);
stream_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);
}
}
my_video.attachVideo(stream_ns);
stream_ns.play("
//------- DYNAMIC FLV/BUTTON CODE --------------------
//use a for loop to reduce repetition of the code
for(i=1;i<80;i++){
theButton=_root.scrollerMC.thumbscroll["vid"+i];
//this variable stores what number button it is
theButton.thisNum=i;
theButton.onRelease = function() {
//set stream
stream_ns.play("}
controllerMC.rewindBTN.onRelease = function() {
stream_ns.seek(0);
}
}
As i've labelled all my FLVs 1.flv 2.flv etc and the buttons that call them as vid1 vid2 etc, this code is working. However, as my side-nav containing these buttons is broken into three frames, which switch as the user changes a selection in my combo-box; the code (written in my root timeline) is only being applied to the first and currently displaying frame of my side-menu.
Therefore, my question is this.. How can I apply that same code to the second and third frames of the movieclip containing my buttons?
I have uploaded my SWF/FLA to my server for your reference, the urls to each are as follows:
and
Currently there are only associated FLVs uploaded for Le Mans Start and Le Mans End sections although I will be uploading for the cycling section throughout the day.
Any advice you can provide is greatly appreciated,
Thanks,
DigiPencil
I've been developing a project that displays FLVs through a video object using the netstream/netconnection method. New FLVs are loaded into the display via buttons in a side-nav MC which, trigger a new netstream path.
In order that I didn't have to apply individual code to each of these buttons, I instead wrote the following actionscript that looks at the instance name of the button that was onReleased, and takes the number on the end of the instance name and uses it as the path to the FLV..
//------- SETUP NETSTREAM/CONTROLLER FUNCTIONS/LOADING BAR/SCRUB/TXT -----------
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(15);
stream_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);
}
}
my_video.attachVideo(stream_ns);
stream_ns.play("
//------- DYNAMIC FLV/BUTTON CODE --------------------
//use a for loop to reduce repetition of the code
for(i=1;i<80;i++){
theButton=_root.scrollerMC.thumbscroll["vid"+i];
//this variable stores what number button it is
theButton.thisNum=i;
theButton.onRelease = function() {
//set stream
stream_ns.play("}
controllerMC.rewindBTN.onRelease = function() {
stream_ns.seek(0);
}
}
As i've labelled all my FLVs 1.flv 2.flv etc and the buttons that call them as vid1 vid2 etc, this code is working. However, as my side-nav containing these buttons is broken into three frames, which switch as the user changes a selection in my combo-box; the code (written in my root timeline) is only being applied to the first and currently displaying frame of my side-menu.
Therefore, my question is this.. How can I apply that same code to the second and third frames of the movieclip containing my buttons?
I have uploaded my SWF/FLA to my server for your reference, the urls to each are as follows:
and
Currently there are only associated FLVs uploaded for Le Mans Start and Le Mans End sections although I will be uploading for the cycling section throughout the day.
Any advice you can provide is greatly appreciated,
Thanks,
DigiPencil