User Guide
562 FLVPlayback Component (Flash Professional Only)
Drag an FLVPlayback component to the Stage, and give it an instance name of
my_FLVPlybk. Drag a RadioButton component and then a Label component to the Library
panel. Then add the following code to the Actions panel on Frame 1 of the Timeline. In the
statement that loads the
contentPath property, replace the italicized text with the name and
location of your SMIL file.
/**
Requires:
- FLVPlayback component in the Library
- RadioButton component in the Library
- Label component in the Library
*/
import mx.video.*;
import mx.controls.*;
this.createClassObject(Label, "my_prompt", 10);
my_prompt.text = "Please indicate your connection speed: ";
this.createClassObject(RadioButton, "dialup", 20, {label:"Dialup modem (56
KB)", groupName:"radioGroup"});
this.createClassObject(RadioButton, "isdn", 30, {label:"ISDN (128 KB)",
groupName:"radioGroup"});
my_prompt.autoSize = "left";
dialup.setSize(200, 30);
isdn.setSize(200, 30);
// Position RadioButtons on Stage.
my_prompt.move(my_FLVPlybk.x, my_FLVPlybk.y + my_FLVPlybk.height + 40);
dialup.move(my_FLVPlybk.x, my_prompt.y + my_prompt.height + 5);
isdn.move(my_FLVPlybk.x, dialup.y + 15);
// Create listener object
var rbListener:Object = new Object();
rbListener.click = function(eventObject:Object){
if(dialup.selected) { // for modem
my_FLVPlybk.bitrate = 56000;
} // for isdn (or higher bandwidths) allow automatic detection
}
// Add listener
radioGroup.addEventListener("click", rbListener);
my_FLVPlybk.contentPath = "http://www.someserver.com/video/sample.smil";