0
Hai我有page1.mxml中的SwfControl,我需要隱藏並顯示該控件...在頁面1我隱藏該控件和頁面2我需要顯示該控件如何去做?如何從一個mxml訪問swfcontrols到其他mxml
注page1.mxml是主頁
page1.mxml
<?xml version="1.0" encoding="utf-8"?>
<local:WindowsControl xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:local="*"
height="100%" width="100%"
backgroundColor="#FFFFFF"
backgroundAlpha="0">
<mx:HBox x="11" y="167" horizontalGap="0">
</mx:HBox>
<mx:SWFLoader id="loader" source="loading.swf" visible="false"/>
</local:WindowsControl>
我需要隱藏的的SWFLoader在page1.mxml和顯示的的SWFLoader在page2.mxml
page2
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" creationComplete="init()" width="164" height="150" cornerRadius="3">
<mx:Script>
<![CDATA[
import flash.media.Microphone;
import flash.media.Video;
public function init():void
{
loader.visible=true;
}
]]>
</mx:Script>
<mx:VBox height="100%" width="100%" horizontalAlign="center" backgroundColor="#000000" >
<VideoContainer id="vids" opaqueBackground="true" width="160" height="120" />
</mx:VBox>
</mx:Canvas>
我認爲你應該Google爲「在另一個組件的Flex訪問屬性」有很多答案,我相信這是你需要的解決方案。以下是我給出的一個答案:http://stackoverflow.com/questions/3847461/what-is-flex-good-practice-to-change-another-components-state – JeffryHouser
http://www.kirupa.com/forum /showthread.php?298578-Accesing-mxml-components-from-AS-class-(flex-3)我正在搜索這個鏈接,我申請了這個,但是我在VideoContainer類中有錯誤 – JavaH
你能引導我嗎? – JavaH