Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 18:46
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flex, Air, FlashBuilder, Catalyst (Moderators: ..:: Mazhar Hasan ::.., kofi addaquay)
| | |-+  Passing data between Views in mobile application
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Passing data between Views in mobile application  (Read 436 times)
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« on: 05/18/11, 09:08 »

For those (like me) beginning in mobile development with Flex 4.5, some obvious question as far as you build your first app is how to pass data between views. And the answer is straighforward: use the second parameter of navigator.pushView , then retrieve trough data property in the next view. So imagine I pass this data:

  navigator.pushView(someViewinput.text);

In the next view I retrieve like this

  trace("intput.text is "+data)

You can pass any arbitrary data as the second argument, so i.e

  navigator.pushView(someView, {name:"Jorge"age:40});

Could be retrieved like this:

  trace("name "+data.name+", age "+data.age)

Since second argument could bve anything, you can pass even a reference to a data model, a better approach for mroe complex applications.

Jorge

Logged

Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!