Hi Everyone,
I'm having trouble with using the <mx:states> and <mx:transitions>
tags in my mxml files that inherit from an as class using to the "code
behind" technique. The compiler throws this error:

"Could not resolve <mx:transitions> [or <mx:states>] to a component
implementation."

Taken from the docs, here's the mxml file I'm working with:

<?xml version="1.0"?>
<TestAppBase xmlns:mx="http://www.adobe.com/2006/mxml"; 
        xmlns="*"
        width="400">
    
    <mx:states>
        <mx:State name="One">
            <mx:SetProperty target="{p1}" name="x" value="110"/>
            <mx:SetProperty target="{p1}" name="y" value="0"/>
            <mx:SetProperty target="{p1}" name="width" value="200"/>
            <mx:SetProperty target="{p1}" name="height" value="210"/>
            <mx:SetProperty target="{p2}" name="x" value="0"/>
            <mx:SetProperty target="{p2}" name="y" value="0"/>
            <mx:SetProperty target="{p2}" name="width" value="100"/>
            <mx:SetProperty target="{p2}" name="height" value="100"/>
            <mx:SetProperty target="{p3}" name="x" value="0"/>
            <mx:SetProperty target="{p3}" name="y" value="110"/>
            <mx:SetProperty target="{p3}" name="width" value="100"/>
            <mx:SetProperty target="{p3}" name="height" value="100"/>
        </mx:State>
        <mx:State name="Two">
            <mx:SetProperty target="{p2}" name="x" value="110"/>
            <mx:SetProperty target="{p2}" name="y" value="0"/>
            <mx:SetProperty target="{p2}" name="width" value="200"/>
            <mx:SetProperty target="{p2}" name="height" value="210"/>
            <mx:SetProperty target="{p3}" name="x" value="0"/>
            <mx:SetProperty target="{p3}" name="y" value="110"/>
            <mx:SetProperty target="{p3}" name="width" value="100"/>
            <mx:SetProperty target="{p3}" name="height" value="100"/>
        </mx:State>
    </mx:states>
    
    <!-- Define the single transition for all view state changes.-->
    <mx:transitions>
        <mx:Transition fromState="*" toState="*">
            <mx:Sequence id="t1" targets="{[p1,p2,p3]}">            
                <mx:Blur duration="100" blurXFrom="0.0" blurXTo="10.0"
                       
                        blurYFrom="0.0" blurYTo="10.0"/>
                <mx:Parallel>
                        <mx:Fade duration="700" alphaFrom="0" alphaTo="1"/>
                    <mx:Move duration="400"/>
                    <mx:Resize duration="400"/>
                </mx:Parallel>    
                <mx:Blur duration="100" blurXFrom="10.0" blurXTo="0.0"
                       
                        blurYFrom="10.0" blurYTo="0.0"/>            
            </mx:Sequence>
        </mx:Transition>
    </mx:transitions>
    
    <!-- Define the Canvas container holding the three Panel
containers.-->
    <mx:Canvas id="pm" width="100%" height="100%">
        <mx:Panel id="p1" title="One" x="0" y="0" width="100"
height="100"                
                click="currentState='One'">
            <mx:Label fontSize="24" text="One"/>
        </mx:Panel>
        <mx:Panel id="p2" title="Two" x="0" y="110" width="100"
height="100"                 
                click="currentState='Two'">
            <mx:Label fontSize="24" text="Two"/>
        </mx:Panel>
        <mx:Panel id="p3" title="Three" x="110" y="0" width="200"
height="210"                 
                click="currentState=''">
            <mx:Label fontSize="24" text="Three"/>
        </mx:Panel>
    </mx:Canvas>
    
</TestAppBase>


And here's the "code behind" .as file:

package
{
        import mx.core.Application;
        import mx.states;
        import mx.states.Transition;
        import mx.effects.*;

        public class TestAppBase extends Application
        {
                public function TestAppBase()
                {
                        //TODO: implement function
                        super();
                }
                
        }
}

Thanks,
Bruce






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to