2 Replies Latest reply on Nov 5, 2007 3:10 AM by tacbob

    Preloader problem

    tacbob
      Hi.

      I have a movieclip ("myCarMovie") that opens within an empty movie clip ("picHolder") that is on the main timeline of my movie. "myCarMovie" is triggered froma button on a thumbnailer that opens it within "picHolder". All works well until I add the preloader that features a progress bar and percentage loaded.

      I have placed the progress bar at the start of "myCarMovie". When I test "myCarMovie" on its own it is fine but not when I publish and run the whole movie.
      Obviously I started looking at _root in the script. I took all the _root out and tried various other thngs but I still have the same problem in that the movieclip is not loaded. Instead, it plays frame 2 of the main timeline.

      I have included the script for the preloader below if anybody wants to make a suggestion and give me a cure!!


      Thanks



      onClipEvent (load) {
      var origW = _root.loadbar._width;
      var newW = _root.loadbar._width;
      var moveX = _root.loadbar._x-(_root.loadbar._width/2);
      }
      onClipEvent (enterFrame) {
      _root.percent = int((_root.getBytesLoaded()/_root.getBytesTotal())*100);
      _root.txtPercent = _root.percent+"%";
      _root.loadbar._width = Number(_root.percent);
      _root.loadbar._x = moveX+_root.loadbar._width/2;
      if (_root.getBytesLoaded() == _root.getBytesTotal()) {
      _root.gotoAndPlay(2);
      }
      }
        • 1. Re: Preloader problem
          "B" Level 1
          So myCarMovie is an external swf file? And the preloader is inside the myCarMovie file?


          If so, you need to reference the empty movie clip in order to access the myCarMovie.

          For example: _root.loadbar._x = moveX+_root.loadbar._width/2; would instead be...

          picHolder.loadbar._x = moveX+picHolder.loadbar._width/2;
          • 2. Re: Preloader problem
            tacbob Level 1
            Thanks B!
            Yep, myCarMovie is external with with the preloader in it.
            I knew it would be some kind of rooting problem.
            I'll give this a go in a day or two.

            Thanks