ActionScript 2.0 :: Basic Button To Play / Stop Movie
Sep 2, 2004
I'm trying (and failing it seems) to teach myself Action script and I'm having a really tough time with what I'm sure is something that quite easy to do. Basically I have one button. When this button is pressed I'd like it play a movie. When the button is pressed again I'd like to stop playing the movie. In the first frame of the movie I've put a stop action so that it doesn;t repeat itself when it finishes playing. In the last frame of the movie I've put gotoAndStop(2); In my main timeline I have 2 layers each of which has one frame. The button is one layer and the movie on the other.
[Code]...
View 5 Replies
Similar Posts:
Sep 2, 2004
I'm trying (and failing it seems) to teach myself Action script and I'm having a really tough time with what I'm sure is something that quite easy to do. Basically I have one button. When this button is pressed I'd like it play a movie. When the button is pressed again I'd like to stop playing the movie. In the first frame of the movie I've put a stop action so that it doesn;t repeat itself when it finishes playing. In the last frame of the movie I've put gotoAndStop(2);In my main timeline I have 2 layers each of which has one frame. The button is one layer and the movie on the other.
I selected the button on the stage and gave it the actionscript
on (press){
gotoAndPlay("vcsound_mc.play(2)");
[code]....
View 5 Replies
Dec 1, 2004
give me the actionscript for a bar that has a play and stop button to play and stop frames in a flash movie. i would be gratefull if you could as i am really stuck
View 2 Replies
Jun 2, 2006
I want to make one button to play & stop my movie! what is the code?
View 14 Replies
Mar 31, 2010
I edited a video and am trying to just throw it up as a basic flash video for an April Fools Joke but it's not working for some reason.
Code:
<object type="application/x-shockwave-flash"
data="movie.swf"
width="100%" height="100%">
<param name="movie" value="movie.swf" />
<param name="quality" value="high"/>
</object>
It will play just fine when I demo it on my own computer but when I upload it to a web server it doesn't work anymore. It shows that there is a Flash object. When I right click on the object it gives me the normal "Zoom In" and "Quality" buttons, but the movie itself doesn't play. And I do have the html file and the swf file in the same folder and it is named movie.swf. There is no other html code in this webpage than the above.
View 1 Replies
Jan 8, 2010
Normally, I want the movie to play the tween that spans from 25 to 35, then stop UNLESS a button has been clicked back on frame 24 - then I want the tween played from 25 to 35 then jump to 46.Problem is, in the button function code, if I have...gotoAndPlay(25); gotoAndPlay(46);the timeline jumps straight to 46 - it doesn't play 25-35. Why?I tried putting a timer in between the two gotoAndPlays, but itignored that too and jumped to 46.o how do I tell it - 'play from 25-35 and stop, unless but_a was pressed back on Frame 24 - then play 25-35, and then play 46' ?
View 7 Replies
Feb 1, 2008
I just got Flash CS3. I'm trying to get my main timeline to stop in the begining, on button press to play and at the end stop again. In AS2, you would just put stop(); on the first keyframe and stop(); on the last key frame and program your buttons accordingly.
The stop(); does not work!!!! It's driving me crazy. What am I missing? I've gone through the tutorials in Flash and they don't work either.Also, if you have MovieClip that contains an animation and you don't want the movie clip to be on a continuous loop how do you stop it from playing. In AS2, I would put a stop(); on the last keyframe of the movieclip's animation. This also does not work in AS3.
View 9 Replies
Feb 27, 2012
I have created two buttons for separate audio files. Essentially if you click on the button it will play and stop. This works great! I have also injected a SoundMixer.stopAll(); to ensure if you click between both buttons that it will stop the current audio file to play the next one. My problem is when I select the 2nd button for the first time everything seems to be working...it's when I attempt to click on the first button again, that it will require 2 clicks and then it stops and plays accordingly...anyone know how I could eliminate this annoying two click process?
[Code]...
View 1 Replies
Apr 22, 2009
I've got a basic little slide show player which is timeline-based, rolling through 5 images with alpha transitions, and on the topmost layer, I have 5 invisible movie clips which have actions applied to them as follows:
on (press) { gotoAndPlay(21);}
This action should allow for the on click button to navigate to that specific frame, or image, but for some reason it is not working.
View 2 Replies
Sep 1, 2010
I want a movie clip (let's call it homecontent_MC) with 100 frames play to frame 80 and stop.Then when someone clicks a button on the navigation bar (home, about, services, contact, etc...) homecontent_MC would then begin playing from it's position (frame 80) til it reaches 100, at which point it wouldn't be on screen, and the movie clip that corresponds to the navigation button press (say services_MC...) would start from frame 1 and continue til it stops at it's frame 80...
View 7 Replies
Apr 5, 2010
im using this code for my movie to pause for a certain time and then it play every after 5 seconds
stop();
var nInterval = setInterval(Play, 5000);
function Play() { clearInterval(nInterval); gotoAndPlay(_currentframe+1);}
[code].....
View 8 Replies
May 8, 2010
i started with a Multiple mp3 players project and i more complicated with that - as you see in the picture i try to do that when click on the play button for every song this switch the song that selected -first preloading + percentage the mp3 file and after play it immediately and of course there is stop button, pause button when choose a song the previously that play will be muted
View 4 Replies
Mar 9, 2010
I have two buttons for paly and stop movie.
It is possible to only use ONE button ...
EXample
When click PLAY , stop btn is on
When click Stop, Play btn is on.
My file: [URL]
View 1 Replies
Feb 2, 2009
I'm making a movie where I want the movie to stop at particular frames.
I know I can use stop(); for that one.
Next I want the movie to start again after a mouse click or any key being pressed on the keyboard until I want it to stop again at another frame. Then start the same process.
I'm trying to make a slideshow type thing so you can understand why I want to do that.
What's the actionscript for this one? I don't want to involve any buttons?
View 5 Replies
Apr 7, 2009
I just want to play and stop my movie on a key click.I don't want to have the drop menu open and have the user click 'play'. Isn't there some way they can just press any key and the animation will progress forward?
View 4 Replies
May 16, 2009
when i play the movie and click on any ball it shows the subpage one by one continuously rather than to stop as per the number of their page order.
View 4 Replies
Nov 4, 2009
I've set up my flash movie to play and stop at certain frames in the movie. I'd like to add a pause button to pause the movie anywhere in the timeline or animation and then resume from spot it's paused on. This is for a presentation.
View 1 Replies
Oct 11, 2009
I have five different scenes all including three different buttons. When I test the buttons in "play scene" - all buttons sounds correctly in all scenes. But when I play movie, there is sound only with one button (the same button in every scene). I have looked for differences, but this button seem to have all the same parameters as the others.
View 10 Replies
Dec 23, 2009
I am using flash CS4 AS 2.0.creating a button to stop the music on click and play the music on the next click. Sort of on and off music.
View 12 Replies
Jan 3, 2010
I follow this tutorial to T and try look on google but can't answer to this one all want button do play movie and stop when click on the button .here my actionsript 3.0 code can you please tell me what i'm doing wrong.
Quote:
go.addEventListener(MouseEvent.CLICK, startplaying);
function startplaying(event:MouseEvent):void {
[code]...
here error getting in flash cs4 when try test movie
1120: Access of undefined property Puase 1120: source Puase.addEventListener(MouseEvent.CLICK, stopplaying);
View 7 Replies
Jan 25, 2010
I'm trying to fade in a button over a looping video clip however, it fades in and disappears after a few seconds. I tried adding stop() to the button but it stops the whole movie instead of just the button.
View 1 Replies
Jan 27, 2011
When you click the first time on the button, it should start the song, when you click a second time on the button, it should stop the song. how do i make this with actionscript 3?
View 1 Replies
Feb 20, 2011
I am using Flash CS5 and our professor from school has asked us to do a simple project for this weekend however I have been having so much trouble I have no idea what to do. He want's us to create an animation in flash and to use 2 buttons. One that will stop the animation and another that will play the animation. So this way as the animation is playing I can click stop and then click play at random times and the animation will stop or play.I have a buttons layer with 2 buttons on the same layer. One is called start and the other is called stop. I have a seperate layer with a movie clip I created of a moving polygon that goes from one side of the screen to the other. After creating the movie clip I double clicked on the object and created my animation in the new viewer that popped up. Now I have clicked scene 1 and it took me back to my main timeline.
Lastly I have an actions layer with nothing but code. I have made sure to type all my code by right clicking on this 1st frame and going to click actions. Then I typed in my code. Please note that each layer only has 1 frame as they were all edited individually by me double clicking on the object.After inserting the code I have I go to test the movie but get all these compiler errors. What am I doing wrong? Here is my code and the errors I keep getting.[code]
View 4 Replies
Dec 1, 2009
I'm having the worst time figuring this out... Here is the movie I made: [URL] and I want it to stop, then when i press that circle, continue with the animation. right now i have a stop(); on frame 19 the button is named myBtn I have tried all kinds of myBtn.onRelease = Play() but when I do that, i get errors and it no longer stops...
View 7 Replies
Jan 25, 2010
I'm trying to fade in a button over a looping video clip however, it fades in and disappears after a few seconds. I tried adding stop() to the button but it stops the whole movie instead of just the button.
View 9 Replies
Jan 23, 2007
I simply created an movieclip called it themusic as instance and put a sound init Now on the firstframe i added these actions, the problem is the music just keeps going , it has no effect
the code
Code:
play_btn.onPress = function ()
{
trace('playing' + themusic);
//themusic.stopAllSounds();
[code].....
View 1 Replies
Feb 18, 2007
I have an MC which plays when movie is loaded. I have a button which I want to use to stop the MC playback. Then when it has stopped, have the same button to make it play.
Well my code went like this:
if (roller.stop = true) {
btn.onRelease = function (){
roller.play();
}} if (roller.play = true){
btn.onRelease = function () {
roller.stop();
}}
View 1 Replies
Nov 21, 2010
I would like a certain part of a movie clip to play dependant on the button pressed. And to be honest I am a massive newb when it comes to flash[code]...
This is what I have at the moment and it isn't working, I know this is wrong but i cannot think how to write it the way AS3 would understand it. The Idea is that I would like the Movie clip to play dependant on what button was pressed. So if number one button was pressed it would play frames 1-10 of the movie clip, (and then loop), and if number two button was pressed it would play frames 1-20 of the movie clip ( and then loop). And so on for about 15 different buttons.
View 1 Replies
Jun 13, 2009
This will not work for some reason, keep pressing the play then stop in the movie.
View 6 Replies
Aug 18, 2002
My movie has several movie clips each on it's own layer. The main timeline is one frame long. How would I have my entire movie play twice and then stop?
View 3 Replies