You're trying to apply an effect to a state, rather than to the object
that should be modified by the effect. Use _either_ transitions _or_
states.

State Method:
========================================================================
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
        <mx:states>
                <mx:State name="b1">
                        <mx:SetProperty target="{panel1}" name="y"
value="133"/>
                        <mx:SetProperty target="{panel1}" name="width"
value="636"/>
                        <mx:SetProperty target="{panel1}" name="height"
value="195"/>
                        <mx:SetProperty target="{button1}" name="x"
value="687"/>
                        <mx:SetProperty target="{button2}" name="x"
value="687"/>
                        <mx:SetProperty target="{button2}" name="y"
value="383"/>
                </mx:State>
                <mx:State name="b2">
                        <mx:SetProperty target="{panel1}" name="height"
value="477"/>
                        <mx:SetProperty target="{panel1}" name="x"
value="592"/>
                        <mx:SetProperty target="{panel1}" name="y"
value="10"/>
                        <mx:SetProperty target="{button1}" name="x"
value="539"/>
                        <mx:SetProperty target="{button1}" name="y"
value="10"/>
                        <mx:SetProperty target="{button2}" name="x"
value="539"/>
                        <mx:SetProperty target="{button2}" name="y"
value="51"/>
                </mx:State>
        </mx:states>
        <mx:Button x="96" y="336" label="b-1" id="button2"
click="currentState='b1'" moveEffect="myMoveEffect"/>
        <mx:Button x="205" y="336" label="b-2" id="button1"
click="currentState='b2'" moveEffect="myMoveEffect"/>
        <mx:Panel x="96" y="128" width="250" height="89"
layout="absolute" title="panel1" id="panel1" resizeEffect="scale"
moveEffect="myMoveEffect">
        </mx:Panel>
        
        <mx:Move id="myMoveEffect" duration="1000" />
</mx:Application>

========================================================================
Transition Method
========================================================================
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
        <mx:states>
                <mx:State name="b1">
                </mx:State>
                <mx:State name="b2">
                </mx:State>
        </mx:states>
        <mx:Button x="96" y="336" label="b-1" id="button2"
click="currentState='b1'"/>
        <mx:Button x="205" y="336" label="b-2" id="button1"
click="currentState='b2'"/>
        <mx:Panel x="96" y="128" width="250" height="89"
layout="absolute" title="panel1" id="panel1" resizeEffect="scale">
        </mx:Panel>
        
        <mx:Move id="myMoveEffect" duration="1000" />
        <mx:transitions>
                <mx:Transition fromState="*" toState="b1">
                        <mx:Parallel duration="1000">
                                <mx:Move target="{button1}" xTo="687"
yTo="336" />
                                <mx:Move target="{button2}" xTo="687"
yTo="383" />
                                <mx:Move target="{panel1}" xTo="96"
yTo="133" />
                                <mx:Resize target="{panel1}"
widthTo="636" heightTo="195" />
                        </mx:Parallel>
                </mx:Transition>
                
                <mx:Transition fromState="*" toState="b2">
                        <mx:Parallel duration="1000">
                                <mx:Move target="{button1}" xTo="539"
yTo="10" />
                                <mx:Move target="{button2}" xTo="539"
yTo="51" />
                                <mx:Move target="{panel1}" xTo="592"
yTo="10" />
                                <mx:Resize target="{panel1}"
widthTo="250" heightTo="477" />
                        </mx:Parallel>
                </mx:Transition>
        </mx:transitions>
</mx:Application>
========================================================================

Michael Krotscheck
Senior Developer

RESOURCE INTERACTIVE
www.resource.com
[EMAIL PROTECTED]

We support privacy and confidentiality. Please delete this email if it was 
received in error.

What's new ::
Capitalize on the social web | The Open Brand, a new book by Kelly Mooney and 
Dr. Nita Rollins, available March 2008 | www.theopenbrand.com


 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Gustavo Duenas
Sent: Friday, February 01, 2008 10:37 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] I don't get it!!! what is this problem



I have this code: 


<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " layout="absolute">
<mx:states>
<mx:State name="b1">
<mx:SetProperty target="{panel1}" name="y" value="133"/>
<mx:SetProperty target="{panel1}" name="width" value="636"/>
<mx:SetProperty target="{panel1}" name="height" value="195"/>
<mx:SetProperty target="{button1}" name="x" value="687"/>
<mx:SetProperty target="{button2}" name="x" value="687"/>
<mx:SetProperty target="{button2}" name="y" value="383"/>
</mx:State>
<mx:State name="b2">
<mx:SetProperty target="{panel1}" name="height" value="477"/>
<mx:SetProperty target="{panel1}" name="x" value="592"/>
<mx:SetProperty target="{panel1}" name="y" value="10"/>
<mx:SetProperty target="{button1}" name="x" value="539"/>
<mx:SetProperty target="{button1}" name="y" value="10"/>
<mx:SetProperty target="{button2}" name="x" value="539"/>
<mx:SetProperty target="{button2}" name="y" value="51"/>
</mx:State>
</mx:states>
<mx:Button x="96" y="336" label="b-1" id="button2"
click="currentState='b1'"/>
<mx:Button x="205" y="336" label="b-2" id="button1"
click="currentState='b2'"/>
<mx:Panel x="96" y="128" width="250" height="89" layout="absolute"
title="panel1" id="panel1">
</mx:Panel>




<mx:transitions>
<mx:Transition fromState="*" toState="*">
<mx:Parallel targets="{[b1,b2]}">
<mx:Move duration="10"/>
</mx:Parallel>
</mx:Transition>
</mx:transitions>


//according the book is ok for transitions but in my flex builder 2 it
gives me an error over and over again


it seems that the flex is taking the names of the states as undefined
properties....error 1020 







Some one could help me out .




Gustavo A. Duenas
Creative Director
LEFT AND RIGHT SOLUTIONS
904.  265 0330 - 904. 386 7958
www.leftandrightsolutions.com
Jacksonville - Florida






 

Reply via email to