Hi, I hope i have correct understanding of application domains in flash player, but it seems the Flex/Flash Player has some troubles in this area and threfore I will be very happy for any feedback here.
Let's have two flex applications - A and B (both use SDK 4.6.23201). Application B is loaded into sibling ApplicationDomain (new ApplicationDomain()) of application A. App A and B loads some runtime shared library (let's call it rsl1).
When I load app B into A for the first time, everything is ok. Then, I unload the app B from A with unloadAndStop(). Then when I try to load application B into A again, the problems begin.
#1 - I can see the app B loads rsl1, but the DownloadProgressBar does not dispatches FlexEvent "initComplete" . When I wait for few seconds between unloading B and loading it for the second time, it's fine. I guess the garbage collector did his work. Ok, nevermind, i can wait few seconds and let's go to problem #2 - the app B loads also some resource bundles into resource manager. When I load the B for the second time and try to load again the resource bundles, they won't be loaded (they are not even requested). To fix this problem, i have to unload the resource bundles from resource manager before i unloadAndStop app B. You could say "hey, of course, you have to clean your app when you unload it", but my assumption is, that if i load the app B everytime into new ApplicationDomain, it should not cause troubles like the above and I expect that it will behave like if I would load it for the first time. What's more - I just migrated from SDK 3.5 where i didn't have this problem . I am using FP 11.1.xxxx
Don't hesitate to post your opinions.
Thanks a lot
Are you using SWFLoader and loadForCompatibilty to load the SWFs?
Well, I am very sorry for your time you had to spent for reading this thread. I was probably too tired and the fail was between the seat and a keyboard (I created the new ApplicationDomain only once before, so the second loading was done into the same app domain). So everything works as it should and I like flex again . Bye