It sounds like what you really want to know is "If I have component <B>
inside of component (or application) <A>, how can ActionScript code in B
access A's properties and methods?" (Setting the currentState property
of the app from one of its components is simply a special case of this.)

 

The answer is by using the parentDocument property.

 

- Gordon

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of David Terry
Sent: Monday, January 22, 2007 1:35 PM
To: [email protected]
Subject: RE: [flexcoders] Re: Please Help - Components, States, &
Transitions

 

If it was that simple I would not be asking for help.

 

I can figure out how to change state when all controls are in the same
application, but I can't figure out how to make a "custom control"
change the state of the parent.

 

If the <comp:Login> control has the register button, and this is the
'parent' page, how does the 'login' tell the parent to change to the
'Register' state?

 

~David T.

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " layout="absolute"
xmlns:comp="assets.components.*" currentState="Login">

 

 <mx:Style source="../assets/css/main.css"/>

 

 <mx:states>
  <mx:State name="Register">
   <mx:AddChild position="lastChild">
    <comp:signup1 horizontalCenter="0" verticalCenter="0"/>
   </mx:AddChild>
  </mx:State>
  <mx:State name="Login">
   <mx:AddChild position="lastChild">
    <comp:login horizontalCenter="0" verticalCenter="0">
    </comp:login>
   </mx:AddChild>
  </mx:State>
 </mx:states>

 

</mx:Application>

 

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of theduderino82
Sent: Monday, January 22, 2007 3:08 PM
To: [email protected]
Subject: [flexcoders] Re: Please Help - Components, States, &
Transitions

It's really much more simple then you think. There are some good
tutorials on the flex start page. Just type in the search "transition"
or "state".

 

Reply via email to