ActionScript 3.0 :: Possible To Combine Two Sound Objects?
Nov 25, 2011
Is it possible to take two Sound objects and combine them into one Sound object so that one Sound plays, and then the second plays right after it? I can just play the first Sound and then the next right after it, but it would be much cleaner to combine them before playing the audio.
Is it possible to take two Sound objects and combine them into one Sound object so that one Sound plays, and then the second plays right after it? I can just play the first Sound and then the next right after it, but it would be much cleaner to combine them before playing the audio.
I have 2 dynamic objects and I want to build one to contain all the properties:[code]and I need to obtain a third object that looks like that {prop1: val1, prop2:val2, prop3:val3a, prop4:val4};Basically I need a way to iterate through the object properties and to add new properties to the third object. I have to mention I'm quite new to AS3/Flash/Flex.
I have two BitmapData objects with alpha channels. I'd like to combine them into a single one by using max(channel_image_one, channel_image_two) for each channel, including the alpha. Is there an easy way to achieve this result?
i built and application that load multiple sound files play it in a sequence as the user order them but i wonder is there a way to save this sequence into one mp3 or wav file
The following code is a combination of samples taken from red5. Basically I am trying to combine a live stream subscriber with a chat box based on shared objects. I'm not a flash developer and have a very limited understanding of what is going on here.
I don't think that var chat is being initialized anywhere as trace(chat) prints 'undefined'. However var connector and var publish_video seem to collect their instances from the stage.
This sample code included those two and worked fine, but I can't make my additions behave the same way.
I have added an instance of BasicChat to the stage (I'm using Flash CS4) and have spent the past many hours playing with it's various properties, layers and groupings, but to no avail. why my var chat isn't collecting its instance from the stage?
I'm doing a project that I have to use scenes in, I have a sound object that i want to be able to control in all scenes. I set up global variables for the sound object and a boolean to check if the sounds currently playing like this : PHP Code: _global.sound1= new Sound(); _global.sound1.attachSound("song"); _global.soundplaying = 0;
In each scene I have two buttons a stop and a play button, Heres my code for play: PHP Code: if(!_global.soundplaying){ _global.sound1.start(); _global.soundplaying = 1; }
And stop: PHP Code: _global.stewielaugh.stop(); _global.soundplaying = 0; Doesn't seem to work, if I press play in scene one and go to scene 2 and then return to scene one the sound can be played again on top of the already playing sound object.
I have some sounds in movie clips, this is because that is the only way to be able to select SYNC Stream mode (to keep the movie in sync with the narration). Thus I don't want to use Sound Objects because they can get out of sync...
Is there any way to control volume (so I can mute) with out using Sound Objects ?
I have 4 buttons. Each are a movie clip that has 2 frames (the down and over).the rollover has a click sound to it. Is it worth my while to do that with AS? or just put it up in the timeline (the sound)
I came accross this very comprehensive webpage about sound objects in flash mx about a month ago. Since there has been 2 or 3 threads started about working with sound just today, thought i'd share it [URL]..
I have a main application that plays two different sounds, a background music and a SFX. I have added a button that, when pressed, loads another swf called options.swf onto a higher level. This swf contains two volume sliders for each of these sounds so that I can control their volumes. Each volume slider is an instance of a movie clip I have created which contains a sound object called 'activeSound.' On options.swf I have the following code:
[Code]...
My problem however is that when I slide either slider both music and SFX get affected. They are supposed to act independently but they don't. I've had this problem before with sound objects and I don't know a solution to it.
Part of a larger presentation I've made, there is some background music. What happens is an XML file is read to get a file to play. It plays. When it finishes, it reads the XML again to get the new file. It can also stop when a video plays elsewhere in the presentation then I pick it up where it left off and start the process again. Trouble is, the presentation randomly stops. The music stops and the slides in the presentation stop. The music and slides come from a single XML file. There's also a third part of the presentation (a text crawler) that never stops.
This comes from a totally separate XML file. I never get an error, the presentation just stops on a slide and no more music plays, but the crawler keeps crawling. I've removed all the code for the music and it runs perfectly so it's obviously related to how the music is managed. So, finally, my question is how do I manage sound objects? If I need to create new objects for each sound I load and play, I'll need to do manage the sound from a single function, right? Something like:
Code: function whatever():void { if song is not loaded { read xml, load and play song; } else if video is playing { pause the song; } else if video has stopped playing { resume song; }}
i have a problem manipulating multiple sound objects in MX. i have a main background loop object and a button rollover object (which plays on specific buttons). i then have a volume slider which will set the volume of only the main bg loop object. but when i tested it, it seems that the volume of the button rollover object is also the same with the main bg loop object's volume. meaning, if my main bg loop's volume is down to 50, the button rollover sound volume is also 50.
here're my codes:
//code on 1st frame mainLoop = new Sound(); mainLoop.attachSound("mainLoop"); mainLoop.start(); mainLoop.onSoundComplete = function(){ mainLoop.start(); }
hoverSound = new Sound(); hoverSound.attachSound("hoverSound");
//code on slider MC onClipEvent(enterFrame){ if(drag){ _root.mainLoop.setVolume(this._x); //this._x is between 0-100 } }
//code on sample button on(rollOver){ hoverSound.start(); }
I have some sounds in movie clips, this is because that is the only way to be able to select SYNC Stream mode (to keep the movie in sync with the narration). Thus I don't want to use Sound Objects because they can get out of sync... Is there any way to control volume (so I can mute) without using Sound Objects?
i have a problem manipulating multiple sound objects in MX. i have a main background loop object and a button rollover object (which plays on specific buttons). i then have a volume slider which will set the volume of only the main bg loop object. but when i tested it, it seems that the volume of the button rollover object is also the same with the main bg loop object's volume. meaning, if my main bg loop's volume is down to 50, the button rollover sound volume is also 50.
here're my codes: //code on 1st frame mainLoop = new Sound(); mainLoop.attachSound("mainLoop");
i'm making a game with tanks at the moment, and there will be explosions happening from side to side on the screen. i was thinking that it would be good to pan the sounds, so explosions on the right of the stage would play on the right speaker etc.
i tried to do this by creating new sound objects for each explosion and then setting the pan for each, individually, but it seems that when i set the pan for one sound object, it sets that for all of them. is there a way around is?
I have several flash games and quizzes that I now want to put together as a collection on a CD ROM as a bumper pack to buy. I wasn't sure of the best way to do that but I figured that I can create a flash file with individuals buttons on that when pressed loads that SWF's into the main page and plays which I'll export as a standalone player.
Sound good that's just what I wanted, only problem now is that the sound objects that are in the various games no longer play What do I need to do so that they will play as they do when I play each SWF on their own? (Hopefully without too much re-programming of the original games as there are quite a few)
I'm working in ActionScript 2. I have a series of swfs with Sound objects. Works just fine when I play the swf. However, when I load them into a loader, no sound.
I have a griddle_mc, bacon_mc, and BaconCooking.wav. I want to play the wav when the bacon is moved onto the griddle. If I move the bacon until it just touches the griddle the wav plays fine, but if I continue to drag the bacon_mc across the griddle the wav becomes loud and distorted, almost like it's playing multiple instances of the wav at the same time.
private function __handleSliceDown($evt:MouseEvent):void { slice1_mc.startDrag(true); }
I am having problems controlling my sound objects. When the user clicks on a mc on the stage a sound (voice over) starts to play. But if she decides to listen to another sound, she can click on another movie clip...Problem is that when the user clicks on the second movie clip the first sound is still playing while sound number two starts playing as well. I would like the second sound object to replace the first...shouldn't this be possible by using the mySound.stop(); before initiating the new sound object.
Here is part of my code:
Movie Clip one:
on (press) { mySound=new Sound(this) mySound.attachSound("voice_one") mySound.start(0,1);
I'm working in ActionScript 2. I have a series of swfs with Sound objects. Works just fine when I play the swf. However, when I load them into a loader, no sound.
I have been trying to deal with sound attachment. Attached is the source file that i am dealing with(I deleted the sound files because the size is too big): Simply, i have to click on the objects first before clicking on the play button. Each objects i clicked represents a different sound and will be stored in the array. So i will be clicking the objects in sequence and when i click on the play button, the music will play. Now comes the problem with my coding, I was unable to let my music coming out one by one at the time in sequence.
If you wanted to create a client-side Flash-based sound editor that lets you load more than 1 sound to an interface that allows you to manipulate the individual positions of the sounds, and mix/play them in real time, how would you accomplish this?
I'm looking to create a simple version that can mix 2 mp3s, allowing the user to adjust the positions of each. Sort of a dumbed down version of Aviary's Myna audio editor.
At the end of the mixing, I would also like our server to mix the 2 mp3 files with the proper positioning into 1 mp3 file...
I've been messing with this for almost six hours now and am at the end of my wits. I need a flash mp3 player that follows the following guidelines:
*all encased within its own movie clip *loads four different songs, one after the other (event) *each song displays its own loader *user scrolls through song selection and plays available (loaded) ones *first song plays when loaded and continues to the others
any tips on where to go with this? do I create four different sound objects since later songs are loading while the first are playing?
I am triggering short sounds dynamically from the library for a game (Specifically Air for Android). When the user clicks a button the sound can take up to 600ms to actually play. I have set it for any silence before the actual sound by calling the sound like so:
[Code]...
All return the same results. I know there are threads here that talk about this but none have offered a real solution that I can find. Is there no way to cache the sound or store it in a buffer?