Jump to content
Search Community

luk

Members
  • Posts

    6
  • Joined

  • Last visited

luk's Achievements

0

Reputation

  1. Sorry, my fault. I've made a mistake while writing this, because I was writing this fast only for an example (I didn't copy this from my code). I'll try to put sample files here in few days.
  2. My every external SWF files load and work without any problems but I also have 2 other SWF files which are not my and after load nothing shows (and no error occur). When I set suppressInitReparentEvents to false they are loading and showing corectly. Probably it's related with ADDED_TO_STAGE. When I have set suppressInitReparentEvents to true (by default) I must add some delay in my scroller class eg.: (...) if(stage == null) addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true); else added(null); function added(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE,added); TweenLite.delayedCall(.5, added2); //code go to added2 function } (...) Without delay (and with code in "added" function) SWF with this class works correct, but when I loading it from other SWF, error occur (null object - like to fast access). While suppressInitReparentEvents is set to false everything work without problems. In short - when I use Your solution for unload and suppressInitReparentEvents:false everything in my projct work like before. It's not problem for me of course and I'm glad that You help me a lot. I only wrote what I observed.
  3. Your solution with unload works without problems. Some problem occur when I want to load external gallery and secound SWF (AS3 but i haven't access to code). Both are loading without errors but nothing shows. Everything is ok when I set suppressInitReparentEvents to false. Like You wrote before my coding wasn't recommended. In earlier SWFLoader version both were working by default so maybe better if suppressInitReparentEvents will be false by default?
  4. Thank You again for answer and for Your work. I will use this solution.
  5. Thank You for answer and solving the problem, now it works. I have another question about that what You wrote. What is the best way to do something (eg. remove listeners) in external SWF when it's unloading or added? Other way, what can I use instead of this: if(stage == null) { addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true); } else { added(); } function added(event:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, added); addEventListener(Event.REMOVED_FROM_STAGE, unloadThis); } Maybe Event.UNLOAD/COMPLETE are better for this? Thanks for any help.
  6. Hi, First thank You for great classes and sorry for any mistakes in my english. I have a little problem with newer SWFLoader versions (probably from 1.766). My external SWF contain this: (...) if(stage == null) { addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true); } else { added(); } function added(event:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, added); addEventListener(Event.REMOVED_FROM_STAGE, unloadThis); (...) } (...) function unloadThis(e:Event):void { trace("ok"); (...) } When I load this SWF, first it dispatch REMOVED_FROM_STAGE event so error occur, then go rest of the code. But when I unload this SWF, it don't dispatch REMOVED_FROM_STAGE event again. In earlier versions of SWFLoader everything works correct: load SWF without errors and when unload, it dispatch REMOVED_FROM_STAGE event. Maybe something has change or I do it wrong so please correct me.
×
×
  • Create New...