omni
omni

Reputation: 4505

Terminate Air Navigator Views

i'm playing around with the navigator class and custom views within air for android and the Flex HERO SDK

my problem is that it seems like there is no way how to terminate a view. i start a view using navigator.pushview(myView).

then, when using the return button, i want to CLOSE that view and return back to the main menu. therefore i'm listening for the onKeyDown Keyboard.BACK event using event.preventDefault() to prevent the application from running the default "go back" action and the navigator.pushview(myOtherView) to go back to main menu.

BUT the problem is that the myView view still seems to be running in the background.

now i'm looking for a way to terminate that myView and everything that is running within in (atm, if i access the cam, the cam is still active even if the view is not active anymore)

can anyone help?

Upvotes: 0

Views: 172

Answers (1)

NielsBjerg
NielsBjerg

Reputation: 701

Assuming the navigator data-provider functions like ArrayCollection you could do something like navigator.removeItemAt( navigator.getItemIndex( myView ) ); And then shutting down the camera, and ultimately removing all handles to the myView, and setting it to null, to have the GC pick it up..

Beware syntax may be different when you wish to remove the item. I never used the navigator..

Upvotes: 1

Related Questions