Author Topic: errors while fliping - megazine instance  (Read 1582 times)

moozy

  • Newbie
  • *
  • Posts: 5
errors while fliping - megazine instance
« on: July 28, 2009, 04:15:27 pm »
hey,

I have added an instance of the megazine into a another fla file :

Quote
import de.mightypirates.megazine.MegaZine;

var mz:MegaZine = new MegaZine("megazine.xml","bin/interface.swf");
addChild(mz);

The book shows ok, but when I try to turn the page, flash output shows errors :

Quote
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
   at flash.display::Loader/unload()
   at de.mightypirates.megazine.elements::Image/de.mightypirates.megazine.elements:Image::destroy()
   at flash.display::DisplayObjectContainer/removeChild()
   at de.mightypirates.megazine::Element/unload()
   at de.mightypirates.megazine::Page/de.mightypirates.megazine::unload()
   at de.mightypirates.megazine::PageLoader/::rebuildQueue()
   at de.mightypirates.megazine::PageLoader/::delayedRebuild()
   at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
   at flash.utils::Timer/flash.utils:Timer::tick()

How can I fix this ?

thinkdabob

  • Newbie
  • *
  • Posts: 1
Re: errors while fliping - megazine instance
« Reply #1 on: August 07, 2009, 10:30:59 am »
hi,

I am new here and I got exactly the same problem.
I tried to load an swf of my megazine into an other flash movie using the Loader class.

Please help us.

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: errors while fliping - megazine instance
« Reply #2 on: August 17, 2009, 04:23:19 pm »
Will be fixed in the next version. For now, you can modify the destroy() function in the de.mightypirates.megazine.element.Image class to look like so:

Code: (actionscript3)
  1.    override public function destroy():void {
  2.        super.destroy();
  3.        if (loader != null) {
  4.            try {
  5.                loader.close();
  6.            } catch (er:Error) {
  7.            }
  8.            loader = null;
  9.        }
  10.        while (numChildren > 0) {
  11.            var child:DisplayObject = getChildAt(0);
  12.            if (child is Bitmap) {
  13.                (child as Bitmap).bitmapData.dispose();
  14.            }
  15.            removeChild(child);
  16.        }
  17.    }
  18.  
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.