ActionScript 3.0 :: Play An MP3 When You Click A Button?
Nov 25, 2010
I want to be able to play a mp3 when the user clicks the button.
I am a true newbie, and I saw another post explaining it, but I didn't get it. I tried but it went to a error 1046! [code]...
View 2 Replies
Similar Posts:
Jun 21, 2010
I am building a flash interface and I would like a menu where it is hidden to begin with (just a tab). You click the tab to expand it, and click again to collapse it. I've made a movieclip with animation of the menu opening up and closing, but I can't seem to work out how I'd go about making the movieclip open and close properly.
View 4 Replies
Nov 12, 2009
I have a test button i would like to have play a movie where a graphic expands. Once stopped, I would like to be able to click that same button and have the graphic go backwards. I would prefer to have timeline reverse, rather than lengthen the timeline of the mc because then i have to line up the start and end, and if one changes, i have to remember to change the other.
btn_test.onRelease = function(){ if (_root.adinstance._currentframe != 1) { while(_root.adinstance._currentframe != 1) { _root.adinstance.prevFrame(); else { _root.adinstance.play(); }}
[code].....
View 3 Replies
Jan 18, 2010
So what I have is this: 1 frame with stop(); action and 1 button. To the button I added the action on (release){ gotoAndPlay(2);} so that it plays frame 2. Frame 2 through 6 is a simple motion tween, with the stop action at the end. Yet, when I click the button it takes me to frame 2, but the motion tween doesn't play.
View 1 Replies
Feb 21, 2011
how to play a movieclip on button click in actionscript 2.0.
View 3 Replies
Feb 21, 2011
I am having (1st)one moviclip, on above that layer i have applied button to it such that as moviclip goes button will also move wit movieclip. so whenever we click on that movieclip i.e on 1st movieclip, on that click i want to play a another movieclip which is kept below that movieclip layer.
View 1 Replies
Sep 11, 2006
I want to play a sound on click of a button. I can do this in AS 2.0
//Action Script 2.0
Code:
snd=new Sound();
snd.attachSound("try");
snd.start();
[Code].....
View 11 Replies
May 29, 2002
How can I have an MC play at different speeds upon a button click. For example, I want button one to play the MC "cars" at one speed, and button two to play the same MC (cars) at another speed?
View 4 Replies
Apr 17, 2011
i want to gotoAndPlay more than one sound Ex: when i click the button i want to play frame label m2 and frame labe m1 sound
playy.addEventListener(MouseEvent.CLICK ,pl);
function pl(event:MouseEvent):void
{
so.gotoAndPlay("m2");
so.gotoAndPlay("m1");
}
the sound play in the same time i want to finsh play frame label m2 then stop then play frame labe m1 and stop.
View 3 Replies
May 1, 2009
Using Macromedia Flash Professional 8.
I have a website banner made in Flash. I have added a music file to it and Play and Stop buttons. I also have a Replay button to replay the banner animation once it stops.
I have put the music on a separate frame so that it will not play automatically when the banner loads. I have made the Play button direct to the frame the music is located at so that when clicked, it will go to that frame and play the music file.
The problem I am currently having is that if I click the Play button more than once, it will play the music file again on top of the current play-through.
So if I click Play, the music will play. Then if I click it again, the music will play again, but on top of the first instance of the music, so two instances of it will now be playing and it sounds horrible.
I would like to make it so that if you click Play when the music is playing, it will not play the music again until the music has stopped.
View 6 Replies
Apr 8, 2010
I have been using flash for a while, but AS3 is a whole new world to me.
I simply want to have a movie (box1) to play when a button (btn1) is clicked.
NOTE: The button is within a movie clip (bulb1) which is within another movie clip (trees).
I tried this, but it just kept replaying the whole animation:
Code:
btn1.addEventListener (MouseEvent.CLICK, onClick);
function onClick( event:MouseEvent):void
{
box1.play();
}
View 15 Replies
Apr 23, 2010
Actionscript 3 ---- Looking to have a movie clip and 2 buttons. Click the right button to make the movie clip go to the right, left button to make it go left (play backwards in the timeline) Currently the movie clip is set up as a 90 frame animation that moves across the stage on a motion tween. The right button just makes the movie clip play, so I'm looking to make my left button play that timeline in reverse. I've found lots of examples for AS2 online, but none for AS3......
View 4 Replies
Jun 25, 2010
is there a way to remove those buttons that are found when we right-click while the SWF file is running? those buttons such as 'play','loop',etc thx
View 2 Replies
Dec 7, 2010
I am working on a project that I have three movie clips animate onto the stage.I then have 3 buttons come up correlating with each movie clip.How do I script the buttons to play the movie clips?The movie clips are embeded FLV files just fyi.
View 4 Replies
Dec 31, 2009
i have 3 file. the first is quiz.as that contain two button. play and invite friend.quiz.fla. and quizapp.***. when i click play button i want to show the quiz that store in quizapp.as. int the quiz.as i have the mouse event that call quiapp.but when i run i got an error:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at QuizApp/createButtons() at QuizApp() at Quiz/playQuiz()
in createButtons(), i create three button next,prev and finish. whereas, in my quiz.fla library i have drag the button into my library but the error show nuul object reference for the button that i have created.
View 1 Replies
Sep 16, 2011
I working on the timeline and have some Actionscript 3 code (I have a actions layer on the timeline). I am not sure what the code is for clicking on a button(I made the buttons movie clips since I wanted to animate it) and it plays a movie clip.
View 2 Replies
Dec 21, 2010
What's I'm looking at doing is making a button that plays 1-20 different sounds at random each time the button is clicked (hit), and also have an image swap when that happens. A different sound and different image (the same 1 image per sound, not random images, just sounds "image1 goes with sound1").
View 1 Replies
Jul 23, 2009
I'm looking to have a movie clip pop up, play itself after a user clicks on a flash navigation button.
(something like this???)
message_btn.addEventListener(MouseEvent.CLICK, goMessage1);
function goMessage1(evt:MouseEvent):void{ ???(play message movie clip here)???;}
View 3 Replies
Feb 14, 2011
My Original Post:I have been designing a visual presentation in Flash CS5, there are a few movie clips on the stage that are set to play at a certain time/frame. The problem I am having is that I am not familiar with coding/actions. I want to have a play and a pause button so I can pause at any point (not a specified frame) and discuss with the audience. Then I want to be able to click the play button to resume from that point (wherever I paused from). I hope to get help and be able to learn from your answers. I don't know how clear my question is, but I can clarify if you need me to... A Reply:you can stop/play any movieclip by using the movieclip's reference:
[Code]...
View 1 Replies
May 26, 2011
I have three buttons, which starts three separate videos...click on button starts video, that's ok, but then video is not over, if to click again,it's not starts video from beginning. I'm talking about one video. I must push on other button and then on that again to start it from beginning.
ActionScript Code:
import flash.events.MouseEvent;
import fl.video.FLVPlayback;
vidPlayer.stop();
Object(this).1btn.addEventListener(MouseEvent.CLICK, button1);
function button1 (e:MouseEvent):void{
[Code] .....
View 0 Replies
Apr 17, 2004
I have a movie with 4 or 5 scenes. How can i make the movie jump from scene 1 to another scene by clicking on a button?
View 5 Replies
Oct 5, 2004
i have a button on the stage...when clicked i want it to wait 2 seconds, then gotoandplay a porton of another movieclip.
View 4 Replies
Oct 5, 2004
i have a button on the stage...when clicked i want it to wait 2 seconds, then gotoandplay a porton of another movieclip
View 4 Replies
Mar 2, 2010
I am trying to connect audio to the button so when I click on the button music it starts playing and when clicked again music stops.
View 5 Replies
Jul 18, 2006
All works fine untill I do something to the loaded swf.For example if I click a button on the loaded swf the button works but then when I click the button on the main movie to load the next and play the transition the transistion doesnt work.If I dont do anything to the loaded swf the transitions work.Is it something to do with the paths being changed when the loaded swf is acivated?
View 2 Replies
Sep 21, 2006
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.
View 10 Replies
Dec 2, 2010
I have a button (bttn1) which when clicked plays a movieclip (bounce), but I would like it to play from frame 1 then stop on a desired frame(say frame 10), so when a second button is clicked (bttn2) it plays from frame 10.
View 7 Replies
May 12, 2010
Lets say i have a button on frame 1. And if you press it normal, you ll get to frame 2. But then if you click it on another way, you ll get to frame 3. How do i do that easy?! With another way i mean like shift click or ctrl click or is it an easier way?
View 3 Replies
Jul 27, 2009
I have a movieclip playing and when I click a certain button I want the movieclip to first play an "outro" animation (which is also inside the movieclip) then go to the real target of the button. For example, I am at the Homepage of my website then I click on the Contact button. The homepage will first go to Homepage's outro animation then go to the Contact page. I need the button to recognize the page/clip being played and the page it will go to.
View 1 Replies
Jan 25, 2011
I've been searching around the internet for a while to store a click counter within a flash video. Basically count how many times a video was actually viewed instead of the page being loaded.I have a few restrictions.I cannot use a server side language.I cannot use a database.(I want to use a text file stored on the server)
View 2 Replies