FORUMS: list search recent posts

Click on image (btn) and automatically play FLV

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Travis Marcum
Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 6:29:27 am

Hey guys-

I'm new here and going to the Art Institute of Seattle for my Bachelors of Web and Interactive Media and trying to get a leg up with some Actionscript before that class starts.

My question here is, if I have an image that I converted into a symbol as a movieclip, how do I make it to where if someone clicks that image, a video plays? I'd like it to be kind of "easter egg" type thing where the video is only visible once someone clicks on the image.

Thanks guys!


Return to posts index

demetri tashie
Re: Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 3:20:43 pm

here's one way. there are others:

first set up your video in whatever manner you would normally use( video component etc). make sure autoplay is set to false.

then turn the whole video player into a movieclip with an instance name. set that movieclip's initial visibility to false.

turn the image into a movieclip symbol and give it an instance name ( you said you already did that)

code the image with a click event listener, give it a function that makes the video player 's movieclip's visibility set to true, and the video set to play.


Return to posts index

Travis Marcum
Re: Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 4:39:33 pm

Appreciate the response. Do you think you could help me out by posting the code?

I appreciate it greatly.


Return to posts index


demetri tashie
Re: Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 5:11:42 pm

what code ? post what you have worked on so far, and we can take it from there


Return to posts index

Travis Marcum
Re: Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 5:15:29 pm

I'm really new, so I don't really know the proper AS to put in the actions layer to make it happen.


Return to posts index

Travis Marcum
Re: Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 5:14:53 pm

I should actually make this a bit clearer.

I really don't know how to make the visibilty intially false on the video, etc.

I'd really appreciate any help.


Return to posts index


demetri tashie
Re: Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 6:34:03 pm

movieClipInstanceName.visible=false; makes the movieclip invisible
movieClipInstanceName.visible=true; makes it visible
myMovieClip.myFLVPlaybackComponent.play(); makes the video component in a movieclip play


Return to posts index

Travis Marcum
Re: Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 8:51:47 pm

Thanks for this.

I guess I just have to play with it some more, because I still don't the entire code to add to the image button to make it click and play the video.

Thanks!


Return to posts index

demetri tashie
Re: Click on image (btn) and automatically play FLV
on Mar 19, 2011 at 11:21:32 pm

as a student, you will have to learn to ask questions, and do some research.

i realize that you are very new to flash and actionscript. so, to do this project you should set yourself the task of learning these skills:

how to import an image.

how to turn it into a movieclip symbol and give it an instance name.

how to set up a video player ( if you are that new, just use a FLVPlayback component - so you'll need to know how to access the component panel)

how to set the source for the video player, set the video player to: videoPlayer.autoplay=false;

how to turn the video player into a movieclip symbol, and
set this movieclip to not visible ( code previously given)

how to add via code the most basic 'addEventListener' to the image-movieclip, and
create a function which contains the previously given code to make the video-movieclip visble, and the video to play ( code previously given)

that outlines the entire project. hope that helps.

i do strongly recommend to search this site, and its tutorials to learn the basics of using flash, and coding in actionscript. you will then be able to build your project. if not, ask some specific questions about what you are not understanding and we can give specific answers.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]