ActionScript 2.0 :: How To Play On Click
Sep 27, 2010So I got my animation ready, now I just want to export it as Flash movie, and make it play on click. How do I do this
View 7 RepliesSo I got my animation ready, now I just want to export it as Flash movie, and make it play on click. How do I do this
View 7 RepliesI 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 RepliesI 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].....
I'm having some problems with the code below. It may be something small that I am just not seeing. I basically have a drop down window and a button named btn1. The first click makes it pull down on the main stage, the second returns it to frame #1 by rewinding the movie. Well... It only works once, I need it to work multiple times, so I am missing something.
ActionScript Code:
on (release){
if (this._currentframe == 1) {
this.play();
[Code]...
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.
I just want to play and stop my movie on a key click.I don't want to have the drop menu open and have the user click 'play'. Isn't there some way they can just press any key and the animation will progress forward?
View 4 RepliesI have included the following code to disable the "right click-play" by the players to jump the scenes.
Code:
MENU = new ContextMenu();
MENU.hideBuiltInItems();
However, this code is not functioning.
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]...
I got my animation ready, now I just want to export it as Flash movie, and make it play on click. How do I do this?
View 2 Repliesi am trying to develop a small interactive game using as3.i need to play a movieclip when i 'll click on button. Anybody knows simple way for that.I'm trying this way: i have created a class for that movieclip, then i have created a object of that and then i m tring to call that object in this way.
var geese:geese01=new geese01();
trace("object created");
geese1.addEventListener(MouseEvent.CLICK, onPlayClick);
[code]....
how do i play a sound on press?
View 3 RepliesI need to add ac2 to a movie clip. When the movie clip is clicked on I want it to play and when it is clicked again that it will stop. This is the code that I have on the button already -
onClipEvent(enterFrame) {
this._rotation += 5}
I'm a beginner in flash actionscript. I want to basically swap images using actionscript. So if you click on a thumbnail, the main big image will change corresponding to the thumbnail being clicked. I don't want to use a simple on click go to and play actionscript... I'll try to paint a picture of what I'm trying to achieve.
There is a background image, middle ground and foreground image... people will have a selection of thumbnails to chose from to change these images (so they are creating their own big picture) Once the user clicks on a thumbnail for the background, the main image will change corresponding to the thumbnail.. and the same for middleground image and foreground image. I can acheive this in director using lingo but I am required to use flash and actionscript.
The sound only plays when I hold the mouse button down. I need it to play when I click it. But it has to stop the sound from playing twice import flash.media.SoundMixer; this.addEventListener(MouseEvent.MOUSE_UP,f); function f(e:Event):void{ SoundMixer.stopAll(); } here is a link to my swf file [URL]
View 4 RepliesI've been looking for this for years, and a good friend of mine that is a master at AS3 is not well versed in AS2, so I thought I'd ask the pros here.onClipEvent(mouseUp) on(release)I have code like these two examples on a mc (sometimes a button, I only use buttons in AS2) on the root timeline. Usually I use a mouse-click to activate them, but there's this one mc I'd like to have work via a keyboard keypress. What I can do is make the first frame of this mc blank, and the 2nd frame and beyond have elements to expose. So I was thinking I hit the key "v" to play this mc that resembles a volume overlay screen for this UI I'm working on
View 5 RepliesMy flash presentation is devided up into 5 seperate swf files which contain mouse clicks to move through the presentation - I'm struggling to find a way of linking them so that on the last mouse click it moves onto the next swf file.
View 3 RepliesI am unfamiliar with Flash, but would like to have a jpeg which when clicked, is replaced by a video which starts to play. Visit [URL] to see an example. This should just be a couple lines of actionscript and well placed frames.
View 2 RepliesSo 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 Replieshow to play a movieclip on button click in actionscript 2.0.
View 3 RepliesI 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 RepliesI am trying to make buttons that play a movie then go to the page.
I want you to be able to click on the button (bottle) and then the motion tween play out and then when its finished direct you to the desired page.
I posted the code above that I used to get the button to play out on click, but I cannot get the code right to get it to redirect to a different page or url right after the movie plays?
i am developing a simple game "finding the object"
i want to play the animation once i click the object
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].....
I just finished with the "Transitions between external SWF's" tutorial" with Actionscript 2.0. I am working within a flash template and I'm using the premade flash buttons to call the swf's.When I click on a button, any button, the repesctive swf plays just fine, however, when I click on a different button it does not load the different swf and the previous swf keeps playing. The swf's are XML driven for the content.
I made sure that each button script has the correct swf as well.Also, I have only one movie clip created for the container with an instance of "container".get the swf's to play when I click on the different buttons.
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 RepliesI'm currently making a website for an assigment on movie websites. I'm currently trying to figure out how to get the video to play then fade / hide when it finishes or the user clicks the exit button so it will then reveal the page below. It's being built as a multi-swf site (ActionScript 2) and if I can get this figured out then I should be on my way to finishing the site.
View 2 Repliesi 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.
This time I'm experimenting with visibility. All the tutorials online vary a lot. I'm trying to find something noob proof. I have actionscript 2 and 3. I'm not sure which one to use..I'm just trying to learn how to make a frame become visible and Play when I click on a movieclip.
View 5 Repliesi have a movie clip symbol on the stagei have set up a "CLICK" event listener. in the nction it saysCode:MC.play();how can i make it stop after playing once? WHY IS THIS SO HARD!i tried putting a stop(); inside the movie clips last frame but that did nothing
View 3 Replieshow to change this script to play automatically without the onMouseDown function. I have given it a shot but had no luck.I have been altering the code in the area marked in red but not sure if that's right???tage.scaleMode = 'noScale';var speedfactor = 3; // integer (runs through speedfactor frames of brush animation each frame)// the smaller speedfactor is, the more efficient the transition, however, you may need// to increase the speed of the brush animation if you want to cover all the area of the// image as well as allow the transition to play at a reasonable (fast) speedvar images = ["cardirty3", "car"]; // linkage ID list for bitmaps to transition to and from