Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want clip to stop when mouse pressed....

Status
Not open for further replies.

CherieHere

Programmer
Dec 20, 2002
12
US
Been up all night working on my first flash - a slide show with fades between each photo - I actually put each one on the time line and then set the alpha - God there must be a better way - and I was hoping for much more complex transitions (like Premiere)....

Anyway, I finally got it running through all the photos and I want the user to be able to click on it and have it stop. And then click on it again and have it play.....

In the main timeline I have stuff like music/actions/images/background

I built the entire video by double-clicking the first symbol (first photo)

I did click on that same item and set the properties to Movie Clip/mc

Then I added the following code:

on (press) {
stop ();
}

and it just doesn't stop. At one point I had the following code:

on (press) {
mc.stop;
}

and that didn't work either.

I have attached a link to the files if someone had the time to take a look at it. I feel so close and yet so far.

And... if anyone has a better way of adding photos with cooler transtions -please share.

Cherie
 
That action cannot be attached to a movie clip - only to a button symbol. frozenpeas
 
ok, so I added another layer on top, set the alpha to 0, typed it as a button named btn

Then I clicked on the first frame of btn and inserted an action

btn.onPress = function() {
mc.stop();
}

when I test the movie I get the following compile error:

Scene=Scene 1, Layer=Button, Frame=1: Line 1: Statement must appear within on handler
btn.onPress = function() {

... A little more help please...

Thanks, Cherie
 
I went to check your swf and fla. It would not come up. Please post again. I will check the code for you. The secret in education lies in respecting the student. {Ralph Waldo Emerson}.
 
Select the button. Bring up the Actions panel then enter the following code:

Code:
on(press){
   _root.mc.stop();
}

This is assuming mc is on the main timeline. frozenpeas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top