4 Replies Latest reply on Jan 15, 2007 8:21 AM by IwannaFlashU

    Movie Load doesn't work

    IwannaFlashU Level 1
      I have developed a lesson where the root movie is like a tv set where all the controls for volume and changing channels (ie topics) are contained. When the user clicks on a topic button, the root movie loads the topic into a child movie holder and displays it "on the screen".

      I developed this on my laptop and everything works fine. I then transferred it to my pc, where I will upload it to my website. The problem is, on my pc, it won't load any of the topics! Here are some additional clues to the dilemma:

      1. When I run it in test mode, it DOES load the topics..........it just won't do it when the swf is running separately.

      2. The original script, which was for loading locally (ie no preloader needed) was replaced with the current script (again this script works fine on the laptop and also on the pc in test mode). Just for the heck of it, I remmed out the new script and unremmed the old and THAT WORKS TOO!

      So there is something screwed up with the new code and as it works on one station and not the other, I'm thinking this is maybe a flash player version problem?? Both the PC and laptop are set to publish at flash player 7 and use AS 2.0. (actually all publish settings are the same).

      Here's the script:

      _root.preIT._visible = true;
      var my_content:MovieClipLoader = new MovieClipLoader();
      var myContentListener:Object = new Object();
      myContentListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
      _root.pbarPCT = String(Math.round((loadedBytes/totalBytes)*100))+" %";
      _root.preIT.pbar0.pbar1._width = Math.round((loadedBytes/totalBytes)*574);
      };
      myContentListener.onLoadComplete = function(target_mc:MovieClip) {
      _root.preIT._visible = false;
      };
      myContentListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
      trace("*********First my_mcl instance*********");
      trace("ERROR CODE = "+errorCode);
      trace("Your load failed on movie clip = "+target_mc+"\n");
      };
      my_content.addListener(myContentListener);
      //trace(_root.loTitle+_root.topicFile);
      my_content.loadClip(_root.loTitle+_root.topicFile, _root.content_mc);
      //end preloader code
      //loadMovie(_root.loTitle+"/"+_root.topicFile, _root.content_mc);
      _root.splashScreen_mc._visible = false;

      NOTE: The currently unremmed my_content.loadClip line is what doesn't work when the swf is run by itself. The currently remmed out loadMovie command however, works fine. I of course need to have the preloader when this thing is run on the web so that doesn't do me much good (that the latter one works).

      Thanks for the help!
        • 1. Re: Movie Load doesn't work
          MotionMaker Level 1
          Try myContentListener.onLoadInit insteand of myContentListener.onLoadComplete for making the clip visible.

          Also to aid in debugging when running outside the authoring environment consider dropping a TextField or TextArea component on the stage and using it as a tracing window. In this case you would want a tracing in the onLoadComplete to see what is up.

          • 2. Re: Movie Load doesn't work
            IwannaFlashU Level 1
            The command inside of the onLoadComplete makes a movie clip INvisible, not visible and that clip is my progress bar for loading the selected topic's movieclip.

            At no time is the topic movie clip invisible and waiting/needing to be made visible.

            That one line of code in the onLoadComplete has nothing to do with my dilmema.



            • 3. Re: Movie Load doesn't work
              mxc Level 1
              hi just glanced at the code and I dont know if it has anything to do with you problem but the 2 paths refered to are not the same, one is missing the /

              //trace(_root.loTitle+_root.topicFile);
              my_content.loadClip(_root.loTitle+_root.topicFile, _root.content_mc);
              //end preloader code
              //loadMovie(_root.loTitle+"/"+_root.topicFile, _root.content_mc);
              • 4. Re: Movie Load doesn't work
                IwannaFlashU Level 1
                yes, shortly after I posted this, I noticed that as well...the reason for the difference is between the new and old code, I moved the slash to be inside of the _root.loTitle variable.........and guess what? Flash doesn't care that the old code adds an extra slash! It still works anyways.

                So no, that's not it either. By the way, since I've posted this, I did a full publish, having both an exe and html created. The product works in both of these...the only time it doesn't work is when the swf is run by itself.

                In reality, it will be run as an exe or a swf inside of html, so I don't NEED this to be "solved" but it would sure be nice to know what is causing this anomaly, for future reference.