ActionScript 3.0 :: Get Sound Played From Stage Without Instance Name?
May 24, 2011
I have an MC with a lot of frames on stage and it has sound clips attached to each frame.
I need to stop the sound being played when I move on to another frame on runtime, thus, I need to access the sound object which has no instance name. Right now the sounds overlap since none of them stops and after a while all we hear is jibba jabba.
I have a flash header that was never completed because the guy I hired took people's money and ran. So now I even wonder if what he said could work with my flash header is true or not. But, usually there is always a way to make it work.
I have a flash header that does two important things: 1) Upon entering the site, it loads and plays an audio track 2) Makes an animal noise when you hover over each animal menu item. (not sure if I'm able to give a link to it or not on here. If I able to and someone would like to see it let me know)
I want to know if my flash header can support the following additional functionality/changes:
1) Currently, it loads everytime a page is selected. I only want it to load the one time of entering the site because the audio gets annoying. Set a cookie maybe?
2) But, I do not want to turn the audio off completely because I still want the hover over each menu item sound.
3) Have a link on it to allow them to select to turn on / off the sound completely. It currently has that, but only for the current page. Once you select another page, the audio is back to on.
4) Lastlly, is there a way for it to detect that someone doesn't support flash and to display an html version of it? And can flash create a html version from my fla file?
I don't know much about flash (but am learning) so I'm not sure if I'll be able to do this myself. However, I want to find out if my flash header will even work this way before I invest the time learning it just for these changes. I know it will be pretty deep with script code, but I'm hoping I could find base code already available for these features. Not sure I can afford help now because of being laid off and two different scammers taking advantage of me. So I'm going to try to do myself and see if there is any suggestions/support on here that can help. I have Flash CS4.
I have a flash header that was never completed because the guy I hired took people's money and ran. So now I even wonder if what he said could work with my flash header is true or not. But, usually there is always a way to make it work.I have a flash header that does two important things: 1) Upon entering the site, it loads and plays an audio track 2) Makes an animal noise when you hover over each animal menu item. I want to know if my flash header can support the following additional functionality/changes:
1) Currently, it loads everytime a page is selected. I only want it to load the one time of entering the site because the audio gets annoying. Set a cookie maybe?
2) But, I do not want to turn the audio off completely because I still want the hover over each menu item sound.
3) Have a link on it to allow them to select to turn on / off the sound completely. It currently has that, but only for the current page. Once you select another page, the audio is back to on.
4) Lastlly, is there a way for it to detect that someone doesn't support flash and to display an html version of it? And can flash create a html version from my fla file?
I don't know much about flash (but am learning) so I'm not sure if I'll be able to do this myself. However, I want to find out if my flash header will even work this way before I invest the time learning it just for these changes. I know it will be pretty deep with script code, but I'm hoping I could find base code already available for these features. Not sure I can afford help now because of being laid off and two different scammers taking advantage of me. So I'm going to try to do myself and see if there is any suggestions/support on here that can help. I have Flash CS4.
I have a flash header that was never completed because the guy I hired took people's money and ran. So now I even wonder if what he said could work with my flash header is true or not. But, usually there is always a way to make it work.I have a flash header that does two important things: 1) Upon entering the site, it loads and plays an audio track 2) Makes an animal noise when you hover over each animal menu item. (not sure if I'm able to give a link to it or not on here. If I able to and someone would like to see it let me know)I want to know if my flash header can support the following addionalunctionality/changes:1) Currently, it loads everytime a page is selected. I only want it to load the one time of entering the site because the audio gets annoying. Set a cookie maybe?2) But, I do not want to turn the audio off completely because I still want the hover over each menu item sound.
3) Have a link on it to allow them to select to turn on / off the sound completely. It currently has that, but only for the current page. Once you select another page, the audio is back to on.4) Lastlly, is there a way for it to detect that someone doesn't support flash and to display an html version of it? And can flash create a html version from my fla file?I don't know much about flash (but am learning) so I'm not sure if I'll be able to do this myself. However, I want to find out if my flash header will even work this way before I invest the time learning it just for these changes. I know it will be pretty deep with script code, but I'm hoping I could find base code already available for these features.
I have to play a sound file and show the progress of the sound file being played. I am using import flash.media.Sound; import flash.media.SoundChannel; But the PROGRESS event gives theprogress of loading of file. I want to know of much of the song has been played and how much more is left.
I have a multiple choice quiz that needs to have a sound played with each response. So if the user selects the correct response, they get the ding sound. If the user selects the incorrect answer they get a buzzer sound.
I'm creating kind of a pseudo RPG menu, and I just have the animation go to a different frame when you press an arrow key, backspace, or enter. I also have a couple of sound effects I wanted to play depending on what you press, but I am having no luck at all getting it to work, and everywhere I look online has very different instructions on how to go about it. Here's what I have just without any sound at all:
[Code]....
And then just different numbers based on what frame I'm on. As I said, I don't really know what I'm doing; a lot of this code was given to me. :/ So I know it's a lot to ask, but if I could get a very detailed explanation of what to do, If the sound could play before it switches frames, that would be best.
Problem is that the sound is played twice overlapping eachother (some of the mp3 is played first,interrupted, and then restarted again to finish fully).
I am trying to play a sound clip using actionscript 2 the code I am using is attached to a button and the code I used is the following.
[Code]...
My problem is that the sound clip loops and I do not want it to do so. I have other animations going on on the stage. I tried to place the stop(); command but I do not seem to be able to make it stop after my sound has played once.
I am just a rookie in Flash, and came across a problem. I'm trying to create a flash movie that will display time like a TV ident does. I've successfully set it up to get the correct time and play a "tik-tok" sound as each second passes. However, it is to have some background music, and I can't get it to start when I need it - for instance, if the time is 18:00:00 it should start at 00 seconds, it time is 18:00:21 it should start at 21 seconds etc. This is the script I used for ticking:
[Code]...
What should I use for the complex situation as described above? My only guess is that I should sync it to the frames in the background video (behind the clock, running at 24 FPS), but I haven't got a clue how to set that up as well. Can someone please help? If necessary I can upload the .fla file.
i am having some problems linking my mp3 player swf file to my website. It looks like it loads fine, and the buttons work and change the track of the song, but there is no sound heard or played. Here is the code i used to do this:
[CODE].....
As i said before, the player loads up and shows up on the website with no errorsand the buttons work (going to next or previous song as well as the pause and play buttons pausing and playing the music properly), but no sound can be heard. (this is being test on the latest version of firefox).
I'm using Flash 8 and I'm having an issue getting back to the main stage once a movie clip has played. I have my file set up with three movie clips on the main stage. One just plays which is the banner, there are two rollover buttons on that mc for panel1_mc and panel2_mc. When you rollover to view panel1 it plays fine, but inside I have another button to take you to panel 2. That wont work...this is what I have for code for the button inside the clip:
im wanting to create a simple feature in my flash ap that allows a user to select if they want voice overs played or the standard beep beep (fashy sounds) i have three buttons (onBtn, offBtn and rollMe). does anyone know how i could do somting like... if onBtn is selected then.. on rollover 'rollMe' mySound1.start(); else if offBtn is selected then... on rollover 'rollMe' mySound2.start();
I have some sounds in my library that I want to play in a soundchannel, but how? This is what I have so far:
var music:Sound = new Sound();var channel:SoundChannel = new SoundChannel();var sTransform:SoundTransform = new SoundTransform();var sound:SoundFile1 = new SoundFile1(); // Note: SoundFile1 is a class; in it is my soundfile in the library// music.load(sound); ??channel = music.play();
I'm using flash CS4. I am trying to make a piano. It will be the header of a web page when the mouse rolls over a key the appropriate note plays- ideally the key would appear to be pressed as well. I have a jpg of a piano keyboard imported as a graphic. On a new layer I have made a button whos over state has a blank keyframe. I have imported that button to the stage and given the instance a name. I have attached a sound to the over keyframe (middle C).
I have dropped a second instance of the button onto the stage and given it a unique name. When I attach the next sound (D pitch) to the over state it changes the original middle C. How can I get each instance of a button to play a unique sound? I have tried using a new layer for each button but that didnt work. Do I have to make a brand new button for each note? I have reduced my design to include only 16 notes (I originally wanted 32 but I thought that may take too long to download)---
Imagine this scenario:The application is a Game, where the enemy characters can 'attack' the player, and each time they attack the 'Attack.mp3 file is played from the libraryNow my question is, if I have to create a new instance of the MP3 file in the memory, each time playing it, or can i use a 'master' Sound instance ,that I can play multiple times simultaneously.(similarly I can use one 'enemy.jpg' bitmapdata, that I can then copy to the screen with copyPixels, and only having it in the memory just once )IE if i have 50 'Enemy' characters running around the game
I am getting a stack overflow error when attempting what I believe is a very simple task. I have a class that extends MovieClip and I attempt to add an instance to the stage. WorkSamples is the main class in my fla.
[Code]...
The Sample object does get added to the stage, although it doesn't honor the x & y position I specify. I'm sure I'm failing to comprehend something simple,
I have one MC on stage with instance name "box". That MC duplicates by using this script: Code: duplicateMovieClip (box, newname="box2", this.getNextHighestDepth()); box2._x = xPoz; box2._y = yPoz; So the new MC is now called "box2".
Inside original MC "box", I have one button. After click on that button, I need to know on which MC I clicked. box, or box2. I tried to use: Code: trace (this._name); But, that get me only instance name of the button.
I was just doing a menu system for a game project, as3 with Flash CS5. The navigation is build on the frame on the main timeline. When I was creating stuffs on the 3rd frame, the btns on the frame can not be called, returning "null", this is weird. With further study, I found that, if I delete a instance on frame 2, the problem on frame 3 will be solved. Then I found that giving the instance on frame 2 a name could also make things normal. What is happening? Why having a unnamed instanced on the previous frame could make the instances on the next frame "null"?
I'm using Flash CS5. I have some instances on my stage declared in the main class and I want to attach some events to them, however at the time of the main class constructor, these are declared as null.
What's the best practice for accessing stage instances? Is there an event listener I could add that will tell me when the stage instance properties have been populated?
Simple example:
public class bleepBloop extends MovieClip { public var productName:TLFTextField; public function bleepBloop() { trace( productName ); // Here it is null } }
However, when I access productName later, it's defined.
I created four instance of movieclip on stage and named them t1_mc,t2_mc,t3_mc,t4_mc. Then I made and array and loaded them inside the array
var arr1:Array = new Array( t1_mc, t2_mc, t3_mc, t4_mc ); var names:String; //function made to add event listener to each object function addListner():void { for ( var i:uint = 0; i < arr1.length; i++ ) [Code] .....
addEventListener(MouseEvent.CLICK, clickAction); function clickAction (e:MouseEvent):void {[code]....
for every click it will adds a new btn_mc instance on the stage..I wants to add the btn_mc instance to the stage at only once... How can I achieve this?