first, i must apologize for an error in my code. you cannot make a static
package level var. the code should look like:
package com.example {
public const API:AppAPI = new AppAPI();
}
Peter, this crazy method i am using does indeed only instantiate the object
only once. i never get a runtime error in accessing the API through the
package level const.
thanks Paul. I made a simple test project and have determined that if i
make it a var instead of const, everything is just fine. Next is to test
whether loading a swf that uses it as a var versus const will allow garbage
collection to pick it up. man, i haven't used a profile in ages.
Henrik, you are right, but i don't think i am wrong about the "flash
player" referencing.
in this special case, the scheduler is built in flash on top of AIR. they
load my swf, then stopAndUnload my swf, show another swf, show an image,
then RELOAD my swf (and by reload i mean loader.loadBytes()), and so on...
so the flash player is never shutting down.
in normal cases, the scheduler is built outside of AIR, so when someone
wants to run our content, the scheduler boots up the flash player only to
play my swf, then shuts it down. even if the scheduler had two back to back
swfs, the flash player instance is always shut down before the new one
opens.
Thanks for your input everyone!
--
Ktu;
The information contained in this message may or may not be privileged
and/or confidential. If you are NOT the intended recipient,
congratulations, you got mail!