I'm still getting the same error...
The class exists in the loginForm.mxml but the mxml code exists in the
login.mxml file.
Is there something special I have to do to use the functions that exist
in the other mxml file?
Better yet, is there a way to access variables other than setting up a
function in the active script?
Thanks much.
-----------
All AS code needs to be inside the curly braces and you need to
concatenate your static string to the string returned from your function
<mx:Text text="{returnEmail() + ' is logged on'}" />
--------------
I'm working on a logon class in Flex 3. I've got a login.mxml which
controls the overall views (logon/register/logout) all in the same box
depending on what state the user is in.
In the loginForm.mxml (included in the logon.mxml), I've got a function
called protected returnName():String
Function I want to call from the loginForm AS3 script:
protected function returnName():String (I've also tried public in case
it was not available in that area of code)
{
return this.username.text;
}
Snippet from my mxml code:
Xmlns:login="com.ft.views.login.*";
...
<mx:State name="loggedIn">
<mx:AddChild position="lastChild">
<mx:Panel
width="75%" height="50%" layout="vertical"
verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:VBox width="100%" height="100%" verticalScrollPolicy="off"
horizontalScrollPolicy="off">
<mx:Text text="{returnEmail()} is logged on;" /> <---------
line in question --------
<login:LogoutForm
logoutSuccessful="this.currentState='onLogin()';" />
</mx:VBox>
</mx:Panel>
</mx:AddChild>
</mx:State>
I can't seem to figure out how to reference the method as I get the
error: 1180: Call to a possibly undefined method returnName.
I've tried:
<mx:Text text="{loginForm.returnEmail()} is logged on;" />
<mx:Text text="{login.returnEmail()} is logged on;" />
Among many others...
This is probably pretty simple. I really appreciate your help.
--
This message has been scanned for viruses and
dangerous content by MailScanner <http://www.mailscanner.info/> , and is
believed to be clean.