2 Replies Latest reply on Oct 5, 2006 1:41 PM by Newsgroup_User

    loadMovie

    michaeltowse Level 1
      ok, heres my problem.

      I am loading in a external swf which I dont have the fla for anymore so I cannot add or amend it in any way. Once I load in in it works fine but repeats itself on completion each time. Is there anyway I stop it from repeating in actionscript as I can't add any frames to the 'loading' movie either.

      Any help would be greatly appreciated.

      Mike
        • 1. Re: loadMovie
          kglad Adobe Community Professional & MVP
          you can initiate a loop that checks the target (into which you loaded the external swf) to see if it's completed (target._currentframe=target_totalframes) and if so, execute a target.stop()
          • 2. Re: loadMovie
            Level 7
            What you could do is check the total number of frames in the loaded movie
            and compare it with the current frame in the loaded movie. If these are
            equal the playhead had reached the last frame of the movie: then issue a
            stop. A bit cumbersome, but would probably work.

            The code could be something along the lines of:
            container_mc.loadMovie("yourmovie.swf");
            container_mc.onEnterFrame = function(){
            // first chec if the movie has loaded at least partially; say at least
            1Kb
            if(container_mc.getBytesLoaded > 1024){
            // check if currentframe matches total frames
            if(container_mc._totalFrames == container_mc._currentFrame){
            container_mc.stop();
            // remove this crazy loop
            delete this.onEnterFrame;
            }
            }
            }

            Didn't check but you'll get the picture.

            John