Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




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!



FlashKit > Flash Help > Flash MX
Posted on: 08-01-2004, 11:26 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Anyone Know How To Insert Player Control Buttons, Play Stop Pause Etc...
Hey guys,

i have a small series of movies that i made, i was wondering if i could get the code, or .fla file for an external player. Or just pretty much have stop, play, pause fast forward, and rewind buttons in the actual flash movie, if anyone has those answers i'd sell my soul to find out how i can get that to work, or any other helpfull info would be greatly appreciated.


Thanks a bunch

Eugene

XML MP3 Player Play And Pause Button
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!

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>-------------------\

[AS 3] Play Pause Mp3 Player Problem
Hello, i'm getting stuck on the play pause. When i pause the first song it does it right, and play it again it works fine. When i click for the next song and pause again, and re-play it, it plays the previous song instead of the current song. I think i'm not storing my position variable correctly. Now I got really confused, here is my code... please help out.

thanks.


ActionScript Code:
package{    import flash.display.MovieClip;    import flash.display.Sprite;    import flash.display.SimpleButton;    import flash.text.TextField;    import flash.text.TextFormat;    import flash.events.Event;    import flash.events.MouseEvent;    import flash.events.TimerEvent;    import flash.events.ErrorEvent;    import flash.media.Sound;    import flash.media.SoundChannel;    import flash.media.SoundTransform;    import flash.media.SoundLoaderContext;    import flash.net.URLRequest;    import flash.utils.Timer;    import flash.net.URLLoader;    import flash.xml.XMLDocument;    import flash.geom.Rectangle;    import flash.filters.GlowFilter;            public class AudioPlayer extends MovieClip    {        private var getMusic:URLRequest;        private var music:Sound = new Sound();        private var soundChannel:SoundChannel;        private var currentSound:Sound = music;        private var currentIndex:Number = 0;        private var songPlaying:Boolean = false;        private var xml:XML;        private var songlist:XMLList;        private var loader:URLLoader = new URLLoader(); //create a new URLLoader Object                 public function AudioPlayer():void {                        //back and forward buttons            back_mc.addEventListener(MouseEvent.CLICK, back);            forward_mc.addEventListener(MouseEvent.CLICK, forward);                        //play pause buttons            play_mc.addEventListener(MouseEvent.CLICK, playSong);            pause_mc.addEventListener(MouseEvent.CLICK, pauseSong);            play_mc.visible = false;                        //playlist button            playlist_mc.addEventListener(MouseEvent.CLICK, playlist);                        //load XML            loader.addEventListener(Event.COMPLETE, whenLoaded); //add an event listener to that object             loader.load(new URLRequest("songs.xml")); //Requests our xml file that contains our song data                    }        public function whenLoaded(e:Event):void {            xml = new XML(e.target.data);             songlist = xml.song; //accesses our song tag in our xml file            getMusic = new URLRequest(songlist[0].url);//get music from songlist            music.load(getMusic);//load music            soundChannel = music.play();//plays the music            currSong_txt.text = songlist[0].title; //gets song name from xml            currBand_txt.text = songlist[0].artist; //gets artist name                soundChannel.addEventListener(Event.SOUND_COMPLETE, forward);//runs the next song function when a song completes        }        public function pauseSong(e:Event):void {            var pausePosition:int = soundChannel.position;            currentIndex = soundChannel.position;            soundChannel.stop();            songPlaying = false;            play_mc.visible = true;            pause_mc.visible = false;            trace("pause " + currentIndex)        }        public function playSong(e:Event):void {            var pausePosition:int = soundChannel.position;            soundChannel = music.play(pausePosition);            //soundChannel.soundTransform = songVolume;            songPlaying = true;            soundChannel.addEventListener(Event.SOUND_COMPLETE, forward);            play_mc.visible = false;            pause_mc.visible = true;            trace("play " + currentIndex)        }        public function back(e:Event):void {            if (currentIndex > 0)                {                    currentIndex--;                }            else                {                    currentIndex = songlist.length() - 1;                }                    var nextReq:URLRequest = new URLRequest(songlist[currentIndex].url);            var prevTitle:Sound = new Sound(nextReq);            soundChannel.stop();            currSong_txt.text = songlist[currentIndex].title;            currBand_txt.text = songlist[currentIndex].artist;            soundChannel = prevTitle.play();            songPlaying = true;            currentSound = prevTitle;            soundChannel.addEventListener(Event.SOUND_COMPLETE, forward);                    }        public function forward(e:Event):void {            if (currentIndex < (songlist.length() - 1))                {                    currentIndex++;                }            else                {                    currentIndex = 0;                }                    var nextReq:URLRequest = new URLRequest(songlist[currentIndex].url);            var nextTitle:Sound = new Sound(nextReq);            soundChannel.stop();            currSong_txt.text = songlist[currentIndex].title;            currBand_txt.text = songlist[currentIndex].artist;            soundChannel = nextTitle.play();            songPlaying = true;            currentSound = nextTitle;            soundChannel.addEventListener(Event.SOUND_COMPLETE, forward);        }        public function playlist(e:Event):void {            //someFunction        }                    }}

sorry for the long lines of code, but i want to make sure to include everything.

i'm having trouble on the pause and play function!

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();
}

Play/Pause Button For A Flash MP3 Player
Hello,
I am constructing an mp3 player for my Flash site. It starts automatically using the following code. On the mp3 player, there is a rev, play/pause, and forward button. I am having a lot of difficulty with the play/pause actionscripting.

The Actionscript in the first frame of the movie is such:

numberOfSongs = 3;
mp3s = new Array(["music/ifthingsdontfeelright.mp3", "IF THINGS DON'T FEEL RIGHT"], ["music/pleasesay.mp3", "PLEASE SAY"], ["music/youdont.mp3", "YOU DON'T"]);
globalvolume = new Sound();
function songChanger(Number) {
mySong = new Sound();
currentSong = Number;
if (Number>=0 && Number<mp3s.length) {
mySong.loadSound(mp3s[Number][0], true);
_root.mySong.start();
_root.mp3player.trackName.text = (mp3s[Number][1]);
}
}
songChanger(0);

THEN, my play/pause movie "button" has the following Actionscript:
The 'pause' frame of the movie:

on (release) {
cue = Math.round(_root.mySong.position/1000);
_root.mySong.stop();
gotoAndStop("play");
}

The 'play' frame of the movie:

on (release) {
_root.mySong.start(cue,1);
gotoAndStop ("pause");
}

It toggles between the frames, but does not begin playing from the cue position. It doesn't play at all. Any ideas what might be going wrong?

Pause/play Button (flash Mp3 Player)
hi there,

i can't seem to figure out the actionscript for creating a simple play/pause button...

it should be something like this: when you click on PLAY, the song plays and the play button is replaced by the PAUSE button...when you click on PAUSE, it stops the song at the current frame (pause button is now replaced by PLAY button)...click PLAY again to resume from current frame...you know the drill...

oh yeah, there are 2 songs that are to be played...each being loaded from different levels (each on separate .swf files)...

any help on this would be greatly appreciated! thanks!

Toggling Play/pause Button For Flv Player
I have completed lee's tutorials on making a custom flash video player and decided to try and figure out how to toggle the play button between play and pause. But the code I've tried isn't working. I can get it to puase but can't get it to play again. Here is what I tried:

videoControls.playBtn.onRelease = function() {

if (ns.pause() == false) {
ns.pause(false);
}
else {
ns.pause(true);
}
}

Any thoughts? Thanks for any suggestions.

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();
}

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.

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

Play/Pause Buttons
I've embedded a .swf file into a web page, but need at add play/pause buttons to it. Does anyone know how? Do I need to use javascript?
Thanks

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.

Pause And Play Buttons
Hi can anyone help

I am trying to develop a slide show/movie thingy!!!.

The flash movie just starts at begining and continues to the end. however i want to allow user to be able to pause and then contine watching the movie when they want.

So my question is how do i create a pause button which pauses the movie and then a play button which continue the movie from where it was paused.

Thanks for any help



Pause/play Buttons
Hey everyone,

I'm looking to add pause/play buttons in my movie, but I don't know the code to do so. Can anyone help me out?

Thanks

A Simple Music Player, Play, Pause Stop A Sound?
I need a simple way to play a wav file pause it and stop it ? What can I use to do this?

thanks

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!

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.

Pause, Play, And Restart Buttons
Hi, I also need to incorporate pause and play buttons into my movie, as well as a restart button at the end of it. Again, I have no idea how to do this.
Thanks,
dave

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();
}
__________________

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

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?

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.

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?

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.

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

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.

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'

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();
}

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?

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

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!

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.

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'

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();
}

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?

Play And Pause Buttons For External Swf?
Is it possible to create play and pause buttons for external swf's in flash?

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!

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...

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

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).

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

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();
}

URGENT Pause/play Timeline From Buttons
I have a time line with images tweening

and two buttons in the time line how do i get the buttons to pause and play the time line?

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

Pause And Play Buttons In Flash Slideshow
Hi

I have created a slideshow with Flash following one of the tutorials of this site. Images loaded from XML file.
The slideshow loops and I was wondering if anyone knew how to create pause and play buttons.

Many thanks

S.

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!

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.

Loading Sorenson Swf Videos Into Mc Then Using Play/pause Buttons
Ok here's the deal. I have a timline with play and pause buttons they use the following code:

videomc.videomc2.play() or videomc.videomc2.stop()
This would normally work, but the swf I'm loading into the mc videomc2 is a shell swf used to play the stiched swfs. Help! Any ideas????

Copyright © 2005-08 www.BigResource.com, All rights reserved