20 Replies Latest reply on Oct 19, 2010 2:11 AM by mahesh.extentia

    How to stop playing SWF file?

    qatap

      I have imported swf file from Flash CS4. Next I try to stop this swf in Flex 3.
      But next code is not react. When I start it - the swf movie does not stop.

       

      Also when I try to view totalFrames like Alert.show(floorClip.totalFrames.toString()) it shows 0.

       

      What I do wrong? Please help

       

      [Embed(source="../image/floor.swf")]
      private var prisonFloor:Class;

       

      var floorClip:MovieClip = MovieClip(new prisonFloor());
      gateFloor.source = floorClip;  // gateFloor it's <mx:Image> id
      floorClip.addEventListener(Event.ENTER_FRAME, checkFrm);
      floorClip.play();

       


      public function checkFrm(event:Event):void {
        if (event.target.currentFrame == event.target.totalFrames) {
          event.target.stop();
        }
      }