我的問題是這樣的:
我想使用mxml作爲可視元素...我想以圖形方式設置組件,並將其作爲類編程,因爲它對我來說很簡單...如何做到這一點???我有兩個類:一個是和一個MXML ...這是我的代碼:ActionScript 3和mxml
public class chat extends Application{
private var nc:NetConnection = null;
public var connect:Button;
public var status:Text;
public function VideoChat(){
addEventListener(FlexEvent.APPLICATION_COMPLETE, mainInit);
}
private function mainInit(event:FlexEvent):void{
status.text = "Status quo";
connect.addEventListener(MouseEvent.CLICK, doConnect);
}
和MXML:
所有的<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600" backgroundColor="#FBF8F8"
preloaderChromeColor="#CC3535"
>
<mx:Button x="77" y="547" height="19" label="Connect" id="connect"/>
<mx:UIComponent id="videoReceiveContainer" x="77" y="52" width="500" height="400"/>
<mx:Button x="507" y="547" label="Play" id="play"/>
<mx:Text id="status" x="77" y="460" width="501" height="58"/>
<mx:Button x="297" y="547" label="Publish" id="publish"/>
</s:Application>
什麼是**問題**?什麼是**不工作**或**不瞭解**? –
是這個okey代碼?因爲當我運行它只是播放空白頁... – Jovan
對我來說,它顯示了三個定義的按鈕,沒有別的。它展示的是什麼? –