Controlling External Set Of Movies With Play Pause And Skip Buttons
hi all,
Been looking for some tutorials on how to get this done but cannot find any. After I build this out I want to post up in the tutorials section.
Ok I was wondering if someone could help me on this small problem I am having. I have a total of 4 flash movies. The first movie will house all my navigation as shown below:
[Movie 2] [Movie 3] [Movie 4] [Pause] [Play ] [Skip to Next Movie]
The simple part of course are the first 3 buttons basically just loadmovie statements.
Now the next 3 buttons are the part I cannot quite figure out. The logic from what I have been reading is basically is the create a variable on the mainstage that updates itself each time a new movie is playing. This way you can tell the movie "pause" or "play" because it has a name.
Any actionscripters want to lend a hand on this? I have included the files all setup just need to few lines of scripting. I want to also post this as a tutorial since I cannot locate any tutorials with this sort of logic.
thanks in advance!
FlashKit > Flash Help > Flash ActionScript
Posted on: 05-10-2004, 11:38 AM
View Complete Forum Thread with Replies
Sponsored Links:
Pause/Play Buttons That Affect Nested Movies?
I'm creating an interactive demo that (surprise surprise) I'm learning to code on the fly. Currently, I have a interface.swf, with each of the five sections as separate .swfs that are loaded into the main interface. Each section has narration and animation.
I'm looking to create universal pause/play buttons that not only stop/play each of the child movie clips in the sections, but the sound as well. I attempted modifying a function I found that has an if...in statement to call the nested child clips in each of them, but it doesn't seem to want to work... Here's what the two functions look like, as they stand:
Code:
function stopTimeline() {
this.stop();
for (var i in this) {
if (typeof this[i]=="movieclip") {
if (this[i]._parent==this) {
this[i].stopTimeline();
}
}
}
}
function playTimeline() {
this.play();
for (var i in this) {
if (typeof this[i]=="movieclip") {
if (this[i]._parent==this) {
this[i].playTimeline();
}
}
}
}
this.pau_btn.onRelease = function() {
stopAllSounds();
stopTimeline();
}
this.play_btn.onRelease = function() {
playTimeline();
As you can see, I haven't even gotten around to the sound part yet, because I'm having a hard time figuring out how to code that into the button as well.
Any help would be enormously appreciated..
View Replies !
View Related
Scripting Pause & Play Buttons For An External .SWF
I feel as though i'm dying inside this is causing so much grief, so if anyone can help me...its very much appreciated.
THE SITUATION :-
I'm buliding a fairly basic presentation which involves loading a variety of external .swf's from the main .swf timeline.
This was all well and good (thanks to "atomic's" help!)
There are 7 segments within the main .swf all of which have several links to load external .swf's.
I've now come to the stage where i need to add a 'pause' and 'play' button...located in the main swf, which will effect any of the external .swf's that have been loaded.
THE SOLUTION :-
I'm desperate for any answers and my job is almost on the line here!..so any help will not only save my ass but it will also guarantee i have a job to go to during these hard credit crunching times!
Please see the attached .FLV file which will hopefully explain the situation a bit clearer. N.B. So far I have only added the PAUSE & PLAY buttons to the 5th segment....(5th blue button down from the top left).
View Replies !
View Related
Flv Movies Play And Pause
i have this script for my flv movie:
Code:
pause_btn._visible = false;
var ncDefault:NetConnection = new NetConnection();
ncDefault.connect(null);
var nsSample:NetStream = new NetStream(ncDefault);
var vidWin:Video;
vidWin.attachVideo(nsSample);
play_btn.onPress = function(){
nsSample.play("freemind.flv");
pause_btn._visible = true;
};
is it possible to make a pause, and stop button...or maybe even rewind and forward?
View Replies !
View Related
Pause & Play Movies At Any Given Instance
Hi,
I'm trying 2 give the user more control on the movie he views. So i want to put a button that in default mode displays "PAUSE" and on click actually pauses the movie at whatever frame it is(this should also pause any inner MC's). At the same time it should then change display to "PLAY" and on clicking should resume from where it was stopped.
Firstly, how do i create such a button that toggles its display state between "PAUSE" & "PLAY", & secondly does this require actionscript, cause the normal stop action doesn't halt the movie at whatever frame v were viewing, but at the starting frame of the movie.
Anyone out there who has the answers????!!!!
Thanx & Regards,
Avi
View Replies !
View Related
Help - Flash Splash Page, Skip, Skip Always, Play.
Hello,
I am trying to give users a way to skip the splash page this time, or ALWAYS skip it. I made that happen by using placing this code on the "skip always" button: (website: http://www.evbc.org/frog/main/index.html )
on(release, keyPress "<Enter>"){
user.data.name = "skip";
user.flush();
_root.gotoAndStop(50);
}
In the first frame of the timeline, I have this code to see if we should skip:
user = SharedObject.getLocal("user_profile");
trace(user.data.name)
if (user.data.name != "skip"){
_root.gotoAndPlay(2);
} else {
trace(user.data.name);
getURL("http://www.evbc.org/frog/main/home.aspx");
}
Ok, so far so good, but if they ever want to play the intro again, how can I set the "SKIP" variable back to "PLAY"? The SharedObject feature will only let you read/write from the same .swf.
Thanks for any help,
-fjhughes
View Replies !
View Related
Play-pause Movies And Loading Images
Hi all,
I need some help for the folowing problems:
1. I want to play & pause swf movies which I included externally. Can I do it? (or I can use a component) If not, can u send me a sample solution or a link?
2. I create a Loader dynamically and load images but size of the loaded image is not proper and I cannot change it.
Thanks for help
View Replies !
View Related
Play And Pause Button For Flash Movies
I have a linear movie I have created in Flash and I am not an ActionScript user at all, but I am trying to find an answer or some resources on how to create a small "button" that once clicked by the user will pause my Flash movie, and then once clicked again, will make it play. Any suggestions/help/links?
Thank you so much.
Smartmediaman@gmail.com
View Replies !
View Related
Controlling Play And Stop Movies
hi, everyone
pls help me.
i wonder why when i convert the "forward" button to movie clip, it does work!
the below actionscript is attached to "forward" button:
on (release){
nextScene();
}
this actionscript only work when it is button instance. but it does work if "forward" button inside the movies instance.
any idea?
View Replies !
View Related
Pause And Play Buttons
how do I crate actions for my pause and play buttons that actually work? Ive tried gotoAndPlay as well as gotoAndSTop and _parent.stop() as well as _parent.play() none of these are working, I need one that will pause tha action in the frame it's in and then resume on the same frame once you hit play.
View Replies !
View Related
Play And Pause Buttons
Hi,
I have play and pause buttons in my movie.By default, the play button is in inactive mode and the movie plays.
Please tell me what script should I write so that when i click on pause button the play button becomes active and when i click on the play button it starts playing from the frame i had paused on.
thanks
View Replies !
View Related
Help With Play/Pause Buttons
Ok, I pretty much understand everything... but how can I get the pause button to stop sounds and music, and the play button to start them up again? As of now, it only stops the animation, and lets the music continue.
View Replies !
View Related
Problems With Pause & Play Buttons
Help me please!
I have a problem ... I´m doing an interactive cd with flash 5. I made the pause and play buttons. But when I´m navigating and I click the pause button and then the play button, this one instead of continue with the movie at the next frame where it stop, it jump to many frames after of the frame it stop. I´m working with scenes ... I don´t know if this affect ... because when I made a play and pause practice buttons with just one scene, this didn´t happened.
Please if somebody can help me, answer me! I have to finish this cd to an important client, and I don´t know what else can I do!
View Replies !
View Related
Pause And Play Buttons With Projector
I am working on a CD that requires a projector file and am having trouble with the pause and play buttons. The movie has action on the main timeline and placed movie clips. I gave all of my mc’s an instance name of "all_mcs" which works quite nicely with the following code on the pause button:
on (release) {
_root.all_mcs.stop();
}
The problem is it will not stop my main timeline as well. For separate publishes I tried adding "_parent.stop();", "stop();", "_level0.stop();", "_root.stop();", and "_currentframe.stop();" to the above code and still nothing.
If I remove the "_root.all_mcs.stop();" and just use a simple "_stop;" it stops only the main timeline and the mc’s keep playing.
Does anyone know how to make everything pause at once?
Thank you for your help.
View Replies !
View Related
Trouble With Pause / Play Buttons
Hello all,
Having some trouble with a slideshow flash file. The snippet of AS is attached below. The play functionality is working fine, but when the slideshow is running, the pause button won't work. Any idea what I'm doing wrong?
NextFrame = function(){
if (whichPic<NumCount) {
bLoad = true;
whichpic++;
} else {
if (whichPic==NumCount){
bLoad = true;
whichPic = 1;
}
}
}
PlayBTN.onRelease = function() {
setInterval(NextFrame, 2000);
}
PauseBTN.onRelease = function() {
clearInterval(NextFrame);
stop();
}
__________________
View Replies !
View Related
XML MP3 Player Play And Pause Buttons
Hello,
After reading MANY message board postings, I finally found an XML MP3 player that met my needs ... almost. The player uses XML to call the tracks one by one and display the title (AWESOME!), but it seems to have a lot more features (within the code) that I'm not sure what I could do with (see the loaded drop-down list and the option to have stations, etc.). If anyone can offer me a clue, I'd be greatly appreciative! It's a nice player!
In any case, one of my concerns is that the player does not offer a pause feature. I've read the tutorial about pausing looping MP3 files at http://www.sonify.org, but I'm not sure how to apply the code to this particular player? Is there an easy way to do this?
Also, how could I alter the code to make the player start when the page loads? At the moment, you have to push the play button to get the songs to begin. I'd like it if the songs would already play when the page is loaded.
Any other advice is much appreciative! I'll attach the .zip file to this posting. Thanks!
View Replies !
View Related
Play | Pause Toggle Buttons
I need to add a play | pause button that toggles and a rewind button with a progress bar showing how much of the movie on the main timeline has played. I'm not an actionscripter, so it needs to be relatively basic using embedded movies and actions or open to any suggestions for the easiest way to accomplish this kind of control panel.
Thanks in advance for any help and/or suggestions on how I can accomplish this!
KO
View Replies !
View Related
Stop Play Pause Buttons
Hi I want to change look of my stop play pause buttons.
I have tree instances of one mc with shadow.
If I clik on play
mcPlay.shadow._visible = 0
and that's ok.
If I click on pause I need to check which buttons was previously clicked.
I can set _visible to 1 for every others buttons but this is not elegeant way.
That can be very hard to accomplish if I have 20 buttons.
Can you give me some hint?
Is "Listeners" useful for that?
View Replies !
View Related
Dynamic Pause And Play Buttons
Im need a dynamic pause and play button for a mp3 I did have one but it is one thats is a _root command and everytime I pressed it the movie would go and play frame 1 instead of pauseing my song and I tried using _parent but that wasnt no help ether. And help tutorials or anything like that is much appreciated.
View Replies !
View Related
Yet Pause And Play Buttons For Whole Movie.
Hi,
I have a long movie with a lot of MCs and sound, and want to have 2 buttons PLAY and PAUSE. The PAUSE button would stop the whole movie and when the PLAY button is pressed, the movie begins from there it stopped last time, just like a play/pause on a VCR. I have tried with _root.stop(); but it seems thar it doesn't work.
My buttons are inside another MC.
Any help on this please?
View Replies !
View Related
Play & Pause Buttons Work...but Not With Each Other
V!P and dzedwards were a big help to me yesterday but now I've come up against something else...
I've got 3 music buttons on a page. The code that I have plays and pauses each button perfectly. But if I have Button 1 playing and I click on button 2 (without stopping button 1 manually), and button 1 is still playing...both play at the same time. Which, I understand why it's doing that but I'm not sure how to fix it.
What do I need to add to the code so as to stop the first one from playing if I don't manually click it to stop? The first button's instance is monkey7, the second button's instance is iBelieve and the third button's instance is Perfection.
monkey7 = new Sound();
monkey7.attachSound("monkey7.mp3");
monkey7.start(0);
var elapsedTime:Number;
var played:Boolean = false;
pauseButton.onRelease = function() {
if (played) {
monkey7.start(monkey7.position/1000);
played = false;
} else {
monkey7.stop();
played = true;
}
};
Thanks. And I apologize to V!P and DZ in advance.
View Replies !
View Related
Play, Pause, FF, Rew Buttons - Beginner
Hello - I am trying to get a simple play, pause, FF, Rew button scheme working for my movie. My client already had the movie built, and they want to add these buttons. I need the audio to match the movie clip to - do I have to stream it? Where can I go to get the answers? Is there a simple way to accomplish this?
Thanks
View Replies !
View Related
Problem With Play/Pause Buttons
Im sorry to post a (simple)? question but I did some search with no luck to solve my problem.
I want my play and pause button to function as a play pause button. I do not know how to combine the play/pause action script with the action scrip i have set to switch the buttons.
I have created a movie clip with 2 buttons with the code.
Pause button=
//Here when pressed the pause button will go to frame marker "2" where the play button is causing it to be displayed.
on (release) {
gotoAndStop(2);
_parent.stop();
}
play button =
on (release) {
gotoAndStop(2);
_parent.stop();
}
there are frame markers so on press the pause button will go to marker 2 where the play button is located... anyways that is working great. Play button switches to pause button when pressed... nice!
But now how do I combine a play action or the pause action and have it work along with this action that makes the buttons switch?
Thanks in advance for any info or time given to help me in this.
View Replies !
View Related
Adding Pause And Play Buttons
Hi,
I am doing a flash presentation
i want to add 2 buttons, Pause and Play
when clicks Pause button, the presentation stops and presentation continue when play button cliks.
So, how will be the action scripts ? please help
'running behind ACS'
View Replies !
View Related
Trouble With Pause / Play Buttons
Hello all,
Having some trouble with a slideshow flash file. The snippet of AS is attached below. The play functionality is working fine, but when the slideshow is running, the pause button won't work. Any idea what I'm doing wrong?
NextFrame = function(){
if (whichPic<NumCount) {
bLoad = true;
whichpic++;
} else {
if (whichPic==NumCount){
bLoad = true;
whichPic = 1;
}
}
}
PlayBTN.onRelease = function() {
setInterval(NextFrame, 2000);
}
PauseBTN.onRelease = function() {
clearInterval(NextFrame);
stop();
}
View Replies !
View Related
Play And Pause Sound Buttons
Here is my .FLA...
Anyway, you see that the sound is on a seperate layer, with gotoandplay(1); or w/e on the end... so it indefinetely loops if left to it's own devices.
Now the actions for the play arrow button are:
on (release) {
play();
}
and the actions for the stop square button are:
on (release) {
stop();
}
Techincally, as to my VERY BASIC A/S knowledge, this should work right? I also tried instead of "on (release)" I tried "onClipEvent (mouseUp)"
but that didn't work either. Can anyone help?
View Replies !
View Related
Create A Pause And Play Buttons
Hi i have got 2 files 1) shell.fla and 2) box.fla. The shell.fla will load the box.swf.
I need to create a pause and play button in shell file to control box.swf.
My box.fla is built in such a way whereby it is moive clip within movie clip within movie clip therefore i cannot use the stop() script to control it.
Please help.. i needed a button that stop and play all movie clips.
Thanks
View Replies !
View Related
Very Basic Pause/play Buttons
Hi all,
i'm trying to add a pause and play button onto my timeline animation, so that when i hit pause/play, all animation will pause/play at the same time:
so i use:
on (press) {
play();
}
and
on (press) {
stop();
}
on each button respectively.
it works fine until i realised that i have several movie clips within this main timeline, and the above command doesn't stop those movie clip animations as well.
what additional line of code should i put in?
basically the main timeline is where my animation is, with a few movie clips on various spots.
your help is much appreciated!
View Replies !
View Related
Flash Pause Play Buttons How To
i have a video i am making in Mx2004 and im putting it in a browser via
<html>
<body>
<object width="550" height="400">
<param name="movie" value="j:A teamgate.swf">
<embed src="j:A teamgate.swf" width="550" height="400">
</embed>
</object>
</body>
</html>
and i dont care where or how the pause play button is IE Html or flash as long as it starts and stops my clip by friday. even if it is a program that does it for me, the reason i need it is because i need to narate the story and that would be hard to do without the ability to stop and start.
View Replies !
View Related
Adding Pause And Play Buttons
Hi,
I am doing a flash presentation
i want to add 2 buttons, Pause and Play
when clicks Pause button, the presentation stops and presentation continue when play button cliks.
So, how will be the action scripts ? please help
'running behind ACS'
View Replies !
View Related
Trouble With Pause / Play Buttons
Hello all,
Having some trouble with a slideshow flash file. The snippet of AS is attached below. The play functionality is working fine, but when the slideshow is running, the pause button won't work. Any idea what I'm doing wrong?
NextFrame = function(){
if (whichPic<NumCount) {
bLoad = true;
whichpic++;
} else {
if (whichPic==NumCount){
bLoad = true;
whichPic = 1;
}
}
}
PlayBTN.onRelease = function() {
setInterval(NextFrame, 2000);
}
PauseBTN.onRelease = function() {
clearInterval(NextFrame);
stop();
}
View Replies !
View Related
Play And Pause Sound Buttons
Here is my .FLA...
Anyway, you see that the sound is on a seperate layer, with gotoandplay(1); or w/e on the end... so it indefinetely loops if left to it's own devices.
Now the actions for the play arrow button are:
on (release) {
play();
}
and the actions for the stop square button are:
on (release) {
stop();
}
Techincally, as to my VERY BASIC A/S knowledge, this should work right? I also tried instead of "on (release)" I tried "onClipEvent (mouseUp)"
but that didn't work either. Can anyone help?
View Replies !
View Related
Very Large Movie, Need Play/pause Buttons
I have a very large movie with lots of scenes (20+). I'm translating a PowerPoint presentation & video of the presentation in a flash movie. Each scene has a slide & sound file within it. Later I need to add a pointer to the file, hence the mutiple scenes. What I need is a play and pause button. I have buttons that work just fine until the movie gets to the frame limit and then everything stops working.
play button code
on (release) {
gotoAndPlay(_currentframe+1);
}
pause button code
on (release) {
stop();
}
Can anyone help?
thanks!
View Replies !
View Related
Coding Stop/play/pause Buttons
Dunno why the pause concept is giving me such a hard time. I know I need a variable to hold sound.position but any help would be appreciated.
Sound object is "narration" and resides on the main timeline. Buttons are in a dynamically loaded mc (not that this makes any difference).
I have 2 separate "Back" and "Forward" buttons that, on release, load a new topic and thus load a new mp3 into the sound object. Problem I'm having is that my "marker" variable which gets set to a narration.position on release of the pause button is doing its job too well. When the next mp3 is loaded, hitting play begins the new mp3 at the previously paused position. Can't seem to clear out "marker" to save my life.
Thanks in advance...
View Replies !
View Related
Embedded Video Play/pause Buttons
I have searched the help files but cannot find out how to link a play button to an embedded video using actionscript.
I just hav 3 short clips from a film which I want to be able to play and pause, can anyone help with some code?
Thanks
View Replies !
View Related
Play / Pause Buttons And Timeline Control
Hey all,
I have a big presentation with some 50+ screen shots. Each chapter is sub-divided into 9 scenes. Within these 9 scenes I have timeline controls. I have a PLAY and PAUSE buttons (separated) and a REWIND to beginning of the chapter and FORWARD to the next chapter. The PLAY and PAUSE buttons target a MC that resides within the same scene.
Here's the PROBLEM. I'm using basic actionscripting to play() and stop() targeting a MC on the stage that holds the slides. It seems my users will press the pause button and 2-3 minutes later it starts playing again!! It's VERY frustrating! Also my users had said that sometimes after they press play or pause the scene advances to the next chapter(scene) for no reason!?
I'm completely perplexed why this continues to occur. I have told the MC to stop WHY DOESN'T IT STAY STOPPED! I'm using MX 2004 and building the presentation to function as an AutoRun .EXE, if anyone has any ideas please fill me in....sound like I'm doing something wrong?
Here's the PLAY button:
on (release) {
tellTarget (MCname) {
play();
}
}
Here's the PAUSE button:
on (release) {
tellTarget (MCname) {
stop();
}
}
By Pressing pause it seems to initially work, but after 2-3 minutes, the movie just starts back up again.
Any ideas?
Is there a better way of writing this script?
J64
View Replies !
View Related
Two Buttons Play/Pause Sound; What Am I Doing Wrong
I've got two sound buttons: btnPlay and btnPause with the following code which is bombing.
Any idea of what I'm doing wrong?--Thanks!
btnPlay.addEventListener(MouseEvent.CLICK, PlayWelcome);
function PlayWelcome(event:MouseEvent, pausePosition):void {
SoundMixer.stopAll();
var mySound:Sound;
mySound=new Sound(new URLRequest("A_INTRO1.mp3"));
var pauseChannel:SoundChannel=mySound.play();
if (pausePosition!==0){
channel=mySound.play(pausePosition);
}
}
btnPause.addEventListener(MouseEvent.CLICK, PauseWelcome);
function PauseWelcome(event:MouseEvent):void {
var pausePosition:int=channel.position;
channel.stop();
}
View Replies !
View Related
Play Pause Buttons For Playing Video
Hello there
I am in urgent need of finding answers to this one and if some1 cld plz help me it wld so great...... I am making a webiste and am loading videos in it externally but now i dont knw how to make a play head with controls like play button and pause button in it....
If some one cld plz quickly help me....i would be grateful...
thanks
Arunima
View Replies !
View Related
How Do I Add Play/Pause/Rewind Buttons To A .swf File
I'm fairly new to flash and I built a flash movie (.fla) in flash 8.0 and then exported it as a .swf file and inserted into the following html:
http://www.dorsai-the-movie.com/flash.html
My question is, how do I add user controls for the movie? Like play, pause, skip to the beginning to this movie?
Please help!
Thank you!
View Replies !
View Related
How To Make Play/pause And Stop Buttons?
hi, would someone please be able to post the actionscript for these three buttons? i would very much appreciate it :)
i was wonderin if there was a way to make a pause button, with ns. but one that when you press it then press it again it wont start. so that no matter how many times you press it the movie will stay paused (now like ns.pause when you click it pauses and when you click it again it starts, i ned a dedicated pause button)
and how to make a play button? so that when its paused, the only thing to start it again is pressing the play button and that when itsplaying you can freely press the play button and nothing will happen? (again, ns.pause doen't work on the play button since if we have it there the play button is now able to pause the video)
also, how do i make a stop button? so i click it and it takes me to the start of the video and stops it from playing?
thx. phatmat.
View Replies !
View Related
[CS3] Play/pause On External Mp3s?
I have been searching the sound forums, but didn't quite found what I was looking for...
I have a little music player on my website, which loads about 20 external mp3s, the code I have is this:
Code:
var soundLoader:Sound = new Sound();
soundLoader.loadSound("audio/01.mp3", true);
Is there any way I can "pause" a song, and then hit play again and have the sound start where it stopped????
any help would be much appreciated..
View Replies !
View Related
How To Control External MC... Pause Play Etc
Hello,
Im trying to get an external swf to pause but I can't seem to do it... here is how my movies are setup
Domain1
preloader.swf
Domain2
movie.swf
When they were on the same domain I could access movie.swf fine but now it is on the other domain... it loads, but i can't control it.
Im using System.security.allowDomain so it loads fine but telling the container to pause now does nothing..
Hope someone can help
View Replies !
View Related
|