Author Topic: problem with an swf loading megazine1.38  (Read 2829 times)

rogerlenoir

  • Newbie
  • *
  • Posts: 4
problem with an swf loading megazine1.38
« on: October 09, 2009, 01:07:36 pm »
Hello
first : I'm sorry for my too bad english : --> i'm french! (noboddy is perfect)
second : megazine is a  very nice work ! thanks for this big work.

I don't think that my problem is bug, but I don't know where can I wrote my post.

Now I explain my problem:
On the stage I have a Sprite (var anim:Sprite ...) after i want load megazine in this Sprite.
the function foncProgress "trace" well the loading;
the function foncComplete "trace" well the event
But I don't see the meggazine
I have ask the width  (pevt.CurentTarget.content.width) and the function "trace width = 0), perhaps the problem is here ?

I put here the code i have wrote in the frame

var livre :Loader = new Loader();
livre.addEventListener(Event.REMOVED_FROM_STAGE, livreDesactivation);
livre.contentLoaderInfo.addEventListener(Event.COMPLETE, livreComplete);
livre.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, livreProgress);
livre.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, livreErreur);
            
            
function livreDesactivation(pEvt:Event):void
{
   livre.contentLoaderInfo.removeEventListener(Event.COMPLETE, livreComplete);
   livre.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, livreProgress);
   livre.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, livreErreur);
   livre= null;
}
            
function livreErreur(pEvt)
{
   var texteErreur:String = pEvt.text;
Alert.show(texteErreur, {buttons:["OK"]});
}
            
            function livreProgress(pEvt:ProgressEvent):void
            {
               var pourcent:int = pEvt.bytesLoaded / pEvt.bytesTotal * 100;
               patience.visible = true;
               patience.play();
               patience.chargement_txt.text = "chargement des données "+ pourcent+"%";
               trace("chargement des données "+ pourcent+"%")
            }
            
            function livreComplete(pEvt:Event):void
            {
               patience.visible = false;
               patience.stop();
               patience.chargement_txt.text = "";
               
               var contenu:* = pEvt.currentTarget.content
               trace( contenu.width)
               trace( contenu is MovieClip)
               contenu.width = 601
               contenu.height = 602
               
               
               anim.addChild(contenu);
            }
            livre.load(new URLRequest("cartes/carteRestaurant.swf"));

rogerlenoir

  • Newbie
  • *
  • Posts: 4
Re: problem with an swf loading megazine1.38
« Reply #1 on: October 09, 2009, 01:16:38 pm »
sorry my fingers are not very fine and my post gos too fast ...
 
I have don't say :
thanks for your interrest and perhaps your answer.
Roger

ps  livre.load(new URLRequest("cartes/carteRestaurant.swf"));
 =  livre.load(new URLRequest("cartes/megazine.swf"));

and the "trace" windows

chargement des données 0%
chargement des données 79%
chargement des données 100%
0
true
TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.
   at de.mightypirates.utils::FadingMessage/show()
   at de.mightypirates.utils::FadingMessage/eventFired()


Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: problem with an swf loading megazine1.38
« Reply #2 on: October 09, 2009, 07:40:45 pm »
Bonsoir ;)

(my French is most likely worse than your English, so... the rest in English)

Actually, I think this is a bug. Happens when the XML definition can't be found. Please feel free to create a new issue in the bug tracker, lest I forget it again. Can be "fixed" by having the megazine.xml where it should be ;) (probably the "cartes" directory in your case, assuming the carteRestaurant.swf is the engine?)
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.

rogerlenoir

  • Newbie
  • *
  • Posts: 4
Re: problem with an swf loading megazine1.38
« Reply #3 on: October 09, 2009, 09:02:00 pm »
Thank you for your reply.  :)
Yes the problem is related to the position of the directories; 
I put the megazine.swf or carteRestaurant.swf (is the same) and other files and folders on the same level as the main animation and now everything works.  :D
in fact he was able to write:  livre.load (new URLRequest ( "carteRestaurant.swf"));
It should also publish the file megazine.fla and give dimensions.

Now I have another problem I would like to disable the SWFAddress.  ::)
It will not be easy ... if you have an idea, a list of classes that I need to change or something more simple (I'm a novice)

Thank you again for your work I think that I'll learn a lot by trying to understand the sources  :D

And thank you to all who are taking the time to read  :)

Again sorry for my bad English
(For this post I used http://translate.google.fr


Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: problem with an swf loading megazine1.38
« Reply #4 on: October 10, 2009, 02:10:37 pm »
The easiest thing to get rid of SWFAddress is to just not load the JavaScript file, i.e. remove the <script type="text/javascript" src="js/swfaddress.js"></script> line from the HTML.
If you use it in another component and just not want it to react to the book, look inside the Main class, and comment out the functionality of the last two functions (swfAddressUpdate and swfAddressChange).
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.

rogerlenoir

  • Newbie
  • *
  • Posts: 4
Re: problem with an swf loading megazine1.38
« Reply #5 on: October 11, 2009, 06:17:50 am »
Hello,
Thank you for the information to SWAdddress.  I've just seen.  :)

I have edit and modifie the file MegaZine.as :

public function Megazine (xmlPath: String = "maps / megazine.xml"
uiPath: String = "maps / interface.swf"
DELAYLOAD: Boolean = false) (
...
this.xmlPath | | = "maps / megazine.xml";
this.uiPath | | = "maps / interface.swf";

and now I can call the swf even if is not on the same level as the main swf. ;D

But this is not very friendly.
Since yesterday evening, I try to move the address file "megazine.xml and interface.swf" in a parameter.
I tried several solutions but I did not come : The variables are "coming well" but always too late...always after instantiating the class Main and MegZine.as :-\


I'll sleep a little ...
Best regards
Roger

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: problem with an swf loading megazine1.38
« Reply #6 on: October 11, 2009, 08:04:55 pm »
regarding the xml, there is a parameter in the index.html (a FlashVAR) named xmlFile, which is actually the path (relative to the megazine.swf) to the xml file.
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.