Why do you need to refer them just carry relevant data around, at least in theory you should be able to make decisions based on that data.
I don't need any data from my first view. In a certain flow, I need to make my first view to be invisible.
for eg., My First view is in portrait mode. I change the device to Landscape. In the landscape mode, I want to show a completely different view (second view).
In this case, what happens is, I see my first view in Landscape mode for a second. Then the second view appears. When I change to Landscape mode, only the second view should be seen. I need to make my first view to be completely invisible in the OnOrientationChanging event of
As stage object and StageOrientationEvent works at application level, I need to know how to refer my first view object in the application level.
private function onOrientationChanging(soe:StageOrientationEvent):void
MyFirstView.Visible = False; ====> don't know how to refer MyFirstView here
Is my question clear now?
I guess what are trying to achieve should be done using "states" and not multiple views.
I cannot use states. I have a mobile app with more than 10 views. I go to the landscape mode from any of these views. The Landscape view has to load only the images.
My Landscape view is global and entirely has different concept from the Portrait.
If it is only one screen, I can manage with view state as you said. This is not the case I need.
My requirement looks so simple, but I find it difficult to find an answer with Adobe Flash Builder.
can you show some code I am curious how are you displaying the views?
Here's what I do:
Views are always pushed and popped from the navigator using pushView() and popView() methods.
Data which should be available in all views, can be stored in global singleton classes. Data is never kept in the views itself but in those singleton classes.
In a simple app, you could use 2 singleton classes, a GlobalModel and a GlobalController. Acces of data is simple by calling myModel.getInstance().myProperty or myController.getInstance().myMethod(params...).
This way, you can let Air handle pushing and popping of views without losing control over you data.