Play/pause Toggle Problem
My custom-built Flash player is experiencing a problem with the pause/play function. After pausing a video and then toggling back to play mode, the video "rewinds" about 1-2 seconds from where it was paused and then starts playback. How do I force it to start playing again from the frame it was paused on, instead of rewinding? This is happening on a Win XP system running IE version 7.0.5xxx and Flash version 9.0.16.0.Thanks/Leo
Adobe > Flash General Discussion
Posted on: 09/21/2007 10:35:26 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Play/pause Toggle
Hi
I want a button to play/pause my main timeline, wherever it is. How do I write this? I am assuming I will need to check for the current state of the movie, whether it is currenlty playing or pausing when the button is released.
I will also have audio playing at the same time. I know I can toggle the audio, but will the audio pause and resume at the same point? This is important because the audio will be a voice over which corresponds to the acreen content.
Would it be easier to do this if the buttone were controlling a movie clip and not the main timeline?
Thanks
spiral
Play/pause Toggle For Flv
Hi there. I know this has been posted before, and I've searched the forum, but I still can't figure out my problem. I'm sure it's super simple, but I'm really new to Flash and ActionScript, so I'll be grateful for your help.
here's what I have. It's adapted from a sound on/off toggle that I made, but I think I may have some things backwards. I feel dyslexic.
right now, it starts off paused, with the "play" button visible. this is what I want. But when I roll over the play button, it turns to the pause button and when I roll out, the video pauses. The video only plays when you're over the pause button, but the button state never changes and onRelease does nothing.
so confused.
thanks in advance for any help
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(5);
theVideo.attachVideo(ns);
ns.play("http://mauixstr.vo.llnwd.net/o1/mmedia/z_8_min_coach_promo/8mincoach_demo.flv")
ns.pause(true)
rewindButton.onRelease = function() {
ns.seek(0);
}
playPause.onRollOver = function() {
if(ns.pause() == false) {
this.gotoAndStop("pauseOver");
}
else {
this.gotoAndStop("playOver");
}
}
playPause.onRollOut = function() {
if(ns.pause() == true) {
this.gotoAndStop("pause");
}
else {
this.gotoAndStop("play");
}
}
playPause.onRelease = function() {
if(ns.pause() == true) {
ns.pause(false);
this.gotoAndStop("pauseOver");
}
else {
ns.pause(true);
this.gotoAndStop("playOver");
}
}
FLV Play/pause Toggle Help
Hi folks -- I'm fairly new to AS3 and have run into a problem getting my play/pause toggle to work properly. As it stands, the toggle code reads:
playPause.addEventListener(MouseEvent.MOUSE_OVER, playPauseOverHandler);
playPause.addEventListener(MouseEvent.MOUSE_OUT, playPauseOutHandler);
playPause.addEventListener(MouseEvent.MOUSE_UP, playPauseUpHandler);
playPause.addEventListener(MouseEvent.CLICK, playPauseClickHandler);
function playPauseOverHandler(event:MouseEvent):void {
if(event.target.currentFrame == 1) event.target.gotoAndStop("pauseOver");
else event.target.gotoAndStop("playOver");
}
function playPauseOutHandler(event:MouseEvent):void {
if(playPause.currentFrame == 10) playPause.gotoAndStop("pause");
else playPause.gotoAndStop("play");
}
function playPauseUpHandler(event:MouseEvent):void {
if(playPause.currentFrame == 10) playPause.gotoAndStop("pause");
else playPause.gotoAndStop("play");
}
function playPauseClickHandler(event:MouseEvent):void {
if(playPause.currentframe == 10)
{
playPause.gotoAndStop("playOver");
ns.pause();
}
else
{
playPause.gotoAndStop("pauseOver");
ns.pause();
}
}
...with 'playPause' representing my movie clip. In tests, when the video is playing, it will successfully pause on click, but a) the movie clip does not jump to the 'play over' frame, and b) when clicked again, the button does not resume the video playback.
One external issue that might be impacting these errors is the fact that the net stream has been coded to look to an array of sequential videos, so playback typically looks like >
ns.play(videos[currentVideo]);
...where 'videos' represents the video object and 'currentVideo' represents whatever video is being referenced by the array.
Any help would be much appreciated. Links to creating custom players in AS3 would also be a big help. Thanks!
FLV Play/pause Toggle Help
Hi folks -- I'm fairly new to AS3 and have run into a problem getting my play/pause toggle to work properly. As it stands, the toggle code reads:
Code:
playPause.addEventListener(MouseEvent.MOUSE_OVER, playPauseOverHandler);
playPause.addEventListener(MouseEvent.MOUSE_OUT, playPauseOutHandler);
playPause.addEventListener(MouseEvent.MOUSE_UP, playPauseUpHandler);
playPause.addEventListener(MouseEvent.CLICK, playPauseClickHandler);
function playPauseOverHandler(event:MouseEvent):void {
if(event.target.currentFrame == 1) event.target.gotoAndStop("pauseOver");
else event.target.gotoAndStop("playOver");
}
function playPauseOutHandler(event:MouseEvent):void {
if(playPause.currentFrame == 10) playPause.gotoAndStop("pause");
else playPause.gotoAndStop("play");
}
function playPauseUpHandler(event:MouseEvent):void {
if(playPause.currentFrame == 10) playPause.gotoAndStop("pause");
else playPause.gotoAndStop("play");
}
function playPauseClickHandler(event:MouseEvent):void {
if(playPause.currentframe == 10)
{
playPause.gotoAndStop("playOver");
ns.pause();
}
else
{
playPause.gotoAndStop("pauseOver");
ns.pause();
}
}
...with 'playPause' representing my movie clip. In tests, when the video is playing, it will successfully pause on click, but a) the movie clip does not jump to the 'play over' frame, and b) when clicked again, the button does not resume the video playback.
One external issue that might be impacting these errors is the fact that the net stream has been coded to look to an array of sequential videos, so playback typically looks like >
Code:
ns.play(videos[currentVideo]);
...where 'videos' represents the video object and 'currentVideo' represents whatever video is being referenced by the array.
Any help would be much appreciated. Links to creating custom players in AS3 would also be a big help. Thanks Kirupas!
Load MC Play/Pause Toggle
Need help, please.
let me explain:
I have shell movie, that is loading in a dozen other movies.
First frame loades first movie, then stops and lets loaded MC play.
At end of loaded MC is an action that tells the root/parent/shell to go to the next point on the timeline, where an action on the main timeline calls/loads the next mc.
Make sense?
What I need is a play pause toggle button that will control this MC that has these external MC's loading into it.
So, any ideas the best way to do this? Im open to loading the movies differently if that would help.
Thanks guys!!
P.S. I have to have this done tommorow morning, so I am a little desperate.
How To Toggle Between Play And Pause In A Scene
hello everyone,
this is my first post. i'm having trouble with a play pause issue, and i was wondering if anyone could help me out.
i'm trying to be able to make a play/pause button that will work anytime throughout a single scene containing movie clips graphics... all that stuff within one scene.
so i just need a way to pause all the action at any time.
here's the movie that i need to be able to do this:
http://markmartucci.com/wannabet.html
there's a loading scene. and a click to enter scene... after you click to enter, that when i need the ability to pause at any time.
thank you soo much if anyone can help me out here. i'm in quite a jam.
-mark
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
Pause/Play Toggle Button?
I have an AIF file I created in Garage Band. This AIF has been placed into a movie clip called "mymusic" that has been placed on a layer in my movie with an instance name of "mymusic."
I have created play button and pause buttons that utilize the following scripts to stop the sound and the movie and then resume the sound and movie from the point where it was stopped:
Play Button:
on (press) {
play();
tellTarget ("mymusic") {
play () ;
}
}
Stop Button:
on (press) {
stop();
tellTarget ("mymusic") {
stop () ;
}
}
This works perfectly. Now the client wants me to combine the play and pause button and create a single toggle button that achieves what the above two described buttons did.
Any thoughts? Please help!!!
[F8] Play / Pause Toggle Button
Hello everyone, I have a project that requires a single button to play and pause the .swf. I am trying to make the button say play when the movie is stopped, when clicked on the movie plays and the button changes to pause - then of course when clicked again the movie pauses and the button changes back to play. Thanks for the help!
Play Pause Toggle Button Help
heres my code as of now.....let me know
meaning if the movie is over, and i hit the play button again, it replays the movie.
playButton.onRelease = function() {
ns.pause();
}
Play/Pause Toggle For MP3 Player
Hello,
If anyone has any suggestions on creating a play/pause effect from the actionscript that I am currently using, it would be greatly appreciated! I already have a play/stop toggle button, but would like to turn it into a play/pause button. (You will probably recognize this from the HOT Flash Prof. 8 book, Beyond The Basics.)
Even though the code for next/previous buttons is listed below, I really only need play/pause toggle functionality....and am at a total loss at how to do this.
The actionscript for each instance of the buttons are as follows:
PLAY:
on (rollOver) {
_root.helpBubble.text = "play music";
}
on (rollOut) {
_root.helpBubble.text = "";
}
on (release) {
_root.playMusak();
nextFrame();
}
STOP:
on (rollOver) {
_root.helpBubble.text = "stop music";
}
on (rollOut) {
_root.helpBubble.text = "";
}
on (release) {
_root.stopMusak();
prevFrame();
}
The actionscript that I am using for the overall flash project is as follows:
//----------------<sound initialization>-------------------\
var curTrackNum:Number = 0;
var bgMusak:Sound;
// autosize some text fields
this.helpBubble.autoSize = "center";
this.trackInfo.autoSize = "left";
// load the track info vars
var myMusicLv:LoadVars = new LoadVars();
myMusicLv.load("vars/track_info.txt");
//----------------<sound setup>----------------\
function stopMusak() {
delete bgMusak;
}
function playMusak() {
bgMusak = new Sound();
bgMusak.onSoundComplete = function() {
if (curTrackNum == (myMusicLv.totalTracks - 1)) {
curTrackNum = 0;
} else {
curTrackNum ++;
}
stopMusak(); /* change to playMusak(); if want to loop song */
}
bgMusak.onID3 = function() {
trackInfo.text = "artist : " + bgMusak.id3.TCOM + " | track : " + bgMusak.id3.TIT2;
}
bgMusak.onLoad = function(success) {
if (!success) {
trackInfo.text = "Failed to load track.";
}
}
bgMusak.loadSound("mp3s/mp3-" + curTrackNum + ".mp3", true);
musakProgBar.onEnterFrame = function() {
bgMusak.setVolume(musakVolume);
musakVolume = -musakVolumeMC.musakVolumeSliderMC._y * 2;
// add and modify percentage text
musakVolumeMC.volumeTxt.text = musakVolume + "%";
musakVolumeMC.volumeTxt._y = (-musakVolume/2) - 3;
musakVolumeMC.volumeTxt._alpha = musakVolume;
var trackD1Prog:Number = _root.bgMusak.getBytesLoaded() / 1000;
var trackD1Total:Number = _root.bgMusak.getBytesTotal() / 1000;
var trackD1Percent:Number = Math.round((trackD1Prog/trackD1Total) * 249);
var trackD1Duration:Number = Math.round((bgMusak.duration/trackD1Percent) * 249);
musakProgBar.progMaskContainer.progMask._width = trackD1Percent + 9;
musakProgBar.musakProg._x = Math.round(_root.bgMusak.position/trackD1Duration * 249);
}
}
//----------------</sound setup>----------------\
//----------------<next track>-------------------\
this.nextTrackBtn.onRollOver = function() {
helpBubble.text = "next track";
}
this.nextTrackBtn.onRollOut = function() {
helpBubble.text = "";
}
this.nextTrackBtn.onRelease = function() {
if (curTrackNum == (myMusicLv.totalTracks - 1)) {
curTrackNum = 0;
} else {
curTrackNum ++;
}
stopMusak();
playMusak();
///
musakToggle.gotoAndStop(2);
}
//----------------</next track>-------------------\
//----------------<previous track>-------------------\
this.prevTrackBtn.onRollOver = function() {
helpBubble.text = "previous track";
}
this.prevTrackBtn.onRollOut = function() {
helpBubble.text = "";
}
this.prevTrackBtn.onRelease = function() {
if (curTrackNum == 0) {
curTrackNum = (myMusicLv.totalTracks - 1);
} else {
curTrackNum --;
}
///
musakToggle.gotoAndStop(2);
}
//----------------</previous track>-------------------\
//----------------</sound initialization>-------------------\
//----------------<volume control>-------------------\
// initialize some volume control settings
this.musakVolumeMC.volumeTxt.autoSize = "left";
var musakVolume:Number = 25;
var speakerClick:Number = 0;
this.musakVolumeMC._visible = false;
this.musakVolumeMC.musakVolumeSliderMC._y = -(musakVolume/2);
// control the visibility of the volume slider
this.speaker.onRelease = function () {
if (speakerClick == 0) {
musakVolumeMC._visible = true;
speakerClick = 1;
speaker._alpha = 50;
} else {
musakVolumeMC._visible = false;
speakerClick = 0;
speaker._alpha = 100;
}
}
// set what should happen when the volume slider is pressed, released, or released outside
this.musakVolumeMC.musakVolumeSliderMC.onPress = function() {
startDrag(this,false,0,-50,0,0);
///
}
this.musakVolumeMC.musakVolumeSliderMC.onRelease = function() {
stopDrag();
///
}
this.musakVolumeMC.musakVolumeSliderMC.onReleaseOu tside = function() {
stopDrag();
///
}
//----------------</volume control>-------------------\
Help With Basic Play/pause Toggle
Hi Everyone,
I'm trying to make a play/pause button for the video player that Lee showed us. Does the ns.pause() return anything? I try and test that to determine what state the button is but that doesn't seem to work. Do I create a separate variable to keep track whether or not the player is playing?
Code:
theVideo.attachVideo(ns);
var x:XML = new XML();
x.ignoreWhite = true;
var urls:Array = new Array();
var captions:Array = new Array();
var src:Array = new Array();
var whoIsOn:Number;
var playing:Boolean;
x.onLoad = function() {
var photos:Array = this.firstChild.childNodes;
for (i=0; i<photos.length; i++) {
urls.push(photos[i].attributes.url);
captions.push(photos[i].attributes.name);
src.push(photos[i].attributes.link);
}
ns.play(urls[0]);
playing = true;
caption.text = captions[0];
whoIsOn = 0;
};
x.load("vidPlaylist.xml");
//
//Buttons=================================
rewindButton.onRelease = function() {
ns.seek(0);
};
linkButton.onRelease = function(){
//trace(src[whoIsOn]);
getURL(src[whoIsOn]);
}
this.playButton.gotoAndStop("pause");
playButton.onRollOver = function() {
//this.gotoAndStop("pause");
}
playButton.onRollOut = function(){
if (playing){
this.gotoAndStop("play");
}
}
playButton.onRelease = function() {
ns.pause();
};
Play Pause Toggle Button
I currently have a dynamic playlist created from Lee's tutorial, and I currently have a play pause toggle function for the video. But when I select another video list option my button states do not refresh. EX.(video is playing and I press the play pause toggle which places it into the pause state. video is paused and button show play. But when I select another video to play the pause button remains int the play state.
Is there any way to refresh the buttons every time I select a video option.
Thank you
Play/pause Toggle Button For FLV Player. Help
I've followed Lee Brimelow's tutorial on gotoandlearn.com about how to build a video portfolio and everything works cool. However, as it's currently set up, when the pause/play toggle button is clicked it stays on the 'play' state on the main timeline. Hoping to fix this, i went ahead and created 4 states for this button (pause, pauseOver, play, and playOver, it's a movieclip so I made frame labels to coincide with each state). Then I went look at this thread to try and fix it:
http://board.flashkit.com/board/showthread.php?t=752184
Still no good. So I was wondering if someone might be able to help. Here's my code that does all the NetStream stuff (still new here!) and my play button function. Any help would be much appreciated. Thanks!
PHP Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(10);
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}
theVideo.attachVideo(ns);
rewindButton.onRelease = function() {
ns.seek(0);
}
playButton.onRelease = function() {
ns.pause();
}
How To Create Pause/Play Toggle Control?
I've created a SWF file with 4 images that fade in and out on rotation, but wanted to add a basic pause/play toggle button for the users.
Can anyone explain how the easiest way to go about this would be or provide me with a link to a good tutorial?
Thanks in advance!
[F8] Reset Pause/play Toggle When Replay Is Clicked?
I've got a pause/play toggle button for the whole movie, and also a replay button. When I've got the movie paused, and I click the replay button, then the pause/play toggle button is out of synch (says pause but the movie is now playing).
How can I "reset" the pause/play toggle button when the reset button is clicked?
The pause/play toggle is in a two-frame mc setup.
Thanks for looking.
How To Add A Toggle Play/pause Button For A Flash Video
Hi,
Can someone help me with this flash video. I am creating a custom video controllers and I need to have a toggle play and pause button. How would do I go about that. I tried to use it on a play button and the video pauses and play, but I need to get the pause image and play image in there. So, can anyone give me the code for that . I really appreciate it.
Thanks
MP3 Player Play/Pause Toggle Button Not Working
Hey, can anyone give me actionscript help...
I have an mp3 player on this site but my Play/Pause toggle button isn't working like it's supposed too..
This is the site address:
http://www.clairmonthumphrey.com/Site/
Attach Code
// ActionScript Document
//setup Sound Object
var s:Sound = new Sound();
s.onSoundComplete = playSong;
s.setVolume(75);
//Array of songs
var sa:Array = new Array();
//Currently playing song
var cps:Number = -1;
//Position of music
var pos:Number;
//Load the xml
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
for(var i=0;i<nodes.length;i++)
{
sa.push(nodes[i].attributes.url)
}
playSong();
}
xml.load('songs.xml');
//play the mp3 files
function playSong():Void
{
s = new Sound();
if(cps==sa.length-1)
{
cps = 0;
s.loadSound(sa[cps],true);
}
else
{
s.loadSound(sa[++cps],true);
}
playPause_mc.gotoAndStop('pause');
}
//Pauses the music
function pauseIt():Void
{
pos = s.position;
s.stop();
}
//unPauses the music
function unpauseIt():Void
{
s.start(pos/1000);
}
//Music Controls
//Play/Pause Toggle
playPause_mc.onRollOver = function()
{
if(this._currentframe==1) this.gotoAndStop('pauseOver');
else this.gotoAndStop('playOver');
}
playPause_mc.onRollOut = playPause_mc.onReleaseOutside = function()
{
if(this._currentframe==10) this.gotoAndStop('pause');
else this.gotoAndStop('play');
}
playPause_mc.onRelease = function()
{
if(this._currentframe==10)
{
this.gotoAndStop('playOver');
this._parent.pauseIt();
}
else
{
this.gotoAndStop('pauseOver');
this._parent.unPauseIt();
}
}
//Next Button
next_mc.onRollOver = function()
{
this.gotoAndStop('nextOver');
}
next_mc.onRollOut = next.onReleaseOutside = function()
{
this.gotoAndStop('next');
}
next_mc.onRelease = function()
{
this._parent.playSong();
}
Video Basics - Play / Pause Toggle Button?
I'm modifying Lee's flash video player (from the tutorials) and and want to add a toggle state to the "pause" button. I want it to switch from a play graphic to a pause symbol when pressed, similar to the mute button in Video Basics part 8. Of course, the focus is also to keep all the actionscipt off the individual movie clips and in the same location as the rest of the script (frame 1 on the root timeline). I dont know much about NetStream, so does anyone have any suggestions?
Creating Play/Pause Toggle Buttons Controlling Slide Presentation Timeline
Need guidance in creating Action Script to create a single button on a Flash Slide Presentation screen that toggles between Play and Pause icons and functions controlling timeline playback, just as happens on the Flash Media Controller panel when playing back a video clip. I assume this would involve a Component button, but not sure how to assign icons and functions to the toggle states.
Pause Toggle For Streamed MP3's...
Hello,
I'm building a player where different buttons load different external MP3 songs to stream. If possible, I'd like one hit of my pause button to pause/stop the song, and another hit of the same pause button to start the song back up from where it stopped.
Any help will be appreciated!
Thanks,
Todd Lerner
Toggle Pause/autoplay
Any advice for the play/pause button when your coding the as3 from scratch? I have a play button..then a pause button that appears when the play button is clicked. I was wondering how everyone makes the play/pause functionality work?
What I have done in the past is make 3 buttons. 1 pause and two plays. One play is the ns.play() and once clicked I set its visible to false. Is this how everyone does it? Can you do it with two buttons?
Flv: Toggle Puase And Play
I am trying to get one button to toggle between play and pause. I used the togglePause() method of the netstream class. Then I thought to use the pause() method and a single vaiable I would set true if it is paused. Whats the correct way to pause and play an flv with one button? Again, togglePause() works fine..... just wondering if thats the best way.
Attach Code
function togglePauseHandler(event:MouseEvent):void {
ns.togglePause();
}
Edited: 01/12/2009 at 01:46:54 PM by >Vee<
Play/stop Button In One To Toggle (?)
Hi,
I know I've seen this question brought up on previous posts..
How do I use just one button to toggle between play and stop function. Also, how do I get the toggle to switch image from stop to play or viceversa?
So, when the stop button is pressed, it stops the movie and the image changes to play button and when pressed, it plays the movie again?
any suggestions will be helpful.
P.S. I also want to know if there is a way to preload all the external movies on the first initial movie preload?
Thanks.
Play/stop Audio Toggle?
I have a couple images I made:
Is there a way to make it where you click the play button and it switches to the stop button and starts an audio file, then stops the audio when you click the stop button?
Thanks,
Jeff
How Do I Toggle Play W/ Action Script?
on (release) {
if (stop == "no") {
stop = "yes"; stop();
}
else if (stop == "yes") {
stop = "no"; play();
}
}
I know this is bad form, but it also doesn't work. Please help!
(and yes I set the variable to no to begin with)
Ron R
How Do I Toggle Play W/ Action Script?
on (release) {
if (stop == "no") {
stop = "yes"; stop();
}
else if (stop == "yes") {
stop = "no"; play();
}
}
I know this is bad form, but it also doesn't work. Please help!
(and yes I set the variable to no to begin with)
Ron R
Play And Pause Code Plays & Pauses But Won't Play Again
I've got a button that I want to play an audio track; play, pause and then play again. Right now, it plays, pauses but won't play again.
I've got my as2 code in an Actions layer in the main timeline, I've got the audio in a mc, in it's own layer. The instance name is monkey7. Here's the code that I got awhile back off of this forum (I think):
Sound.prototype.pause = function():Void {
this.stop();
this.newPosition = this.position/1000;
};
pauseButton.onPress = function():Void {
paused = !paused;
if (paused) {
monkey7.pause();
} else {
monkey7.start(monkey7.newPosition);
}
};
monkey7 = new Sound();
monkey7.attachSound("monkey7.mp3");
monkey7.start(0);
I'm very newbish so if you reply with a suggestion, please act as if you're talking to a 3 year old! Thanks.
How To Toggle A Play/stop Button On Movie?
I am like most newbies struggling with action script and seeking help on this forum I am sure, a beginner with coding in general. While some of it makes sense to me, the new AS is really confusing to me. With that being said, here is my little problem...
I have built a five scene Flash movie with small numbered buttons to navigate between different scenes somewhat easily. Where I am running in to trouble is that I also created another button with a dynamic text area with the variable name of textOutput that my first thought was to have populate this text area with either the word play or stop depending on whether the movie was playing or not and then add the button command that would start and stop the movie. I have tried several different ways to try and do this but it isn't working at all.
My latest attempt to try and finish this project up is abandon the dynamic text area idea all together and try to stick to the type of actionscript I sort of understand. That involves creating a movie clip and placing it on the main movie timeline. This movie clip I have named buttonStartStop. In this particular clip,
I created two key frames. One has a label of play with a button instance with the onRelease mouse command to "play."
on (release) {
this._parent.play();
}
The other label is to stop and has a mouse action assigned to the button to stop the movie.
on (release) {
this._parent.stop();
}
So with that being said, I have tried to code the frame action where this clip resides to have this clip move to the proper label or frame to show the appropriate action depending on the parent movie's action.
startToggle = function()
{
if (this.parent.isplaying)
{
this.is_playing = true;
gotoAndStop("stop");
}
else {
this.is_playing = false;
gotoAndStop("play");
}
}
Can someone help me out here to try and figure out how to get this function to work.
Thanks,
AzCowboy
How Can I Toggle Play/stop On A Movie Clip?
I'm working on a simple play/pause control for a movie clip.
Is there some property on movieclips that I can query to find if the movieclip is currently playing or stopped?
Otherwise, I figure I could add one myself, and alter it every time I play or stop the movie clip, but I don't want to.
Tutorial For Simple ONE Play/stop Toggle Button?
Hi,
Please bare with me. I'm new to this forum and to Action Scripting.
I'm using AS3 and I've been struggling and searching all over the web for a toggle button that stops playing the music when clicked and switches to the stop button and vice versa. The closest tutorial I could find is this: http://www.smartwebby.com/Flash/sound_button.asp
This is exactly what I want, but it's for Flash MX and I don't know how to script it to work with AS3. Can someone please help me?
Play/Pause Change Back To Play At End?
Hi All,
I am fairly new to actionscripting so I assume this is a fairly newb question.
Basically, I have my animation that includes Play/Pause button that I rigged up. I dont want the the movie to loop therefore I put a stop(); in the first frame, since my button changes from a Play icon to a Pause Icon. For the life me I can not work out how to make my animation to go back to the start and change my icon from the Pause icon back to the Play icon.
I assume I need some If statements, that will say something along the lines of if at end change icon to play, how should this code be written????
Pause Button Code:
on (release) {
gotoAndStop(1);
_parent.stop();
}
Play Button Code:
on (release) {
gotoAndStop(2);
_parent.play();
}
I have the controller code sitting within its own movieclip.
Any help would be greatly appreciate......
Pause And Play
Hi,
I'm trying to make a chronometer with flash 5, i made to movies, one for the small hand, one for the long hand.
I made a button to start and initialize the chrono, and one to pause and play the chrono.
My problem is the second button, i don't know witch action or witch code i have to use in order to make a pause on the first click, and to restart the chrono on a second click...
Thanks a lot to whom who will help me.
Kivi
Pause For While And Then Play..
Product: Macromedia Flash
version: 5
Subject : Pause for while and then play..! It is not working propperly..?
I have a problem in
1).swf file directly from the flash player.
2)navigator 4.7 ver when you run this code(.swf) with out flash player that mean you have the defult plug-in.
Now i explain how i did..!
a)I given the frame action for the pause the play on main movie scene is:
stoppedTime = getTimer();
b)I created movie symbol and diefien on frame of layer1 is:
mainStopTime = ..:stoppedTime;
pauseTime = "10000";
tellTarget ("/") {
stop ();
}
if (Number(getTimer())>=Number(Number(pausetime)+Numb er(mainStopTime))) {
tellTarget ("/") {
play ();
}
}
c) so darg the movie symbol where i require the pause
after this create a .swf movie then u run...
so, please see this and give the solution for this..!!
Thankyou
Pause And Play
I've a pause and audio button. I click on the the pause button, the mc will stop and click it again, it will resume the mc. If I click on the audio button, it will stop all the sound and I click on again the sound will play. However, if I click on the pause button, the mc will stop and at the same time I click on the audio button to off the sound then I click on the pause button again the mc will resume but the sound is playing. How I can stop the sound since I offed it already? Following is my code to resume the mc:
on (release) {
if (_root.currFrame == _root.totalFrame) {
_level1.gotoAndStop(_root.currFrame);
} else {
_level1.gotoAndPlay(_root.currFrame);
}
}
Pause And Play
I want an animation to pause on rollOver (button) and continue where it paused on rollOut. Anyone know how to do that? thanks.
-tucker-
Pause/Play All.
Right I have a really complex presentation with many levels of complexity, movies going on at different levels of the movie.
What I want is a pause and play button to sit at route level which will pause/play any of the movies running underneath. Is there such a control?
I just wanted two buttons.
Pause & Play
Is there a way to PAUSE a movieclip during an animation and when u press play it starts again from where u left it?
This is what I got so far...
Code:
///PAUSE BUTTON
on (press) {
_root.loadtarget3.gotoAndStop(_currentframe);
gotoAndStop(3);
}
///PLAY BUTTON
on (press) {
_root.loadtarget3.gotoAndPlay(_currentframe);
gotoAndStop(2);
}
[F8] Pause And Play
Hello,
I need to add a pause and play button for my flash file. This is fairly simple. What I haven't been able to figure out, is how to pause and play (to resume) the voice overs and music tracks.
Layer Name = Music 1 / Sound Name = Act1Music
Layer Name = Music 2 / Sound Name = Act2-Scene5.mp3
Layer Name = Music 3 / Sound Name = Act3&4Music
etc..
Layer Name = Voice 1 / Sound Name = Rick VO_01.mp3
Layer Name = Voice 2 / Sound Name = Rick VO_02.mp3
Layer Name = Voice 3 / Sound Name = Rick VO_03.mp3
etc
I need the music and VO to pause no matter what VO or music track is playing, and resume right where it left off, when they press the Play button.
Right now, I have very simple pause and play buttons
//PAUSE
on (press) {
stop();
}
//PLAY
on (press) {
play();
}
Thanks in advance, if anyone can help.
Brian
[CS3] Pause Play Pause Play Etc....
I was wondering how i have my movie play, then pause for a few seconds the play, then pause again and so and and so on...
right now i'm using the script:
PHP Code:
stop();
myInterval = setInterval(doContinue, 5000);
function doContinue() {
clearInterval(myInterval);
gotoAndPlay("slideshow");
}
problem is when i use the same script over and over it's messing up my whole project.... meaning i feel like nomatter where i'm at in the project(not all of it is a slideshow) it keeps going back to the slideshow. Please help!!!
Pause And Play
Hello everyone, I have a movie clip that runs in a loop showing photos. I have a pause button which stops the movie if you hold it down.
[color="Red"]on (press) {
stop();
}
Mp3 Pause/play Help
Okay, so I made a simple mp3 player with just pause and play functionality. When I load and play the track once, the pause and play works. The problem is...when I load the same song again, the .position property doesn't reset...any help appreciated...here is my code:
ActionScript Code:
stop();
var music:Array = new Array("music/track1.mp3","music/track2.mp3","music/track3.mp3");
var song:Sound = new Sound(this);
var cue:Number;
var songCount:Number = 0;
song.onSoundComplete = function(){
trace("done");
cue = 0;
}
play_btn.onRelease = function(){
playSong();
}
pause_btn.onRelease = pauseSong;
function playSong(){
trace(cue);
song.start(cue,0);
}
function pauseSong(){
cue = Math.round(song.position/1000);
trace(cue);
song.stop();
}
function loadSong(whichSong){
song.loadSound(music[whichSong],true);
song.start(0,0);
}
next_btn.onRelease = function(){
cue = 0;
songCount += 1;
loadSong(songCount);
}
back_btn.onRelease = function(){
cue = 0;
songCount -= 1;
loadSong(songCount);
}
Play /pause
I have a question, i load external mp3's into my flash movie, now if i wanna 'pause' and 'play' these songs how do i write that? cause now it just starts from the beginning...not from where i paused it.
here's the code i written...
ActionScript Code:
function changeSound(loadWhatSong) {
my_sound = new Sound(this);
my_sound.loadSound(loadWhatSong, true);
my_sound.setVolume (70);
}
changeSound ("sound/chapter_1.mp3");
}
Pause/play
Having trouble w. scripting a movie clip, that has a sound in it. I want the pause btn to to pause and be able to play again at the same time. I can get it to stop, but never to start again at the same frame it was paused on. Any help?
FLV Play And Pause
I have a FLV playback component on the stage with an instance name of my_FLVplybk. I am trying to pause and play the video using buttons on the parent timeline, "19mc" which is embedded in the main timeline. The pause button (for example) targets the main and embeded timeline.
However, when I check the script it reports the FLV playback code as an error.
I'm not sure what I'm missing, but hopefully someone out there can show me the error of my ways...
Thanks,
Chris
Attach Code
this.onPress = function() {
trace( "vClipState = " + _root.vClipState);
if (_root.vClipState == "playing") {
this._parent.stop();
_root.stop();
this._parent.my_FLVplybk.pause();
this.gotoAndStop("paused");
this._parent.playButton_mc.gotoAndStop("paused");
trace("paused");
Flv Play And Pause
Hi,
I have an swf that has an flv link and when I test it locally it functions perfectly with respect to playing and pausing. Here is the relative code for the pause button:
MyMC.newSlide.myFLV.pause();
When I post it to the web the play and pause no longer work. The video plays but the pause button no longer functions. Does anyone know what's going on?
Thanks in advance for any assistance.
|