Embedded video to play when clicked

What this is used for: If you are embedding a video into your website- but you do not want to have a player.  What I would suggest is adding a play symbol to the first frame of your movie (but not a necessity)- and then when the user clicks on the movie- it will start playing- click again will stop. 

1. Create a new Actionscript 3.0 FLA

2. Import your video (File/Import/Import Video)

3. Set Video to what parameters you want and under properties give it an instance name of flv_video

4. Create a new layer and name it ‘Play’

5. Draw a shape over where you want the action to work (either the whole video or the play symbol on your first frame)- make it a random color

6. Select the shape and hit F8 to pull up your symbols- or right click/convert to symbol- make it a movie clip and give it an instance name of mc_play

7. Create a new layer and name it @ for Actionscript

8. In the first frame of layer @, open your actions or F9 and add:

mc_play.addEventListener(MouseEvent.CLICK,playMovie);

mc_play.buttonMode=true;

mc_play.useHandCursor=true;

function playMovie(e:Event){

flv_video.play();

}

9. Save and hit ctr+enter to test

10. Once it’s working properly- go back and make your movie clip- ‘mc_play’ transparent.  Export/embed into your webpage/Voila- done.

About kpatten84

I am a project manager with a marketing agency that works with pharmaceutical companies. I started my career as a web designer/front-end developer/back-end developer and have learned a lot and have grown along the way. For the past (almost) 9 years - I have been in an amazing relationship with a man who is about to become my husband! We love our life full of laughter, learning, a bird, a cat, drive, movies, art, traveling, and living in our loft in a great downtown neighborhood. I am a lucky girl and I am reminded about it every single day.
This entry was posted in Flash. Bookmark the permalink.

Leave a comment