03-10-2011 10:50 AM
I'm very very new on Playbook development. I'm developing an ActionScript 3.0 application.
Reading Blackberry Tablet OS SDK for Adobe Air Development Guide I've found that I have to respond to deactivation and antivation.
Now, I have three AS3 source files, one for program (I think) and two for two pages. You can find my code here Two windows app question.
On which source file I have to respond to those events?
03-10-2011 10:53 AM
03-10-2011 11:21 AM
Sorry for some reason I misunderstood your qn on my first read. After reading it the second time, my thoughts are that you can add the EventListeners in any of the files. It depends on the App. You can also add multiple listeners in different classes each one will get triggered when the event occurs. you may want to act on some data that is private to some class..in that case adding an event listener in that class may be needed.
I guess you could also have a single handler and invoke functions and pass data between classes.
03-10-2011 12:16 PM
As mentioned by tags07, this is entirely up to you. My suggestion is to keep the activate/deactivate listeners on the main entry point class, as your whole app has to react to these events, so you can set consumption rate and frame rate lower and save any other requirement.
03-10-2011 02:05 PM
You have several options for saving states. Effectively you can use SharedObject or SQLite embedded database. This all depends on the type of application that you are planning to offer.
In the instantiation case, if you destroy them from memory (nullifying it and removing all references to it) and the garbage collector has already removed it, then you must create a new object. Please be aware that Adobe AIR on mobile good practices encourage you to use object pooling instead of creating new objects all the time (in case you have many objects of course).
For further reference:
Hope this helps.
03-10-2011 02:20 PM