We recently developed a native extension for iOS that uses native views and storyboards.
I doubt it's possible from AS3 to grab the current UIView, but it is possible from native code.
We used the following objective-C code in our ANE that works well.
In this case, controller is your custom ViewController, and this code adds its view to the main view (AIR apps are single-view apps):
[[[[UIApplication sharedApplication] keyWindow] rootViewController] addChildViewController:controller]; [[[[UIApplication sharedApplication] keyWindow] rootViewController].view addSubview:controller.view]; [controller didMoveToParentViewController:[[[UIApplication sharedApplication] keyWindow] rootViewController]];
Thanks for your reply.
Can you please advice how to do the same in case of Android? I tried getting the current active view in actionscript by calling "navigator.activeview" but I don't know how to pass it to native code.
Can you please help?
I haven't written an ANE yet for Android so I can't help you much, but I believe you'd have to do it from native code as well, following the Android APIs. The native view won't be accessible from AS3 because it's not an AS3 object, it's a native (probably Java) object.
Ok, how about accessing the AS3 created view in native code (Android/iOS)? Because my UI is made using AS3 and I want to access the view on my native code. Possible?
No idea. All I know is how to get the root view controller to add additional native storyboards to the stack (over the AIR content). You could put Obj-C code in maybe to iterate through views off the root and see if you can find it??
The inner native workings of AIR apps are a mystery. We wanted to modify the default storyboards to support UINavigationController-based transitions on our native screens, but they're precompiled and buried in the AIR SDK....