ActionScript 2.0 :: Playing Sound On Mouse Release?
Jun 12, 2003I'm having trouble getting buttons to play sounds when pressed. It works when I just have one button. However I have multiple buttons that need to play diff't sounds
View 1 RepliesI'm having trouble getting buttons to play sounds when pressed. It works when I just have one button. However I have multiple buttons that need to play diff't sounds
View 1 RepliesI have created a document 600x300 filled with buttons for a rollover effect. I want to be able to play sounds dependant on the x and y position of the mouse without having to use objects that interfere with the buttons.
View 2 RepliesThe flash site I'm working on has an underwater theme, and I think it would be neat to have it make sort of "whoosh" sound when the mouse moves fast, like the sound that comes from moving your hand through water, and I was wondering if there was a way for actionscript to know when the mouse moves quickly. It's not comepletely neccessary, just something that would be cool and add to the underwater feel of the thing.
View 1 RepliesI have a flash app loaded in an iframe. User mouses down in flash and goes outside of stage. When user goes outside of stage, is there a way to release the mouse capture from flash so that parent receives further mouse events and not the flash app?
In Firefox and Chrome, parent doesn't receive events until the user mouses up
In IE, parent receives event when the user goes outside of stage.
Right this is going to seem terribly easy to you lovely experts out there (yeah flattery gets you everywhere Hah).I'm doing a school project, basically a brochure for a company of my choice. Anyways, I want to make a really simple fade between the different options of text in my brochure.So really, I was thinking if I could have a symbol which would just be a black box which fades in, by using an Alpha key (so the stuff behind it disappears).How do I get a certain Movie Clip to play when you click a button? IN SHORTClick a button, and it moves to the next slide after playing a movie clip, called 'mc_fadeout'.
View 2 Repliesi have a sound playing (from the properties bar on the frame) and on the click of a button i want the music to stop anyway of this happening?
the reason i need this is coz the music is different from the next frame
I have a sound clip that I'm loading externally into my flash file. The code I'm using looks like this and is placed in the as layer on the first frame,
var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var myTransform = new SoundTransform();
var lastPosition:Number = 0;
mySound.load(new URLRequest("introaudio.mp3"));
myChannel = mySound.play();
[Code]....
I am creating a game that has 6 movieclips all on the main time line of the game. Each movie clip has three buttons that when clicked plays, pauses or stops a sound clip.When I press any of the sound clip play buttons that sound starts playing, the problem is when I click any of the other sound clip play buttons those sounds also start to play. Is there a way I can disable the other sound clip buttons while the current sound is playing then enable all of the buttons when the current sound has stopped.
This is the code that creates one of the sound objects
[Code]...
So I made a few buttons with sounds within them and when I publish it they work just fine. But what I want them to do is;
Say I click a Button.The sound starts playing.Then I click it again, before the sounds done playing.I want it to stop the playing sound and start playing the button I just clicked on, whether it be the same button, or a different one.Right now it just ends up sounds like an echo because it'll play it as many times as you click it.
I'm trying to play a sound using a technique found here (play the sound by sampling raw sound data gathered from the original with extract()), with the difference that the mp3 sound is embedded in the swf, not loaded externally. This is my code:
var soundBytes:ByteArray = new ByteArray();
var mp3sound:Sound = Sound(new Sound1_design()); // this is the embedded sound
mp3sound.extract(soundBytes, int.MAX_VALUE);
[Code]....
This works, in a way, except that the resulting sound is distorted (it has a kind of a metallic ring).
I am loading small sounds dynamically with the loadSound command. These small sounds are activated with a rollover. see script below. This works ok. however. i want the first sound to keep playing while the rollovers load sound. a bit like playing the piano. This works ok when i import all the sounds into the library and place them on their very own button. however the size of the flash movie increases to 140k. whereas when i load them dynamically the size of the movie is 20k. obviously i want to load dynamically.
But with dynamic loading each sound stops when another sound is rolled over, so that there is only ever one sound playing at once. I need to load the sound into a different level or something, so that the first sound can keep going while the smaller, shorter sounds play over the top. this is my script below. The first sound loads when the movie starts. This is the one i want to keep playing. Then there are the smaller ones with rollovers. does this make any sense? there's actually 13 little sounds.
[Code]...
ok so i have a button that plays an animation for fire when held down. and when realsed goes to and stops and frame one. when it reaches the end of the time line it goes to and plays at frame 10 and goes back to the end of the timeline. I have a sound for the fire animation that plays for the effect. The problem is the sound keeps going untill its over even if the button isnt held down. and when the playhead reaches the end of the timeline it goes to and plays and frame 10 and it replays the sound. if i hold it down it will just keep playing the sound over and over from start to finish. what i want it to do it when i hold the button down i want it to play the sound and when released it stops the sound where ever it is at. I also dont the sound to play again if there is a sound already going to stop it from playing 20 sounds at one time it gets loud and you need asprin after about 5 seconds of that.
View 2 RepliesThe thing I don't understand is how to assign a sound to a soundchannel without playing the sound. All the examples I've seen do this.
Code:
_SoundChannel = _sound.play();
_SoundChannel.stop();
And how can I set a SoundChannel volume to zero before allocating a sound to it?
I want to do something very similar to the resizing effect on this website.
[URL]
Basically if you resize the browser, it seems like it's programmed to only display/load/transition in the images once the user lets go of the mouse and the browser is done moving.
I would like to know if there is a Resize on mouse release event or a work around to do this. Currently my images keep refreshing every time you drag/resize the browser screen, before you let go of the mouse.
So basically while your dragging the browser window size to different size it keeps reloading and updating the images. I want it to reload and update the images once the user is done dragging and resizing the browser.
when i draw anything using any tool on a layer it disappears as soon as i release the mouse button, then when i click the timeline it reappears again but when you are drawing having your image not on the screen makes it kind of impossible do draw anything I saw another guy with a similar problem who made this video [URL] I tried reinstalling the software ( im using the demo) whats going on? I was hoping to get to play around abit before my trial ended
View 2 RepliesI'm struggling to get the mouse to release an object while in runtime...If I select the object to drag, and then drag it to the end of my stage without releasing, then go off the stage with my mouse and resize the window (x co-ords), the object seems to have an increment to the stage size, so hence when my mouse returns to the stage, the object is not "under" the mouse cursor anymore, which means it never registers the onRelease command given?
Is there a way that I can force a release on objects using AS2.0 code with another button, like a reset button?I have created the reset button, and it sends the object back to it's original place (where I picked it up), but it still has the same issue. (because the reset button is not near the point of pick up.) So... Forced "onRelease" was my solution, I just can't figure out how to do it...
how modificate this script from mouse click to release
package
{
/*
* A Colorful Fireworks Demonstration in Actionscript 3
[Code]...
Currently, I'm developing a drag 'n' drop 'snap' game in flash. The meaning of this game is to drag ''crates'' from a boat and load the crates into a train.
What I got working in AS2:
- The crane arm follows the mouse cursor.
- It can drag and snap objects(crates)
But what still need to works is:
- When mouse button on object is released, the object (crate) is still floating in the air. When released mouse button, the object must fall down. (gravity)
I'm quite comfortable with hiding the mouse cursor and putting a movie clip in it's place - although the trouble starts when I try to tell it to load another movie when the mouse is clicked - then once realeased going back to the original movie clip !I have attached a FLA i've been working with - this is what i'm aiming for without the hotspot_mc - I would like the mouse to work the same across the whole page and be able to click on buttons etc, like a normal mouse click would !
View 2 RepliesI'm making a custom slider component. The head (the thing that you drag) is programmed like this:
head.addEventListener(MouseEvent.MOUSE_DOWN, function():void {
head.startDrag(false, new Rectangle(stubDiv,0,width - stubDiv - ((levels-maxLevel)*stubDiv),0));
[code]......
I have a button that is called to the stage using AS. When the user releases that button, a global variable is populated and the pageShell movie clip is removed and re-attached using the new variable info. When I run the movie, I get the following in the output panel: **Error** Mouse events are permitted only for button instances on (release:<name>){ I'm not sure why this is happening because the symbol being used (<idname>) is a button.
[Code]....
I have three buttons on screen that navigate to different places on the timeline. I have set them all up as buttons using a generic button in the library and then given them all different instance names. I selected the button and changed the text colour for each state in the timeline (up, over, down) to keep it simple. The buttons are all, as far as I can analyse, identical in all but instance name.
When I test the movie, the first button changes text colour on 'over' and, when I click (i.e. down state) the colour changes again as designed. The navigation action doesn't occur until I release the mouse button, giving the feel of having 'clicked' the button.
With the other two buttons, which have been set up as far as I can tell in exactly the same way, when the down state occurs, I see a momentary flash of the text colour change and it performs the nav straight away. I really want it to perform the same way as the first button but cannot for the life of me see why they're behaving differently.
I use Flash MX 6.0
1) I have a button and when I put cursor over it, it must start looping a sound. When I drag away, the sound must stop. I would be even cooler if it was possible to make the sound fade away when the mouse is rolled away. I have no problem creating another sound file that fades my current sound away.
2) I have a button which represents a knife, that should stab something (a panel) once pressed. So fist the knife must be clean. but after one or more presses, the blood should remain as a movie clip (as I want to animate the dripping blood)
3) once rolled over a button, the sound must start looping (as I wrote in 1.) AND the knife should slowly go backwards (MC). BUT when I roll mouse away, the sound fades away (as in 1. again) PLUS the knife should slowly move back to its place in stead of just jump from one place to another.
The other is a scrub that manipulates a MovieClip, but tracks a change in mouse position from click to release, instead of tracking the changes in position of a slider playhead. But here is the download for that one:(sorry not a link due to not having over 50 posts yet, you will need to copy and paste)I have found plenty of AS1+2 ways of doing this idea, yet just haven't found any solid AS3 versions.I am currently in a class to learn Actionscript and have tried to figure out this problem yet I am just not yet to that level.
View 0 RepliesI am trying to find a way to make a movie clip resize larger on mouse release, then resize back to the original size on a second mouse release. I have tried many ways to do this but seem to be unable to come up with a solution. I have been using mc Tween.
[Code]...
I am trying to embed some sound controls, and have hit a dead end. I made my play and stop buttons, imported my mp3,, assigned it proper linkage, and inserted this AS2 :
[Code]...
The buttons are named "play_btn" and "stop_btn" respectively. When I export it or preview it, hitting the play button does not do anything.... I hear no sound. What could be up with this?
Underlined Text On (rollOver) Is there an action script to do on (rollover) underline text? It would be on a button that would also, on (release) gotoAndPlay a frame. I know you can have a movie with AS like this:
[Code]....
But when I add the on (release) to the movie it doesnt advance the timeline on (release). And when I change the file to a button instead of a movie clip it doesnt do the underline on (rollOver).
I have been trying to code this so that when my mouse rolls over the invisible button, an external mp3 file ("roundandround.mp3") will play.....and once the mouse goes out of the invisible button hit area, the song will stop playing. I have the below so far, but it isn't working---nothing plays when I roll over the button. I understand you can just drag and drop the sound file into the "over" frame of the button, but if you do that, how do you stop the song from playing when your mouse goes outside of the button?
var mySoundReq: URLRequest = new URLRequest("tv-static-04.mp3");
var mySound:Sound = new Sound();
var mySoundChannel:SoundChannel=new SoundChannel();
[Code].....
Im making an animation and in the 3rd scene i have a deer that screams and the sound plays way to early. I had to drag it out way past the frame where it opens its mouth for it to play at the right time.
I have no idea whats wrong this has happened before. I really dont want to have to guess on where to put the sound for everything a character says.
Back to my nightmare project, I've embedded sounds in the project that play based on certain user actions. They play fine for me (PC), but my customer is telling me they don't work for her (Mac).Would there be ANY reason a sound would play on a PC but not a Mac?I've told her to update her Flash player to make sure it's current and to make sure her speakers are on and the volume is up, but no sound.Okay, the REAL reason this isn't working is user error based on everything else I'm told that's happening and not happening, but I need to cover my bases and see if there really may be a reason sounds won't play on a Mac.
View 3 Replies