IDE :: Play Music File Once Only On Click Of Play Button Until Music Stops

May 1, 2009

Using Macromedia Flash Professional 8.

I have a website banner made in Flash. I have added a music file to it and Play and Stop buttons. I also have a Replay button to replay the banner animation once it stops.

I have put the music on a separate frame so that it will not play automatically when the banner loads. I have made the Play button direct to the frame the music is located at so that when clicked, it will go to that frame and play the music file.

The problem I am currently having is that if I click the Play button more than once, it will play the music file again on top of the current play-through.

So if I click Play, the music will play. Then if I click it again, the music will play again, but on top of the first instance of the music, so two instances of it will now be playing and it sounds horrible.

I would like to make it so that if you click Play when the music is playing, it will not play the music again until the music has stopped.

View 6 Replies


Similar Posts:


ActionScript 1/2 :: When File Loads In The Browser - Music Immediately Plays And Loops Until Click A Button To Stop The Music

Mar 30, 2009

I downloaded a flash template and have modified it to suit our company but there is something that I can't do. When the file loads in the browser, music immediately plays and loops until you click a button to stop the music. On our video page, we have video
that we need to play that has sound in it. How do I get the background music to stop when my video plays without having to go up and stop the music manually. The videos are loaded via an external XML document and there are no buttons in the FLA file to link code to. the website is [URL]

View 4 Replies

Played Back Music Automatically Stops When You Click Button

Apr 6, 2009

I recently used one of those XSPF Flash player buttons on a website and of course it worked, played back music automatically, stops when you click button... but one weird thing I noticed is the song being cut off before it ends... One song I have is 4 minutes long, and only plays for 1.5 minutes..

View 1 Replies

Play Music In Flash Player By Clicking Play Button Which Is In The Webpage (outside Flash)

Feb 14, 2012

I want to play the music file in flash player (which is embedded obviously) by clicking the play button which is in the web page (not in flash player).

View 2 Replies

ActionScript 2.0 :: Streaming Music Using Flash, But After The 3rd Music Is Done, It Just Stops?

Feb 21, 2007

I am streaming music from my site using flash, but after the 3rd music is done, it just stops. Do i have to flush something or create a new music object for each 3 songs?

View 6 Replies

Create A Button To Stop And Play Music?

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

Play / Pause Music With Single Button?

Sep 28, 2009

I'm extremely new to Flash and I am making a website and want to have a single button that when pressed pauses or plays a music file. I was able to create one that works by following a tutorial that I found online but the problem is that the button is on the main timeline so as I move away from it, it stops working. I think that it would work better if I was able to make a movie clip out of the button so that it doesn't sit on the main timeline and will keep working no matter where I am on the timeline. All I need is one button that pauses and plays music when pressed. I also want to be able to have a "music on" line of text and "music off" line of text depending on whether the music is playing or not.

View 4 Replies

IDE :: Play / Pause Music With Single Button?

Sep 29, 2009

'm extremely new to Flash and I don't really know how to code yet.. I'm making a website and want to have a single button that when pressed either plays or pauses the music file. I found a tutorial that worked but it has two buttons (one for play and one for stop). You can see the tutorial here:[URL] I'm hoping that someone can tell me how I might be able to change the code so that a single button acts as both play and pause (i.e.; If music is not playing then play, if music is playing then stop).

View 2 Replies

ActionScript 1/2 :: Make The Music In This File Play Only Once?

May 8, 2011

What action/script do write to make only the music stop looping?[URL]... Im using AS2 . Im kinda new to flash so can you please explain thoroghly.

View 7 Replies

ActionScript 2.0 :: Stop One Music File When Play Another?

Nov 23, 2009

I'm developing a band site and currently have all the song clips playing and stopping via start/stop buttons. The issue is that all of the songs can be playing at the same time if you don't manually stop the other songs. The idea would be to have a song stop automatically if a user pushed play for another song.This is all the AS I have on the button right now:

Code:
on (release)
{

[code].....

View 1 Replies

ActionScript 2.0 :: STOPS The Music On FIRST CLICK Then RESUMES On The 2nd Click?

Mar 25, 2003

Is there an actionscript that STOPS the music on FIRST CLICK, then RESUMES on the 2nd Click? So everytime you click, SOUND STATES turns ON & OFF?

View 3 Replies

Actionscript 3 :: Play Pause Button In A Flash Music Player?

Nov 10, 2011

I'm trying to make a simple music player with only one button for Play & Pause the music. What I have now is a MovieClip with:

1st Keyframe: active state for play Button
2nd Keyframe: active state for pause button
3rd Keyframe: hover state for play button
4th Keyframe: hover state for pause button

The script works OK, and play and pause the music without problems as expected.

The problem comes after the second click in the play/pause button when the alternance between two states becomes chaotic. The button never returns to the play state although the music was paused.

This is the code:

/**** Objects and Vars ****/
var AutoPlay:Boolean = false;
var isPlaying:Boolean = false;

[Code].....

View 1 Replies

ActionScript 3.0 :: Audio Controls - Add Play/stop Music Button On The Page?

Jun 15, 2009

I am trying to add a music track to some of the pages of my flash website, I imported the mp3 file to the library and dragged it on the stage and it plays when I test it. I want to add play/stop music button on the page, I dragged buttons from the video components to use, but I have no idea where to start with the code??

View 1 Replies

Professional :: Create A Music Flash File That Will Play On Every Page Of The Website

Sep 16, 2010

How can I create a music flash file that will play on every page of the web site, I am going to have about 7 pages.

View 1 Replies

Flash :: Play Music On Site Preventing Easy Direct File Download?

May 12, 2010

I'm starting a blog with a hosted wordpress instance and i would like to be able to stream music using a flash player on some posts.The problem is that every player i find uses a simple param to get the file url which makes it very easy for someone to find that url and just download the file.I know that it's probably impossible to prevent this all together, but i at least don't want it to be obvious.

View 4 Replies

ActionScript 2.0 :: Music Separate From Flash File / Still Have Start Stop Music Buttons?

Oct 11, 2009

I want a site to have background music, but when I attach the music to the file it makes it quite large ...3 meg and the site is slow to load. Is there any way of having the music separate from the flash file and still have start stop music buttons?

View 2 Replies

ActionScript 1/2 :: Play Music From URL?

Mar 29, 2010

In AutoScript 2 how can I play music from URL?
 
mySound = new Sound();mySound.loadSound(""); 
and now how?

View 1 Replies

ActionScript 2.0 :: Play A Music From Library?

Feb 9, 2010

what is the code to play a music from library? AS2

View 2 Replies

Flash :: How To Play Music Tracks In AS3

Dec 19, 2010

I need to play three musical tracks one after the other in a circle. It is necessary that its are not loaded again and were in the cache. I use this code. Everything works fine on localhost, but only works after restart the app on the server. And wrong to re-download tracks every time.

[Code]...

optObj.music - it is the object with the parameters that is called when the app starts or when i call a function change the settings.

View 1 Replies

ActionScript 2.0 :: Music In Loaded Swf Can't Play

Jul 22, 2008

I have music (.mp3) in a .swf file that I'm loading into another .swf. When I play the .swf containing the music alone the music plays, but when I load the same .swf into another .swf there is no music.[code]...

View 6 Replies

ActionScript 3.0 :: Play Music When Key Is UP Stop When Down?

Jul 17, 2009

The following code plays music when the H key is being pressed and when is unpressed the music stops...the problem im having is that its re-playing the music for every milisecond the H key is being pressed so its creating an endless loop of the sound1, how may I change the code to only play once the sound1 while the H key is being pressed and stop when is unpressed[code]...

View 1 Replies

ActionScript 2.0 :: How To Play And Stopping Mp3(music)

Oct 9, 2007

in my game there are two labels, the "menu" label and the "game" label.i want to have one mp3(song) playing during the "menu" label and another (song) playing during the "game". So,while the player is in the "menu", if he clicks the "play" button the mp3(of the menu) must stop and the mp3(of the game) must begin.i have tried putting the command "stop all sounds" in "play" button's function, but it doesn't only stop the music that was being played (menu's mp3) but also the music that follows (game's mp3)

View 2 Replies

ActionScript 3.0 :: Play Music Only Until Certain Frame?

Nov 10, 2009

Im using as3 to start playing 1 music in the intro of my website... but i want that music to stop when he reatch frame 600...

View 1 Replies

ActionScript 2.0 :: Looping Music Won't Play

Mar 29, 2005

I am loading a movie in another flash movie clip. The first movie "animation.swf" has background music that loops twice. Linked in the library as "Song" and played as below:

loopMusic = new Sound ();
loopMusic.attachSound ("Song");
loopMusic.start (0,2);

It plays fine, but when that file is loaded in the main movie using loadMovie the sound doesn't play.

View 4 Replies

ActionScript 3.0 :: Page With Several Buttons That Play Music?

Dec 16, 2009

I made a simple page with several buttons that play music, but then decided I wanted a video (flv) to first play automatically, and when that ends the page with the buttons appears. How can I do that? Right now I have four layers using one frame. Layer one has the AS code, two has the text, three has the buttons and the fourth layer has a background image.

View 7 Replies

Professional :: Making Buttons Play Music?

Jan 6, 2011

I want to make on button play a piece of music and another one to stop the music. I manage to make buttons work for playing frames in the timeline, but how do I make the buttons play the music and stop it?

View 3 Replies

Html :: Play Background Music Continuously?

May 22, 2010

I am playing a background on my webpage by using miniswfloopplayer, now I want the music to play continuously throughout the website, currently the music starts all over again when a page loads which is quite obvious. I am looking for a approach where I can avoid the above situation.

View 1 Replies

ActionScript 3.0 :: Play Music Throughout Multiple Scenes?

Oct 11, 2009

I am making an interactive game for a school project that has an intro and a main part consisting of multiple scenes. I'm curious if I can have a song from my library play throughout multiple scenes. One song for the intro scenes, and another for the scenes that make up the actual game.

I also have a point in the game where you can get a 'game over' screen and an option to restart. I'm wanting the song to restart only at this point.

View 1 Replies

ActionScript 2.0 :: Music Player Won't Play On 2nd Song?

Nov 3, 2011

I have problem with the code below. its a flash mp3 player. I need to prevent it from autoplay from the start. but keeps on playing all the tracks after the user click on play. How can i fix this?

Code:
import flash.filters.DropShadowFilter;
var infostruc:Array = [];
var xmlData:XML = new XML();

[Code].....

View 2 Replies

ActionScript 2.0 :: Can Flash Play Streaming Music

Jan 26, 2004

I was wondering if it's possible for flash to play a music stream off of di.fm. They have a jazz stream that would fit perfect for the site I'm working on.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved