Example
The following example first show the source dimensions of the FLV file (
and
preferredHeight
change the dimensions of the FLVPlayback instance, triggering a
the
property to
autoSize
dimensions of the source FLV file. The
FLVPlayback instance in the Output panel after each event.
Drag an FLVPlayback component to the Stage, and give it an instance name of
my_FLVPlybk. Then add the following code to the Actions panel on Frame 1 of
the Timeline:
/**
Requires:
- FLVPlayback component in the Library
*/
import mx.video.*;
my_FLVPlybk.maintainAspectRatio = false;
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object) {
trace("FLV width is: " + my_FLVPlybk.preferredWidth + " FLV height is: "
+ my_FLVPlybk.preferredHeight);
my_FLVPlybk.setSize(400, 400);
my_FLVPlybk.autoSize = true;
};
my_FLVPlybk.addEventListener("ready", listenerObject);
listenerObject.resize = function(eventObject:Object) {
trace("my_FLVPlybk width is: " + my_FLVPlybk.width + ";
my_FLVPlybk.height is: " + my_FLVPlybk.height);
};
my_FLVPlybk.addEventListener("resize", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
water.flv";
See also
FLVPlayback.maintainAspectRatio
FLVPlayback.preferredWidth
FLVPlayback.backButton
Availability
Flash Player 8.
Edition
Flash Professional 8.
) when the FLV file is ready to play. Then it calls the
, triggering another
true
resize
,
FLVPlayback.preferredHeight
,
FLVPlayback.resize
resize
event that restores the size to the
resize
event handler displays the dimensions of the
preferredWidth
to
setSize()
event. Next, it sets
,
FLVPlayback class
559
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers