-
[RESOLVED] enable button
ahoy,
i'd like to enable buttons when my video has progressively downloaded certain amounts...
eg:
Code:
nav_but_1.enabled=false;
nav_but_2.enabled=false;
if(myVid.("has downloaded 20seconds"){
nav_but_1.enabled=true;
}
if(myVid.("has downloaded 40seconds"){
nav_but_2.enabled=true;
}
dont know how...
this is running online, not using a flash streaming server just using an FLVplayback component on stage...
is this even possible?
thanks!
-
EDIT:
something like this:
nav_but_1.enabled=false;
nav_but_2.enabled=false;
if(myVid.bytesLoaded==10000000){
nav_but_1.enabled=true;
}
if(myVid.bytesLoaded==20000000){
nav_but_2.enabled=true;
}
but it no work
-
.
Hi,
From the top of my head I think it might be something along these lines.
PHP Code:
nav_but_1.enabled=false; nav_but_2.enabled=false;
LoadVideoButton.onPress = function() { MyVid.load("1.flv"); MyVid.play(); onEnterFrame = function () { LoadedBytes = MyVid.bytesLoaded / 1000; TotalBytes = MyVid.bytesTotal / 1000; //LoadedBytes = MyVid.getBytesLoaded() / 1000;// ONE OR THE OTHER //TotalBytes = MyVid.getBytesTotal() / 1000;// ONE OR THE OTHER Percentage = Math.floor((LoadedBytes / TotalBytes) * 100); Percent.text = Percentage; if(Percentage > 10){ nav_but_1.enabled=true; } if(Percentage > 20){ nav_but_2.enabled=true; delete onEnterFrame; } }; };
But you might be better off looking into netStream as you have more control over load etc etc, and it's not so hard to do.
-
that's worked!
thanks a lot!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|