Groups | Blog | Home
all groups > flash actionscript > july 2006 >

flash actionscript : Stop and Play at will


chombeaux
7/31/2006 8:45:50 PM
This shoudl be an easy task, but somehow, I can?t complete it. I made a small
presentation movie for my costumers, and I want to add a both stop and play
buttons. This way, if you like, you can stop the movie to take your time
watching an image, and whenever you want, you can click on play to continue. At
least that?s the idea.

However, no matter what I do, it doesn?t works. This is what I do:

I do create my button as usual, a little graphic from flash, then converting
it to symbol and edit it to create the over and down variants. Back to the
scene, I do assign behaviors and actions, but when I test the movie, nothing
happens. Both buttons simply doesn?t works. do I miss something?

Here?s the site, If you want to take a look:
http://www.fixioncg.com.mx/

just check the protfolio section. Thanks in advance!
Thomas_Bärwinkel
7/31/2006 11:19:07 PM
chombeaux schrieb:
[quoted text, click to view]

i assume you have 2 buttons, buttonPlay and buttonStop
add the following code

buttonPlay
on(release){
play();
}

buttonStop
on{release) {
stop();
Craig Grummitt
8/1/2006 12:13:15 AM
is very difficult to assist with your description of the problem. please expand
on 'i do assign behaviors and actions'. what actionscript do you assign? where
do you put it? if you put it on the frame do you give your button an instance
name?
Walter Elias
8/1/2006 1:56:10 AM
You should be able to do it like this:

1) Put your entire presentation inside a movie clip.
2) Put that movie clip on the stage, on frame 1 (since ithe whole presentation
timeline is inside a movie clip, you only need to put it into a single frame,
and it will still play when you publish the SWF).
3) Give the movie clip an Instance name (Properties panel), such as
"presentation_mc" (but without quotes).
4) Make two buttons or movie clips, one for play, one for stop. Give them each
instance names such as "play_mc" and "stop_mc" (you can't name them simply
"play" and "stop", since those are ActionScript commands).
5) On the timeline, in a separate layer on Frame 1, place this script:

play_mc.onPress = function(){
presentation_mc.play();
};
stop_mc.onPress = functuon(){
presentation_mc.stop();
};
AddThis Social Bookmark Button