652
Chapter 7: ActionScript for Flash
Description
Read-only property; the number of seconds assigned to the buffer by
NetStream.setBufferTime()
. The default value is .1(one-tenth of a second). To determine
the number of seconds currently in the buffer, use
NetStream.bufferLength
.
Example
The following example dynamically creates a text field that displays information about the
number of seconds that are currently in the buffer. The text field also displays the buffer length
that the video is set to, and percentage of buffer that is filled.
this.createTextField("buffer_txt", this.getNextHighestDepth(), 10, 10, 300,
22);
buffer_txt.html = true;
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(3);
my_video.attachVideo(stream_ns);
stream_ns.play("video1.flv");
var buffer_interval:Number = setInterval(checkBufferTime, 100, stream_ns);
function checkBufferTime(my_ns:NetStream):Void {
var bufferPct:Number = Math.min(Math.round(my_ns.bufferLength/
my_ns.bufferTime*100), 100);
var output_str:String = "<textformat tabStops='[100,200]'>";
outp= "Length: "+my_ns.buffe"\t"+"Time:
"+my_ns.buf"\t"+"Buffer:"+bu"%";
outp= "</textformat>";
buffer_txt.htmlText = output_str;
}
See also
NetStream.time
NetStream.bytesLoaded
Availability
Flash Player 7.
Usage
my_ns
.bytesLoaded
:Number
Description
Read-only property; the number of bytes of data that have been loaded into the player. You can
use this method in conjunction with
NetStream.bytesTotal
to estimate how close the buffer is
to being full—for example, to display feedback to a user who is waiting for data to be loaded into
the buffer.
Содержание FLEX-FLEX ACTIONSCRIPT LANGUAGE
Страница 1: ...Flex ActionScript Language Reference...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Страница 135: ...case 135 See also break default strict equality switch...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in...
Страница 808: ...808 Chapter 7 ActionScript for Flash...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Страница 822: ...822 Index...