2012-01-20 41 views
1

我試圖遵循這個例子:http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/但是在網絡上搜索任何解決方案几小時後,我仍然遇到錯誤。ConnectSessionContainer的聲明必須包含在<Declarations>標記中

我使用的是Adobe Flash Builder 4.6和Flex 4.5.1 SDK,我還安裝了LifeCycle Collaboration Service,並將lccs.swf添加到我的項目構建路徑中。

<?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:rtc="http://ns.adobe.com/rtc" currentState="logon" fontSize="28"> 

<fx:Script> 
    [Bindable] private var roomURL:String = "URL HERE!"; 

    protected function connect():void { 
     auth.userName = userName.text; 
     currentState = "default"; 
     session.login(); 
    } 
</fx:Script> 

<s:states> 
    <s:State name="default"/> 
    <s:State name="logon"/> 
</s:states> 

<fx:Declarations> 
    <rtc:AdobeHSAuthenticator id="auth"/> 
</fx:Declarations> 

<s:TextInput id="userName" includeIn="logon" top="200" horizontalCenter="0"/> 
<s:Button label="Connect" click="connect()" includeIn="logon" top="250" horizontalCenter="0" height="50" width="150"/> 

<rtc:ConnectSessionContainer id="session" roomURL="{roomURL}" authenticator="{auth}" autoLogin="false" width="100%" height="100%" includeIn="default"> 
    <rtc:WebCamera top="10" left="10" bottom="10" right="10"/> 
</rtc:ConnectSessionContainer> 

</s:Application> 

編譯器說以下內容:

「ConnectSessionContainer」聲明必須包含在 標籤內,因爲它是不能分配到默認 屬性的元素類型「mx.core.IVisualElement」。

我總是新來Flex,所以如果有簡單的解決方案,就不要殺了我。提前致謝!

回答

1

怎麼樣<s:Application>根標籤?

更新: 嘗試檢查this,可能你也有空格。

+0

對不起,我在Flash Builder中有該標籤。似乎我忘記了一些如何,當我做這個線程。 –

+0

@opous您能否請編輯您的代碼片段,因爲它在Flash Builder中? –

+0

我已經更新了帖子,整個源代碼:) –