視頻對象是土生土長的Flash播放器來實現這個目的 - 不是Flex類,所以它不會做Flex組件所能做的所有事情,比如有一個邊框,或者一個角RadRadius樣式。
最簡單的解決方案是將視頻對象封裝到具有功能的Flex組件中你需要,但你不能只是簡單地做:flexC omponent.addChild(videoObject);
你需要做這樣的事情:
var video:Video = new Video();
var uiComponent:UIComponent = new UIComponent();
// UIComponent allows you to add non Flex children to it w/addChild()
// but you can't do this w/the Flex container classes (like Group, etc.)
uiComponent.addChild(video);
現在,您的視頻對象被包裹在一個UIComponent,而你可以在UIComponent添加到任何Flex容器......
var container:BorderContainer = new BorderContainer();
container.addElement(uiComponent);
// now set your border/corner radius styles...
container.setStyle("cornerRadius", 2);
container.setStyle("borderColor", #FF0000);
這是使用非Flex組件(如Video或Sprite)作爲Flex組件子項的常用方法。我相信你可以通過搜索短語來找到更多關於此的信息,比如「向Flex組件添加雪碧」
乾杯!