ActionScript 3.0 :: Create Multiple Sound Variables Using It?
Mar 30, 2011
My issue is that I have 10 small audio clips and I want to make them into variables that i can access later in the code. But I'd be happy if I didn't have to write the same code 10 times down over and over to create/access them.[code]...
A question on the side, is there any built in sound generator in actionssccript 3.0?
I am using attachSound to attach multiple sound through the library into different variables. But when I try to use setVolume, I get the same volume for all the sounds playing at that time.
I am using actionscript 2.0 and I am trying to create multiple sound buttons that trigger multiple different .mp3 files via mouse click.I have gotten it to work with one sound file using this actionscript [code]but as soon as I add another button and try to link it to another file it does not work.I would like to make it so that even if I click another button to start another sound, the first sound keeps playing.
It's possible to play a sound file through AS, either by loading it from a folder or import it to flash. It's also possible to play a dynamic tone with flash.media.Sound + writeFloat.
But... is it possible to play a sound file with flash.media.Sound + writeFloat in some way? I want to play a sound file without having to deal with any files except the .swf!
Is there any way I can have multiple sound buttons that works as stop buttons for each other? I mean.. I now got 3 buttons that start 3 different songs, but they overlap each other when I press more than one. I'd like Song 1 to stop when I press Song 2 or 3. And vice versa
I'm having issues with controlling multiple sound volumes in flash. What I need to have happen is a Background music softly playing while a voice over is also playing.
This is what i have in the first frame of my main timeline
Code: firstSound = new Sound(BGMusic_mc); firstSound.attachSound("LatinRockMusic"); firstSound.setVolume(10);
[Code]...
but when it starts to play the voice sound the volume jumps up to 100. I need the first sound to stay at 10 and the voice sound to be at 100.
I'm trying to declare a few variables in a for statement using the variable in the for statement. In older flash versions I would use something like this.
Code: for(a=0;a<10;a++) { _root["variable"+a] = "Some text "+a;
I want to declare on multiple numerated variables like this:
var myVar1; var myVar2;
But I don't want to do this manually for every variable instance but automatically, so I need a way to instruct the compiler to declare by himself on every variable and to numerate them automatically.
So hopefully I explained myself well, I wanted to know if there is such way to do this?
Currently I have a simple setup which sends some data to PHP and then PHP returns a variable to flash. I have no problem tracing out the returned variable in Flash, however i'm strugling to send back more than one variable.[code]If I remove the trace and echo for fromPHP2, it's all good, however with with my second echo for fromPHP2 it just gives me back undefined:[code]It seems that fromPHP1 is basically returning both echo's.
i can trace out 'levelNum' and it traces out fine. i can trace out 'questionNum[currentQuestionNum]' and it traces out fine.basically without any variables my object array would look like this:
lvl(1 or 2)Questions[(a # here)].correctAnswer.
But my trace is not working and i'm not sure how to group that all together.
I got a problem with URLVariablesprobably better to show by example
Code: for each(var foo:String in fooArray){ variables.foo = foo; }
this unfortunately doesn't work as intended as the old foo variable in the URLVariables get overridden each time.Thus when I output the variables as suchTried looking around the net for it but couldn't find anything. Also it seems logical enough that the variable gets overridden and I wouldn't really question it if it wasn't that ive been told the querystring should contain multiple definitions of the foo variable...
I am using the Kirupa email form to gather some results on a form...How can I load variables from 2 different movieclips to post in the php? I tried...
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.
I am trying to put a few songs on a website, not as an .mp3 player, I just want to be able to assign individual buttons to control them.ow, and it works great. I would like to now how to add more and assign them to their own buttons seperate from the other songs.This is the code I have for one song
var url:String = "";var urlRequest:URLRequest = new URLRequest(url);var sound:Sound = new Sound();sound.load(urlRequest);var sc:SoundChannelvar startTime:uint=0; playBtn.addEventListener(MouseEvent.CLICK,playF);stopBtn.addEventListener(MouseEvent.CLICK,s
I'm having trouble with sound in Flash. I may have went about coding the wrong way, because most of my codes are on frames.
So, I have these two variables
var outsideDay:Sound = new daysong(); var outsideNight:Sound = new nightsong();
And I want to play these songs on a specific frame. However, the sounds play sporadically, like 50 times at once. I think it's because I have other codes that link to the frames with a Enter_Frame function. How can I get the sounds to loop and not play multiple times at once?
is it possible to have multiple SoundChannels? And have a volume control control multiple volumes?
i have a site that uses .flv's with sound all throughout. Volume control is attached to a sound transform that affects the stream. I also added a piece of code to this function that creates a new soundtransformation object, adds it to a soundfactory object i have in a private var and adjusts that volume by 40% of the .flv's volume. This seems like it should work - but doesn't so i am wondering two things. a) can i have multiple sound channels (in this case the stream and the channel i made for bkg music) b) if i can why do my sound transformations not get implemented on this music track. I also tried to explcitly set the music volume to 0.4 via a sound transform right after i load it - which does not work either.
heres the code
ActionScript Code: trace("current vol is :" + currentVolume + " And 40% of that is: " + (currentVolume * 0.4)); var st:SoundTransform = new SoundTransform(currentVolume, 0); stream.soundTransform = st;
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 a site where as you click links, you move forwards through a city. I want to fade sound files in and out, overlapping, depending on where you are in the city.As yet, I can't have two sounds playing at once.I have found a site with the effect I want, it's atI have two sound loops at the moment, one of cicadas, one of a city at night, both saved as separate .swf files, which I have loaded onto the main timeline on layers 14 and 15. The code for the two loops is:cicadas.swf, FRAME 1
var volPercent = 20; cicadas = new Sound(cicadas); cicadas.setVolume(volPercent*2);