A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: (Very) weird error involving classes and loaded SWF

Threaded View

  1. #1
    Member
    Join Date
    Jul 2009
    Location
    Florianópolis
    Posts
    81

    (Very) weird error involving classes and loaded SWF

    I had the following problem in my project:

    My project is about a header.swf that calls a nav.swf (with a menu and other stuff) and also inits a slideshow through a Slideshow class.

    This is in header.swf:

    Code:
    		private function topLoaderHandler(e:Event):void
    		{
    			topContainer = e.target.content;  // nav.swf is the loaded swf
    			topContainer.y = 10;
    //			topContainer.x = (stage.width - topContainer.width) /2;
    			addChild(topContainer);
    			
    			new XmlParser("xml/slides.xml").addEventListener("XML_PARSED", initSlideShow);
    		}
    		
            private function initSlideShow(e:Event):void
            {
    			slideshow = new Slideshow(e.target.myXML, 5000, 2, 0);
    			// xml, delay, fade, delayBetween
    			
    			slideshow.addEventListener("LOADING_START", onStartLoading);
    			slideshow.addEventListener("LOADING_COMPLETE", onCompleteLoading);
    			slideshow.addEventListener("FIRST_IMAGE_LOADED", startAnimation);
    
    			slideshow.start();
    	
    			ss_container.addChild(slideshow);
            }
    The slideshows loads correctly but the nav doesn´t show.
    I tried lot of things and then discovered that if I remove the line
    " new XmlParser("xml/slides.xml").addEventListener("XML_PARSED", initSlideShow);", the nav.swf would show perfectly.

    So what did I do ?

    I renamed the XmlParser class to "XmlParser2.as" (as well as other references to it) and then...it worked !!!

    what the hell was going on here?

    obs: I tried that also: I commented all the code inside the "initSlideShow" function, keeping the XmlParser instantiation, and the nav.swf didn´t show as well.

    obs2 : i didn´t had XmlParser.as imported cause it was in the root directory. ( i explicitely imported it and tried to compile but same thing happened)

    obs3: nav.swf uses the XmlParser.as to load two menus, however I don´t believe it has anything to do it since it´s a file that is already compiled, at the point I try to load it into header.swf, right?

    Well I luckely solved the problem in about one hour but i would like to know was that all about . I got no clue.
    Thanks a lot !
    Last edited by ziriguidum; 01-28-2010 at 02:26 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center