ActionScript 2.0 :: Background Music Class - Initiate And Attach Sound?
Jul 13, 2011
I'm working on a background music class and found that you cannot use the Sound class in a class file. Specifically, initiating and attaching the sound. Starting, stopping, getting the duration and such seem acceptable (though I haven't tested this yet). I've done a few searches and haven't found any work arounds other than when the class is called, hand it the sound object with the sound already attached, like this:
ActionScript Code:
import bgMusicClass;
var bgSnd:Sound = new Sound(this);
bgSnd.attachSnd("newWave.mp3");
var bgMusic = new bgMusicClass(bgSnd);
View 2 Replies
Similar Posts:
Apr 20, 2011
I'm triying to stop a sound of a button, while you hear a background music. The music is assigned in the timeline for the animation. When the animation stop at a specific frame (activity), the button are showed. At this point is all ok.
I don't understand... I am very specific to wich sound must stop. Is there a bug?
In AS 3.0 is more easy when you use the SoundChannel, but in AS 2.0 ?
View 3 Replies
Jun 22, 2009
I am developing an application in flash(AS2) with FMS/RED5. where i want to record sound through microphone with background music(Flash is playing mp3). is that possible in as2 ?
View 0 Replies
Sep 20, 2010
I have a flash file with a background music sound object, and I have a video player at a particular section on the timeline. When the playback head goes to the section with the video player, I would like the background music to fade, but of course, I need the volume to be up for the video. The code I have works find to fade the audio, but the problem is that the video's sound also turns off.
This is the code at the beginning of the timeline:
_global.volumeVar = 40; //Stores the current volume.
bgSound = new Sound(this); //This block works finebgSound.attachSound("music");bgSound.start(0,99);
bgSound.setVolume(0);
[Code] .....
Further down the time line, in the video player section, there this code, which works to fade the sound, but seems to turn off the video, too:
nInterval = setInterval(fadeOutSound, _global.volumeVar);
View 5 Replies
Apr 19, 2011
I have a Flash 8 site that plays music in the background. When I click on one of the menu choices, the timeline jumps to another frame where the selected page is. Once at that page, I want the background music to stop and the page's music to start. Here is what I have:
Attached to frame 1:
var s:Sound=new Sound(); // to initialize a sound instances
then attached to each page keyframe:
stopAllSounds();
s.attachSound("thelinkageidofthesoundthatcorrespondstothispage");
s.start();
When the timeline jumps to the page frame, the background music stops but the page's music doesn't start.
View 5 Replies
Apr 16, 2010
I followed the mp3player tutorial (part 3) from [URL] and got it working fine. Only problem is that the setVolume I'm trying to use with my music is affecting all my other sounds - button sounds and background sound. I'm aware of the createEmptyMovieClip/attachSound approach and got it working on my other sounds. But Lee's tutorial-mp3player is using a slight different technique, and so my normal approach doesn't quite work.
[Code]....
View 7 Replies
Apr 30, 2011
I'm working on an animation where I have my "dog" fighting the evil vacuum cleaner. I got most of it to work the way I want it to.
1) I have movie clips entitled pepper_mc (where my dog is supposed to be walking), swirl (where a swirly-type symbol is supposed to spin over the dead vacuum's head), and vacuum_mc (where the evil vacuum is supposed to have a swinging arm (called vacuumarm_mc) that I created using the bone tool). When I add them to the stage and test them, the animations within the movie clips don't happen.
2) I have background music that I'd like to stop playing at the end of the animation, but I'm not sure how to do that. (using the stop(); actionscript doesn't help).Where am I going wrong? I'm using Flash Pro CS5.
Here's the file --> Pepper and the Vacuum of DOOM!
View 1 Replies
Sep 30, 2011
Making a game and I have a preloader class which is linked to the main 'game.fla' file, in the preloader class I have imported the 'Game.as' class that contains ALL the code to run the game. The problem I am having is that I can't seem to 'initiate' the game once all the elements are loaded.
View 2 Replies
Nov 30, 2009
I've got a simple tiling class, and it works as long as its a document class... how do i create a new instance and initiate it kinda like this:
Code:
var newTile:bgTile = new bgTile();
newTile.tile(pattern_name);
[code]....
View 2 Replies
Nov 19, 2010
I have converted a large background image (much larger than the stage) into a Movie Clip. I did this so I can make it scroll as the player traverses to the edge of the scene.This appears to make the player free to roam the entire background image.I have a tree symbol with a class attached to it that blocks player movement.Here is my problem:
When I drag and drop instances of the tree symbol onto the background, the trees are stationary and do not scroll with the background.I do not want to have to implement code to make the trees scroll when the background does.I was wondering if there was a way to simply attach the trees to the background so that if the background moves, the trees move with it and appear to be part of the background as if they were drawn into it.It is convenient for me to be able to drag and drop as many trees as i need to block certain routes on the background from the player.I tried writing code to make the trees move but it was only working for the very last tree that I added to the scene.
View 8 Replies
Jun 28, 2004
I want to attach a sound to the main timeline (rollover sound) that i can call from on(rollover) button events. I will be attaching the same sound to several buttons.
View 1 Replies
Mar 15, 2008
I have been at this for about 19 hours straight! I am going to go to bed immediately after this post, but for crying out loud, I have NEVER had this problem before today! Before anyone reads ahead and says 'you have to attach your sound object to a completely separate mc to be able to control it independently from all other sound/root volumes.' see if the following code accomplishes just that:
[Code]...
View 2 Replies
Jun 28, 2004
I want to attach a sound to the main timeline (rollover sound) that i can call from on(rollover) button events. I will be attaching the same sound to several buttons.
View 1 Replies
Mar 20, 2010
how to attach background to caption
View 11 Replies
Apr 24, 2009
I am used to working in Flash MX but now have CS4. You use to be able to just drop an mp3 file onto a layer and it would loop continously now it's not doing that.I need help in a big way to loop this mp3 file in CS4.
View 3 Replies
Oct 22, 2009
I've been working with Actionscript 3.0 for over 6 months now but I've never used background music in any of my projects before. This time I decided to add a sound loop to play in the background while the visitor is viewing the site. So, basically I want this sound to loop over and over again, but there will be two buttons on the stage, one that plays it if it's stopped, and another one that stops it (just in case the visitor doesn't want to hear the music). My knowledge about using sounds is minimal, all I know that I should load the sound, then put it into a soundChannel and then play/stop the sound channel... but I'm not sure how to keep looping the sound and not just play it once (the sound file is 16 seconds long only).
View 6 Replies
Dec 26, 2008
I have a few frames presentation in flash and a music in background playing. I have a button and this code attached to it:
When I'm hitting the button music is restarting not stopping. Everything is fine when presentaion lasts 1 frame.
View 7 Replies
Jul 22, 2002
Well I have this website where I have put background music at the beginning, of course the music can be off and on, but when I come to main page again it starts playing. How to make it so that once I off it, it will stay off till I on it again? My file is at
View 2 Replies
May 3, 2003
how to write a code that play background music randomly?i write these in the frame
bgmusic = new Sound();
bgmusic.loadSound("1.mp3", true);
in the movie
[code]......
View 5 Replies
May 7, 2008
i'm trying to add background music in my game, but i don't know how to play and pause it...
View 3 Replies
Aug 5, 2010
I have a bit of a problem with sound.. I have a main container animation with background sound that's loaded with soundChannel..I also have an externally loaded SWFs with Movie Clip buttons that have a sound ON ROLLOVER on the timeline..after rolling off - I place the:SoundMixer.stopAll();to stop the button from playing the sound once the mouse is rolled off.. However, the problem I'm running into is that it also stops the sound of the main container movie cli
View 1 Replies
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
Feb 20, 2011
I have created a simple soundboard, with multiple buttons that play sounds upon release. These sounds are embedded within the 'hit' frames of the buttons. Only one can be played at once, so this has been applied to each button:
on (press){stopAllSounds ();}
This all works as planned so far. However, I would like to have a background music feature that would be exempt from the "stopAllSounds" command and thus able to keep playing regardless of what buttons were pressed (or until a designated stop button was pressed).
View 2 Replies
Jun 17, 2011
I am working on a website that has 11 sounds in one frame. All of the sounds are external, meaning I have to call each one of them every time I want them to play, which happens when I click on specific MCs in my stage. Each MC I click all sounds stop and the new one starts playing. So far, so good.
But therein lies the problem: I want this to happen but keep background music playing. I have no idea where to start from.
View 1 Replies
Apr 25, 2010
Is it possible to mask the background music in my flash website so it stops when I have my videos running?
View 5 Replies
Jul 18, 2010
I have made a corporate presentation in Flash (CS3). The structure is as follows. The main timeline just 6 key frames. 1 intro and 5 content. Each of the 6 key frames has a movie clip with relevant content on it.
After the introduction in key frame 1, the timeline stops at the next key frame.From here, one can navigate forward and backward between the 5 content key frames, using buttons.These buttons are available throughout these five key frames.
Each of the key frames contains a relevant movie clip, with content.And also a sound clip to introduce what that key frame contains. Since a user can navigate forward and backward at any point of time, all these keyframes have the frame action:
[Code]...
View 2 Replies
Apr 7, 2011
I have a flash game that I have videos between some, but not all questions.I would like to have background music that would play during the questions then mute, or turn off when the video is played, then turn back on when video is completed.If possible, but not required, a mute button could be created that would mute the music and would overide it turning back on as well.In other words the person takes the quiz, when the video plays it shuts off the music and starts it back up when video ends. And if possible, if they select to mute the music before the video plays it will not restart after the video completes.I did this in actionscript 2. The questions are on frames 1-50, the videos are on frames 100-110.I have it set up when a question is answered it goes to the video then back to the next frame for questions when it completes.
View 1 Replies
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
Aug 14, 2009
Ok, so I've tried a lot of different ways of loading background music in Flash, and now I'm wondering what the most efficient way of doing it really is.
I have my DocumentClass, and I have a MusicPlayer class. The MusicPlayer class controls the volume and mute function, as well as holding all the visible elements of the music player.
Where should I load the music initially? From the DocumentClass at the startup? Or in the MusicPlayer after the site has initially loaded? I want the music to start playing as soon as the initial loading process has finished.
View 3 Replies
Feb 7, 2010
I have background music playing by using this code:
Code:
var request:URLRequest = new URLRequest("loop.swf");
var loader:Loader = new Loader()
loader.load(request);
this works great for playing the music but I don't know how to have a pause and restart button for the music.
View 7 Replies