Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: stage in flex and the stage mediator  (Read 9389 times)
landed
Full Member
***
Posts: 37


View Profile Email
« on: October 13, 2009, 07:00:18 »

I'm stuck with trying to get a text field for example in any view class in flex.
here is the thread in some detail but I feel I need to get hold of the distinction between flash and flex and the stage.

I'm used to getting the reftostage passed to the main stage mediator but I'm told I cannot add stuff to the stage in the normal flash way....here is the link

http://www.actionscript.org/forums/showthread.php3?p=932091&posted=1#post932091

Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: October 13, 2009, 09:32:21 »

The reference you are getting in Flex when you do facade.startup(this) is the reference to the MXML Application instance. Begin looking at the Flex API docs there. There is rarely a need to fiddle with the stage in Flex (except in AIR). You work primarily with the view hierarchy starting with the Application.

So if the App had a text box with the id "myText" then you could access it from your ApplicationMediator by app.myText.

-=Cliff>
« Last Edit: October 13, 2009, 09:35:44 by puremvc » Logged
landed
Full Member
***
Posts: 37


View Profile Email
« Reply #2 on: October 13, 2009, 10:16:30 »

Thanks, I'm trying to get flashvars populated into a value object firstly, and was needing the stage to place my views on. So I'm still thinking in the flash line way too much.

I could in theory have all my view components inside the main Application tags but the main issue I have with mxml is that I cannot seem to instantiate with parameters my custom classes. This is why I'm breaking out in pure script very quickly as I'm used to the flash way.

But I see where I have to go now, instead of using the ref to a view component like we pass round in the flash version of the framework we have to pass round the Application instance and use that instead.

Thanks I know enough to start moving onwards again.
Logged
landed
Full Member
***
Posts: 37


View Profile Email
« Reply #3 on: October 13, 2009, 10:54:04 »

Here is my flex pure mvc friendly flashVarsVo script

http://www.calvincrane.com/archives/270-Flex-Value-Object-Script.html

place it in your model package.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: October 13, 2009, 11:44:43 »

Here's the recommended way to handle FlashVars in a PureMVC app: http://forums.puremvc.org/index.php?topic=622.msg2781#msg2781

-=Cliff>
Logged
Pages: [1]
Print