Author Topic: Dynamically loading mz3 file only works once  (Read 288 times)

Kotch

  • Jr. Member
  • **
  • Posts: 30
Dynamically loading mz3 file only works once
« on: January 15, 2012, 06:35:04 pm »
I am using version 2.0.10 (though am on verge of upgrading to the latest version as I'm pulling my hair out with all the Megazine problems I am having).

I used the megazine 'load' function to dynamically load my mz3 file. As follows:
megazine.load( contentID + ".mz3");

To remove content I call:
megazine.dispose();

But when I call the 'load' function again:
megazine.load( contentID + ".mz3");

Nothing happens the second time round.    Do you know why?

I noticed that someone else had a simlar problem:
http://www.megazine3.de/forum/index.php/topic,1325.msg5206.html#msg5206

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Dynamically loading mz3 file only works once
« Reply #1 on: January 26, 2012, 12:18:32 am »
Is the 'megazine' in the second call a new instance? The dispose method will make the first one unusable (it cannot be used multiple times).
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.

Kotch

  • Jr. Member
  • **
  • Posts: 30
Re: Dynamically loading mz3 file only works once
« Reply #2 on: January 30, 2012, 10:45:55 am »
Hello Florian

Thanks for that info. 

I was hoping to be able to clear the current loaded in mz3 file/page content and load in a new one without having to create a new Megazine instance.   I can see thats not possible now.

Cheers.

Kotch

  • Jr. Member
  • **
  • Posts: 30
Re: Dynamically loading mz3 file only works once
« Reply #3 on: January 30, 2012, 06:26:02 pm »
My project contains 4 newspapers to flick through.   At the moment I am creating a Megazine instance whenever a newspaper is launched and disposing of it when the newspaper is closed.  Only one Megazine instance is in existence at one time.

However, the page turning seems to become less responsive the more I create and dispose of a Megazine instance.  Why could this be?

Would a better approach be to create 4 instances at once, never disposing of them just displaying/hiding as required?