Skip to main content
Zeloslaw
Known Participant
December 21, 2012
Question

Convert View to viewClass:Class

  • December 21, 2012
  • 1 reply
  • 563 views

Hi.
Because popView () does not work correctly in iOS, I decided to write my own class. Unfortunately, I do not know how to convert:

var MyView: View = navigator.activeView;

and in the next view:
navigator.pushView (MyView)
there is a conflict because it must be a parameter: viewClass: Class

This solution works:
navigator.pushView (views.myOtherView);
but it is not the active view.


Please help.

This topic has been closed for replies.

1 reply

Zeloslaw
ZeloslawAuthor
Known Participant
December 21, 2012

I tried this but to no avail:


var ViewClass:Class = views.Login;

view = new ViewClass();

// ^works fine

var ViewClass:Class = getDefinitionByName("views.ViewLogin") as Class;

// ^throws error:

ReferenceError: Error #1065: Variable Login is not defined.

at global/flash.utils::getDefinitionByName()

...