tags:

views:

771

answers:

3

I'm trying to build a simple FLEX application. Unfortunately, I get '1131: Classes must not be nested.' errors even with the simples MXML .... the error pops out at the mx:Application openning tag: (I'm using PureMVC if it's important)

<?xml version="1.0" encoding="utf-8"?>
<mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:view="icm.view.components.*"
    viewSourceURL="srcview/index.html"
    name="ICM"
    layout="absolute"
    > //FLEX BUILDER SAYS THE ERROR IS HERE


<mx:Script>
        <![CDATA[
        import mx.effects.easing.Exponential;
        import icm.ApplicationFacade;

        public static const NAME:String = "AppSkeleton";
        private var facade:ApplicationFacade = ApplicationFacade.getInstance(NAME);
        ]]>
</mx:Script>

    <mx:Move id="slideInEffect" yFrom="5000" easingFunction="{Exponential.easeOut}" duration="1300"/>
    <mx:Fade id="fadeOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/>
    <mx:Fade id="fadeIn" duration="1000" alphaFrom="0.0" alphaTo="1.0"/>

<mx:Style source="css/yflexskin.css" />

    <mx:Canvas id="mainViewStack" left="0" top="0" right="0" bottom="0" >
        <mx:ViewStack id="vwStack" left="0" top="0" right="0" bottom="0" resizeToContent="false" creationPolicy="auto">
            <mx:VBox />
            <view:SplashScreen id="splashScreen" showEffect="{slideInEffect}" hideEffect="{fadeOut}" />
            <view:LoginScreen id="loginScreen" showEffect="{fadeIn}" />
            <view:MainScreen id="mainScreen" showEffect="{fadeIn}" />
        </mx:ViewStack>
    </mx:Canvas>

</mx:Application>

Can someone help me understand why? I've being doing a lot of non-sense tests because I'm not understanding it. Sometimes if I remove the Script section the compilation suceed, others not.

Thanks

A: 

Thank you all for the comments.

The greatest tip at this topic is: build with the SDK!!!

Flex Builder (both, the IDE and the Plugin) seems to lack a lot of features on error treatment and even when it reports an error it's not reliable.

A prompt window for compiling used with the IDE saved me a lot of headaches.

Thank you all again!

Sam
A: 

Thanks James. A clean fixed my problem too.

ozone1015
A: 

There is a flex compiler option "Enable Strict type checking" just de-select it. I think that can give so a simple solution....

uday