Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Flex 3 :Help needed in implementing View States

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am new to Flex , i am trying to understand View States , tried for one hour but got confused .
(Basically by seeing the examples i understood the concept , but failed to implement )

Please help .

Assume my requirement is at the load of the page , i want to show an Login Button and a Chnage State Button (common button) only .and when the Change State button is clicked on ,i want to show the Register Button .

So for this i made two Forms , and a common button .



--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


( I think some how i can write the Logic to chnage to the current state to loginForm when user clicks with some inline code , but please tell me At the start of the page please tell me why I am not able to show the Register.
.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something to understand, you have three states defined: A state called "Register", a state called "loginForm" and an unnamed state. Register sets a property on the Application called RegForm giving it the value "Register". loginForm sets a property on the Application called RegForm giving it the value "Login". The unnamed state shows two forms, each containing a button. Since these properties are custom to your application your state change (if it were triggered) would propably generate an error or do nothing.

You have nothing to trigger a state change. I would recommend you stop looking at states for a while and go learn about events, which are a much more central topic in Flex than states. You will not be able to do much with Flex unless you take the time to unsderstand this very important concept.

What I think you want from your states is one form with a button whose label and operation changes. Is that right? In which case, I think your Application only needs one Form, and you only need one state that sets the label property on your form's button to the appropriate value. Whatever function response to this button's click event can direct its operation.

NB: The easiest way to create view states in unsing the GUI builder in FlexBuilder.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for posting a dumb question .

I forgot that i need to reuse the same form again and again . rather than creating two forms .

Sorry for wasting all the peoples time .

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic