ConnectSessionContainer' declaration must be contained within the <Declarations> tag

1.8k Views Asked by At

I tried to follow this example: http://coenraets.org/blog/2010/07/video-chat-for-android-in-30-lines-of-code/ but I still get errors after hours of searching for any solution on the web.

I'am using Adobe Flash Builder 4.6 and Flex 4.5.1 SDK, I also installed the LifeCycle Collaboration Service, and added the lccs.swf to my projects buildpath.

<?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>

The compiler says following:

'ConnectSessionContainer' declaration must be contained within the tag, since it is not assignable to the default property's element type 'mx.core.IVisualElement'.

I'am totaly new to Flex, so dont kill me if there is a simple solution to this. Thanks in advance!

1

There are 1 best solutions below

2
On

What about <s:Application> root tag?

update: Try check this, may be you also have whitespaces.