1 Reply Latest reply on Feb 23, 2007 10:23 AM by Newsgroup_User

    Problem with MovieClipLoader

    Antoine34
      Hi,
      i got a strange problem here, and if anyone can take a look, may be there's something obvious i don't see in this..
      I'm creating a custom actionscript class called Slideshow (i think you wonder what it is doing :)).
      My slideshow first read a XML file containing different reference to external swf file.
      Once the loading is done, i call a handleresult using the onLoad event.

      Inside the handleResult function (see attached code), i'm doing a simple thing. I just parse the xml, get the first reference to the first file, and try to load it using a MovieClipLoader.
      The strange thing is following.
      on the last line if i put :
      myLoader.loadClip("image1.swf",myTestClip);

      everything works fine, and the onLoadComplete event is triggered.

      If i put instead
      myLoader.loadClip(myImage,myTestClip);
      and even if the trace above tell me that myImage=image1.swf, the onLoadComplete event (and any other event in fact) is never triggered!

      any idea of what is happening there?:/

      Thanks a lot

      Antoine

        • 1. Re: Problem with MovieClipLoader
          Level 7
          If you had declared a type for listeNoeudImage, the compiler would have told
          you there was a "Type mismatch" error.

          listeNoeudImage[0].firstChild is an XMLNode, while MovieClipLoader.loadClip
          needs a string as its first argument. You need to use XMLNode.nodeValue.


          var listeNoeudImage:XmlNode =
          XPathAPI.selectNodeList(myXml.firstChild,imagePath);
          ...
          ...

          var myImage:String = listeNoeudImage[0].firstChild.nodeValue;
          myLoader.loadClip(myImage,myTestClip);