Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-01-2003, 03:27 PM   #1
Fergy
Registered User
 
Join Date: Feb 2003
Location: Ireland
Posts: 8
Default pause button

I want a to create a button that will simply stop a movie when pressed, and when pressed again, it will continue to play the movie
Fergy is offline   Reply With Quote
Old 03-01-2003, 03:56 PM   #2
Ricod
(@_@) -("pretty lights")
 
Ricod's Avatar
 
Join Date: Sep 2001
Location: the Netherlands
Posts: 3,982
Default

To pause a movie : _root.myMovie.stop();
To play a movie : _root.myMovie.play();
to use the same button, use a variable :
ActionScript Code:
on (release) { if (_root.myMoviePlaying == "yes") { _root.myMovie.stop(); _root.myMoviePlaying == "no"; }else{ _root.myMovie.play(); _root.myMoviePlaying == "yes"; } }
ofcourse, replace all paths with their appropriate instance names. To make it clearer for the user, you could put this code on a invisible button, place a mc with different graphics under it and tell the graphics mc to go to the needed frame, just like you set the variable to either yes or no.
__________________
RicoD
Link ?
Ricod is offline   Reply With Quote
Old 03-03-2003, 01:38 AM   #3
javen
Registered User
 
Join Date: Jul 2002
Location: Malaysia
Posts: 9
Default

oh god ... this thread gave me all the answer that I needed. So happy .. that's wat forum does.
javen is offline   Reply With Quote
Old 03-03-2003, 02:23 AM   #4
Ricod
(@_@) -("pretty lights")
 
Ricod's Avatar
 
Join Date: Sep 2001
Location: the Netherlands
Posts: 3,982
Default

Well, looks like someone finds it usefull ! Yeah, I'm learning a lot in this place too !
__________________
RicoD
Link ?
Ricod is offline   Reply With Quote
Old 03-05-2003, 10:01 AM   #5
Fergy
Registered User
 
Join Date: Feb 2003
Location: Ireland
Posts: 8
Default pause button

thanks for the script, but i've never used action scripts before and i cant get it to work. do i have to change mymovieplaying and my movie to something, and have i to declare them earlier or something?
Fergy is offline   Reply With Quote
Old 03-05-2003, 04:23 PM   #6
Ricod
(@_@) -("pretty lights")
 
Ricod's Avatar
 
Join Date: Sep 2001
Location: the Netherlands
Posts: 3,982
Default

myMovie is the name I used as a replacement. You need to replace it with the name of the mc you want to pause / resume. If you labeled it "somethingElse" and its on the main timeline, then the path to it would be _root.somethingElse .

Here' read thise tutorials on instance names and paths. It explains everything in greater detail :
Tutorial 02 : Instance Names
Tutorial 03 : Paths to Objects and Variables
All tutorials.

Earlier ? You have to declare them when you want to execute them.
__________________
RicoD
Link ?
Ricod is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:35 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.