Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Koolmoves Actionscripts For A Press,realese Play Movie Button?



can someone give me an actionscript for a push button press,and realse play movie actionscripts?becuase when i do it it says expectin line 23?



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-02-2005, 06:45 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Getting A Movie To Play On Button Press?
Hi, ok here goes..

I'm trying to get a movie to play on a certain part of my stage..

i.e. on release of the button i would like for the movie to appear on the stage where ever I want and play. but when I click another button I would like for a different movie to play and the first movie to disappear.

Does this make sense to anyone?

Plz help!!

On Button Press, Play Movie Clip ?
I have a scene with several buttons, each of which play a different movie clip, but I am having trouble with my action scripting - calling the clip.

I had the action in a frame label, but I want the clip to play without sending it anywhere, just to pop up and play, and go away when it's over...

can someone help me with the actionscript for this...

D..

Making A Press Button Then Play Movie
Ok i was wondering how to put a play button b4 my animation starts where the user have to click the button then the movie plays???
Any ideas plzz hlp

[FMX] Loaded Movie Doesn't Play On Initial Button Press
Hi folks, I'm at a loss as to what could be causing a problem that we're having with our site.

I'll give you some background. I've got the portfolio section of our website saved out as a separate swf file which is loaded into a containing movieclip. Now for some reason the portfolio.swf (none of the other sections exhibit this behavior) does not load when you initially click the portfolio link.

However, if you click on one of the other sections after clicking portfolio (let's say contact), then click on portfolio again everything works just fine. My thinking was that the portfolio section simply wasn't able to load in time to display the content. So I tried adding a preloader in a new scene at the beginning of the file, but the same bug continues, except now I can see a quick flash of the preloader before it stops.

Next I thought it may be a stray stop(); command somewhere. I commented out what I thought were the possible culprits, but to no avail. The bug continues.

Once you've visited the site, this problem goes away, and it doesn't occur when I check the site locally. Needless to say, it looks really bad for our company when our portfolio section doesn't load properly.

You can check it out for yourself at www.octagoncreative.com. Just click on the portfolio link. When it doesn't load, click one of the other sections then click back to portfolio. Everything will load fine.

Movie Won't Play Until I Press Menu-play
I hope one of you understands what I mean,

I made a movie with dynamicly created buttons and images.

The problem with this movie is that it doesn't shows anyting when I export it. The only way to make it show everything correctly is to hit the right mousebutton and press play in the menu.

Know I want to know if there's a way I can do this in flash.

My movie contains two frames and a stop statment at the end.

Play Sound On Press Button
hi guys,
how do i play an event sound when i press a button
if(Key.isDown(Key.CONTROL))
{
playSound(laser.mp3);
}

like this but working
thx from germany
buttermilk

Play Music On Button Press
how do you make music play when you click a button?
i am making a game and i want to be able to click different buttons to change the song playing. please heeeelp.

Play Music From Button Press
I know its a basic question but how do i play an MP3 from a button release?

If you can help ill be greatly honourd!

How To I Make It Play A Sound On Button Press?
Hi, basically I want it so that when I press the ctrl button it will play a short sound, how do I do this?

I have the sound file (laserSound)

(Basically in context I am trying to follow a tutorial to make a game and ctrl makes the laser gun fire, and I would like to attach a sound to this action)

Press A Button To Play An Animation In Another Scene
okay, i'll try my best to explain my situation.

I have a button in my main scene. I want to be able to press it and have it rock back and forth (for reference, it's a picture of a guitar).

I have made the animation for the rocking back and forth in a second scene. This might be the wrong way of doing it, if it is please let me know.

So what I want to know is, is this the correct code?

I have this:

stop();

guitar1_btn.onPress = function() {
//gotoAndPlay(1);
trace("guitar pressed");
}


It works, but I think once I start adding other scenes it's going to not work (or I'm missing some code that tells it which scene to refer to).

Basically what I'm asking for is the correct code. First things first, but I would also please like to know how to make this animation loop so that when I click on the button it goes to frame 1 and plays, and when it reaches the last frame of that animation (which would be frame 6), make it go back and do it again, over and over, until it is re-clicked.

that should be all for now, thanks a lot in advance

Video Play Button Disappears After Press
I am trying to create an onscreen video play button that disappears after activation. I've created a Youtube looking play button that covers my flv. I've used simple action script with the button to play the video when pressed. What action script do I add to tell the play button to disappear once the play button is pressed and to reappear once the video is done playing?

Play Movie On Key Press
hi
well im designing a email form...i want to placed key press effects like when user press ANY key to put information that movie-symbol should be play....any code idea???

On Press Play Sound/movie Action
Please Please help! What actionscripting should I use to play a movie when a button is pressed. I've taken s class on actioscripting BUT it was years ago and I have forgotten ALOT.

Please help.
Much appreciated,
ZH

On Stage Pressin Button..works, Test Movie, Press Button Dosent Work
i really need some help on that, it's really annoying me, on the stage i enable simple button and simple frame actions, then i click and it goes to the specified frame, but when i go and test the movie and click on the button, it just sits there, i've tried everything, any ideas?

Space Realese
Well see i am making a new game(Took forever)

But see i noticed i can hold in Space bar and the counter will keep going up here si the code.


PHP Code:



onClipEvent (enterFrame) {
    if (Key.isDown(Key.SPACE)) {
        _root.pu += 1;
    }





But i wouold want it to only go up when the SPACE bar is realesed

But how(Stumpued just like him )
Plesase help.

Press The Button, Load The Movie
That's kind of what I'm looking for. I have menu.swf and in a certain spot I have a movieclip with a button that says "Music?". Basically all I want is, if the user clicks that button, go to a new movieclip to preload slider.swf, which is my sound. I don't know what sort of command I should use to make it switch movie clips and movies.

Loading A Movie On Button Press
I'm not really too sure how to go about this. I imported an avi file and flash turned it into an flv file and made an FLVPlayback symbol and stuff and now I want to be able to load up and play that movie on a button press but the code that I have doesn't work. I don't even particularly think it's right.


Code:
stop();

function showMovie(linkageId, xpos, ypos) {
var linkageId :String;
var xpos:Number;
var ypos:Number;
var mc = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc._x = xpos;
mc._y = ypos;
mc.attachMovie(linkageId,dodge,this.getNextHighestDepth());
}

btn1.onPress = function(){
trace("gotem");
showMovie("FLVPlayback",0,0);
};

Loading Movie On Button Press
my problem is that i have a button and when pressed i want a movie clip to play, however the moive clip is not on the root stage and i'm having problems find the right string to point it to the clip.

this is what i have so far:
programOne.onPress = function() {
_root.movie.chapters.gotoAndPlay(2);
program = 1;
trace("you hit button 1");
trace("Selected Program = "+program);
};

programOne is the button, and chapters is the movie, which sits inside a layer called movie on the root.

-Thanks in advance for any help you can give

Load Movie From A Button Press
I need helP!!!

I'm trying to load a new mc into a film - in a way that it will appear as a result of a button press - the action i used was:

createEmptyMovieClip("imageHolder", 1);
imageHolder._x = 50
imageHolder._y = 80
loadMovie("contact.swf", "imageHolder")

but my problem is that when i turnend the button into a mc still it won't work,
more so, i need to add the button with a pre action of "on press" ...play...
* I plugged the script to the symble (button or mc)

If someone can and would be kind enough to fix my script i'd be most thankful

Ed.

Moving A Movie On Button Press. Help Please.
I am trying to make a button that can move a movie clip left and right, as long as you hold down the button.
At the moment, I can only make it move a small bit per click.

Thanks a lot for the help.

Fade Out Movie Clip On Button Press?
Hey people-

I'm making a site with windows that I could like to fade out when the user preeses a button within the same movie clip as the window itself. I've tried to make it go to a part in the movie clip that has an alpha = 0 tween but no luck. Maybe actionscript is the answer? The movie clip name is "about".

Thanks!

Making A Button So When I Press, It Plays The Movie
Hey
im trying to make a button so when i press it, it plays the movie!


its a swine....lol i can make a button i think..it changes a colour when i scroll over it, but my flash just plays without stopping my friend made one..he even has a stop on the other side....help!?!?!?

Press A Button And Open A Movie Clip
Press a button and open a movie clip in the same scene.
That's all I want. Can anyone tell me (simple) what to do?
It must be very simple but I think I forget some things. I can't get it work.

Thanks in advance...

[F8] Playing A Movie Clip On A Button Press
Hello, I am having difficulties with getting a movieclip to play when I press a button. I want to make a movieclip go to and play a certain frame when I press a button, but when I press it, it just goes to the frame and stops. I understand why it doesn't work. Because since the button is still down, it keeps going to the same frame. What I want to have it do is go to that frame and play it when I press the button, and have it stop when i release it. Any suggestions?

By the way, this is my code:
code:
onClipEvent (enterFrame) {
if (Key.isDown(Key.DOWN)) {
gotoAndPlay("down")
}
}

Move Movie Clip On Button Press
Whats the code for moving a movie clip on button press?

Load Movie From Library On Button Press
I have an mc in the library called "hydrogen display" and when a certain button is pressed I want the mc to load onto the stage I put this script on the button but it doesn't work and i get an error message


ActionScript Code:
on (release) {
               loadMovie("hydrogen display")
}

but that is not working as i said above any ideas on why this does not work or what i can do to fix it.

thanks

Movie Clip Flickering On Button Press......
aight so here's the deal... on my main time line i got a movie clip with the instance name of "textbox" (disregard quotes of course). I put a stop action on the first frame of the movie clip and the last frame so it doesn't show up during the normal playing of the main timeline.

on a button i have the following action:


on (release) {
_root.textbox.play();
}



aight.... so the first time i press the button the the movie clip plays fine.... but if i press the same button again, the movie clip will just flicker.. like it resets itself, so then the next time i press the same button, the movie clip plays fine again.... and so on and so forth.

Can anyone tell me why it does that little flicker???

Reverse Movie Clip On Button Press?
The site is www.amberbutler.com/index2.html.

Notice that when you click a link, the current content frame dissapears and the next one animates in.

I want the current content frame to animate out and then the next one animate in.

I can't find a tutorial anywhere and I've tried everything I can think of, even naming variables to call a series of complex MCs from the _root. Can anyone point me in the right direction?

Thanks!
sogj

Key Press "Enter" To Continue To Play Movie?
Hi all,

If my movie is playing and comes to a frame with a "stop" command, how can I continue playing the movie after the pause just by pressing the "Enter" key?

It's just running off of the main timeline, with no movie clips inserted.

Can you tell me how to resume playing the movie by simply pressing the "Enter" key?

Thanks!

Changing Movie Clip Frame On Button Press
How would I make it so when a button is pushed, a movie clip named "label" will go to frame 2

Stop Animated Movie Clip On Button Press
Hi

I have two arrows that control an animated movie clip that has words scrolling vertically. When you click on one arrow it plays the movieclip forward, and when you click on the other arrow it plays the movieclip backward. I want you to have to keep clicking on the forward arrow to have it continue animating through the different words. I've place stop actions at the points I want the movieclip to stop animating but when you click the forward or backword button it never stops and just plays through the whole thing. Here is my FLA: http://digitalarts.bgsu.edu/portfolios/jimmel/help.fla

Thanks!

Loading External Swf Into Movie Clip On Button Press
Im just making the switch to AS3 and i'm having some major problems loading in external swfs. In AS2 it was easy but from what i've found i'm just not understanding how it works in AS3. I have a movie clip that has my navigation in it that would call the external swfs for each section of the site, it also contains the backgound design for the site. I have my main movie set up for full browser for positioning. and i want to be able to position where my external swfs are loaded as well.

Any help would be much appreciated, i've been looking and trying to figure this out for a few days now.

thanks
Jake

Stop Animated Movie Clip On Button Press
Hi

I have two arrows that control an animated movie clip that has words scrolling vertically. When you click on one arrow it plays the movieclip forward, and when you click on the other arrow it plays the movieclip backward. I want you to have to keep clicking on the forward arrow to have it continue animating through the different words. I've place stop actions at the points I want the movieclip to stop animating but when you click the forward or backword button it never stops and just plays through the whole thing. Here is my FLA: http://digitalarts.bgsu.edu/portfolios/jimmel/help.fla

Thanks!

Add A Movieclip On Button Press, Remove On Another Button Press...
Sounds a little confusing maybe, but the idea is rather simple... I'm trying to figure out a way to have a + and a - button. When a user hits the + button, a movieclip appears. If they hit it again, another duplicate movieclip appears next to the first, etc... basically adding movieclips along the x-plane. Now, when the user hits the - button, the movieclip on the furthest right-hand side is removed, when hit again the next movieclip furthest on the right-hand side is removed, etc until there are no more movieclips.

It's basically an add and subtract movieclip function but I have no idea how to set this up. Any tips or advice would be greatly appreciated! thanks in advance!

Button Press + Key Press Together In Perfect Harmony?
Well, i have been trying now for a while to get my buttons to display the corresponding number in a text box. I have achieved it so that if you click on the button with the mouse cursor it will happen. I can also do this for a keypress, but sadly they will not work as an either/or option. What actually happens is that the keypress is disabled until the mouse has activated the on release.
Here is the code:

on (release){
if (password == "") {
password = "1";
} else {
password += "1";
}
}
on(keyPress "1"){
if (password == "") {
password = "1";
} else {
password += "1";
}
}


Any suggestions will be greatly welcomed.
Thanks
Yoda

Button Actionscripts
I really suck at actionscripts, especially in Flash. I'm not very good in the program and I have made this website which uses different scenes for different pages. You can surf throught the scenes with a menu. Everything is ready but the problem is that I have to connect the buttons to the scenes. Which actionscript do I need?

And do I have to use a 'stop' in every scene?

Thanks in advance

Nepeace

Play Movie When Play Button Is Click.
Hi all,

I am a newbie, and I did use the tutorial on how to create a video with FLV and it works beatiful. There is something I can not figuere out yet.

How do I make the movie not to start playing until I click the play button?

Any questions let me know and thank you in advance for your help.

mperez6109

How To Tell The Mc To Play If I Press?
hi guys!,
i have this code on a mc on stage:
ActionScript Code:
onClipEvent (enterFrame) {
if (_root.activate == 1) {
var xDifference = _root._xmouse-this._x-30;
var xAmountToMove = xDifference/_root.speed;
this._x += xAmountToMove;
}
if (this._x<=0.5) {
this._x = 0.5;
this.stop();
}
if (this._x>=640.0) {
this._x = 640.0;
this.stop();
}
if (this._x<570 || this._x>750) {
_root.playIn();
_global.CurrentMenu = 1;
}
if (this._x<380 || this._x>570) {
_root.playIn();
_global.CurrentMenu = 2;
}
if (this._x<200 || this._x>380) {
_root.playIn();
_global.CurrentMenu = 3;
}
if (this._x<0 || this._x>200) {
_root.playIn();
_global.CurrentMenu = 4;
}
this.onRelease = function() {
if (_root.MicAnim == 0) {
_root.Mic.gotoAndPlay("On");
_root.MicAnim = 1;
_root.activate = 1;
} else if (_root.MicAnim == 1) {
_root.Mic.gotoAndPlay("Off");
_root.MicAnim = 0;
_root.activate = 0;
}
};
}





baisically i need that when this happens:
ActionScript Code:
if (this._x<570 || this._x>750) {
_root.playIn();
_global.CurrentMenu = 1;
}



to do something like this:
ActionScript Code:
if (this._x<570 || this._x>750) {
_root.playIn();
_global.CurrentMenu = 1;
this.onPress = function(){
_root.Mic.gotoAndPlay("On");
}
}



it works well if i apply this code once, but if i try to do something like this:
ActionScript Code:
if (this._x<570 || this._x>750) {
_root.playIn();
_global.CurrentMenu = 1;
this.onPress = function(){
_root.Mc1.gotoAndPlay("On");
}
if (this._x<380 || this._x>570) {
_root.playIn();
_global.CurrentMenu = 2;
this.onPress = function(){
_root.Mc2.gotoAndPlay("On");
}
}
if (this._x<200 || this._x>380) {
_root.playIn();
_global.CurrentMenu = 3;
this.onPress = function(){
_root.Mc3.gotoAndPlay("On");
}
}
if (this._x<0 || this._x>200) {
_root.playIn();
_global.CurrentMenu = 4;
this.onPress = function(){
_root.Mc4.gotoAndPlay("On");
}
}
}



then nothing works....any ideas would be most appriciated!

Buttons, Movie Clips And ActionScripts
I've created myself conundrum. In my test movie I have created two named frames on the screens timeline (home, box); each content frame consists of a movie clip with a button in it (home_btn, box_btn). What I'm attempting to do is have the home_btn button call the movie in "box" and have the box_btn button call the movie in "home".

If I don't use movie clips the is a simple task,

home_btn.onRelease = function() {
gotoAndPlay("box"); }

but as soon as I place the buttons inside a movie clip the navigation ceases to work. I'm assuming I'm getting beaten as something very basic, but unfortunately I can't find it.

Anything thoughts would be greatly appreciated. Thanks

locoLindy

Fade In/out Of Movie Clips Using Actionscripts
Hello.

Can someone tell me what's the best way to fade in/out movie clips using actionscripts instead of a tween.

Thank you!

Trying To Get A Button To Play A Movie Clip After I Click The Button
trying to get a button to play a movie clip after i click the button. right now when i preview my web i have to hold the button for it to play and after i let it go it dissaperes. please help with flash mx. use to corel rave so simple but limited

Key Press - Spacebar - To Just Play
Hi
Just trying to make almost a pause button with the stop action..and then let the End User continue playing with the use of any key or the spacebar (key code = 32) ...
so i have this movie clip (lets call it "hello" that i drop onto the main layer0
with a small animation ... and on frame 10 i have the stop action ... and a movie clip called fake button..... and the code i have on that is...

onClipEvent (keyDown) {
if (Key.isDown(83)) {
play ();
}
}

what i want is for the MC "hello" to keep on playing.. so with the key press it will play frame 11 and onwards.

what is this numptey doing wrong.... its either

im having the wrong timeline play... not referencing it right..or
I havent graduated from actionscripting 101 yet !

aghhh... thanks for your help.
Rye

Pause/play With One Key Press?
Hello people. "first" posting.

Is there a quick way to enable a swf presentation to start and stop with the operator/speaker's ability to press, say, <spacebar> to halt the movie without taking an undue amount of time and or attention?

actionscript, frame location/level, make sure that this can be done throughout the movie!

Thank You!

Play Sounds On 2 Key Press's
Hi all,

Can anyone help me please.

Im trying to have sounds on a MX site which are triggered by holding down say "c and 1" then it plays a sound.

I have placed the sound in a frame and used the below code to play that sound,
on (keyPress "1") {
gotoAndPlay(81);
}
but how do i make it so it needs the use of 2 key press's at the same time.

hold down c and 1 to play that frame.

Any help is fully apreciated.

Press Play Too Start
How do i start the flash movie by pressing a play button, so far all i have is i have it on but the play button will stay on for as many frames as its meant to be on then the movie will start even without pressing play, is this the only way and ill have to let the play button on for a long while? or is there a better way?

How To Play A Sound On Key Press?
I've searched the internet far and wide, and I've found tutorials for the exact same thing.

I want it so that, when I press the "control" key, it plays sound, "sound.wav"

Thank you.

Press Space Bar To Have FLV Play
I have an external FLV file on frame 25 of my movie. I would like to make it so the user has to press the space bar for that movie to play. Right now it plays automatically. How can I do this?

Thanks,

Rich

Play Sounds On A Key Press?
Does anyone know script for doing this?
I'm trying to play a sound on a space bar press.
I am using Flash MX
please help

thanks

Play Sounds On A Key Press?
Does anyone know script for doing this?
I'm trying to play a sound on a space bar press.
I am using Flash MX
please help

thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved