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


Similar Posts:


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

ActionScript 3.0 :: Background Music: Looping, Stopping?

Sep 1, 2009

I've got a few questions about background music. Such as...

- How do you get music to loop in the background of a stopped frame (or multiple stopped frames)?

- How do you get the looping background music playing in a stopped frame to stop when a certain button is clicked?

- and How do you get music to stop playing in regular, non-stopped frames when a certain button is clicked (although it's probably the same as the above question...)?

View 3 Replies

ActionScript 2.0 :: Music Animation / Stopping And Loading?

Jul 15, 2002

Basically I have a remote with forward, play, stop, and rewind. There are 5 songs. The mc, called player is within the main timeline. First thing I want it is to load the nomusic animation... which is a mc within the player mc. then when the music loads it'll play the workign animation when the song loads.also i'm trying to avoid going to different keyframes and states. so when song 1 is played, and if the forward button is pressed i want it to go the next song. etc...

View 2 Replies

ActionScript 2.0 :: Stopping Music In The Moment When Site Opened

Jun 9, 2004

I am doing a projector presentation that has music and I want in the moment the client goes into my site (included in the cd) the music of the projector to stop alone, any idea how to make it?

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 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 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 :: Stopping Function Started With Play Button

Dec 16, 2011

I need to stop a function, the function is started with a play button and I want it to stop by a stop button, then play then stop, etc. The changeColours function has a timer.start() at the end that triggers another function, which then restarts the changeColours function. These 2 functions keep doing this repeatedly after the play button and MouseEvent trigger the first function. I just want to be able to stop the changeColours function and then be able to start it again at any time.

ActionScript Code:
play_btn.addEventListener(MouseEvent.CLICK, playColours);
function playColours(e:MouseEvent):void {
if(!PLAYSTOP) {
changeColours();
PLAYSTOP = true;
}}
stop_btn.addEventListener(MouseEvent.CLICK, stopColours);
function stopColours(e:MouseEvent) {
//changeColours() needs to stop!!
}

View 6 Replies

Actionscript 2.0 :: Stopping Auto-play For Non XML Video Player?

Dec 3, 2007

i made a player based on the 'Video Basics' series and would like to disable the auto play. I've only found posts dealing with stopping auto play in the XML version and I can't figure it out.

I assume that I must modify the early part of the script?

Code: Select allvar nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(10);

[Code].....

View 9 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

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

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

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

ActionScript 2.0 :: Looping Music Wont 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);

[code]....

View 4 Replies

ActionScript 2.0 :: Play And Stop Buttons With Music?

Sep 15, 2007

i want to create a small music player (that play only 1 song) which contains- a Play button - button symbol a Stop button - button symbol a title (show what song is currently playing) - movie symbol music - i guess movie symbol

the only problem i couldnt solve (the rest are working fine) is that the play and stop buttons arent working. the scripts i wrote for them are:

on(press){
a.play();
}

[Code].....

respectively, while "a" is the instant name for the symbol which contains the song.

i think i figured out that the problem is that in the music symbol there is only 1 frame (which contains the song- i just went to frame #1 and dragged to the edit screen the song from the library).

View 2 Replies

ActionScript 2.0 :: Play The Swf And Listen To Music At The Same Time?

Aug 8, 2003

I've been workning on this footer for a friend and its all working how its supposed to but I noticed that if I play the swf and listen to music at the same time, the music will jump and skip and lag and stuff like that.

I'm on WinXP so I hit Ctrl+Alt+Del to check how much of the CPU was being used and it was up at 100%, when I closed the flash player, the CPU Usage jumped back down to around 5%

[Code]...

View 3 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 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 :: 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