1 Reply Latest reply on Dec 2, 2008 12:03 PM by clbeech

    controlling a movie clip?

      i am new to flash and i have made an animation on multiple frames and turned it into a swf movie.

      how can i make the movie start when clicked on, play through once ,then stop and not continue to loop?

      also once the movie is finished it needs to continue to show the last frame of the movie and not go back to the first frame when the movie stops.

      it is important for me that it can be done in only one frame.

      thank you

      EDIT: it is in actionscript 2
        • 1. Re: controlling a movie clip?
          clbeech Level 3
          ok - first you need to create a new layer on the timeline of the MC, call it 'actions' - select the first frame of that layer and open the actions panel - type in: stop(); then goto the last frame of the animation, right-click select the frame (ctrl click on mac) and then 'insert keyframe' - select the frame, open the actions panel and type in another: stop();

          now then, getting it to play when clicked is a bit more involved, you need to create a 'invisible' button over the top of everything that you can assign code to. so, create another layer, (you should lock all other layers) using the rectangle tool draw a box that covers the entire stage - any color will do, without a line though. then right-click that box, and select 'convert to symbol' - name it play_btn (or whatever) and select the 'button' radio button, click OK. then with the box still selected, look in the properties panel, on the left there is a input field that says 'instance name', type the name of the symbol into that field (ie. play_btn) Now, double click the box, to go into 'edit' mode you will see four 'frames' with labels - right click the 'hit' frame and 'insert keyframe' - then select the first frame ('up') and then hit delete - this will remove the box from the other frames, and you should now be left with a box in the 'hit' frame. this is how to create a 'invisible button'.

          now, go back to the main timeline (use the bar above the stage to nav to 'scene 1') then select the first frame once again, after the 'stop();' type the following 'handler' for the button:

          play_btn.onPress = function() {

          there you go :)