AIR NativeWindow Context
I'm a newer to Robotlegs,I got a problem when I use the
framework on my AIR project.
As everyone know,A AIR project need a main mxml,in this mxml,I make
the default nativeWindow to be hidden ,and open a new
NativeWindow,then put all my other views(mxml) into this new
NativeWindow.So when I new context,I can't get the correct
contextView,because all my views are all in another NativeWindow
not the default NativeWindow.
I need you help,thank you.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Ondina D.F. on 22 Feb, 2012 04:41 PM
Hello,
Take a look at this:
http://www.ben-morris.com/howto-add-flex-mx-controls-to-a-nativewin...
I’ve used ExtendedNativeWindow from the article above.
In your context class:
mediatorMap.mapView(SomeView, SomeMediator, null, true, true);
mediatorMap.mapView(NativeContent, ApplicationMediator, null, true, false);
where NativeContent is a Group container, that you’ll add to your NativeWindow and SomeView is another component added to NativeContent.
NativeContent will be your contextView.
In your WindowedApplication you’d have a function, which will create the NativeWindow, add NativeContent and set the contextView to NativeContent.
Let us know whether that answered your question or not.
Cheers,
Ondina
2 Posted by Never on 23 Feb, 2012 03:02 AM
Hi Ondina,
Thank you very much.I've solved the problem successfully.However,another problem arises,I found that more than one NativeWindow I have constructed,It means there are serveral NativeContent Classes (I don't have this Class,I consider this Class may Inheritance UIComponent,am I right ?) you mentioned above,maybe I should split my project to serveral modules, each NativeContent has its own context and they contact each other by robotlegs-utilities-Modular ?
3 Posted by Never on 23 Feb, 2012 05:53 AM
I got another quesion in the context,Ondina,I just follow your method to construct the context,but I can't get the content's NativeWindow, I can only get the content,I think you can take what I mean.Thank you
Support Staff 4 Posted by Ondina D.F. on 23 Feb, 2012 10:30 AM
You’re welcome, Never :)
Yes, the modular utility would solve the problem of communication between different windows.
In my example, the NativeContent ist he contextView.
You can get a reference to the NativeWindow object through:
this.stage.nativeWindow where this ist the NativeContent.
So, if you wanted to close your NativeWindow from within NativeContent you could do this:
Ondina
Ondina D.F. closed this discussion on 30 Mar, 2012 08:58 AM.