ActionScript 3.0 :: RemoveEventListener / Disable Button During Tween

Sep 25, 2009

Basically, I have a movieclip on the stage called slide_mc that gets tweened left or right when next_btn or back_btn are pressed. Slide_mc is a long rectangular strip that has different images on it. The idea is, you press next or back to show different parts of this strip. There are two panels on a layer above it to hide the extra parts of the strip from view. I needed the slide_mc to move forwards and backwards seamlessly as if it is one long continuous strip. I did this using actionscript3 and its x coordinate. The images on slide_mc are equally spaced so I just set the tween to move by a certain number of x values.

The problem is if you press the next button before the previous tween has finished it progresses again by that same value which ends up moving the slide_mc to a random position, perhaps covering some of the image. How can I disable the next and back buttons until the Actionscript tween has finished what its doing and then enable them again for the next tween? The end product is supposed to be a gallery. Obviously it would be better to use a UiLoader to display the images to keep the file size down, but I couldn't think of a way to load the right images while still allowing the slide_mc to move forward and backwards.

Here's my code:
next_Btn.addEventListener(MouseEvent.CLICK,moveLeft);
back_Btn.addEventListener(MouseEvent.CLICK,moveRight);
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
[Code] .....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: MovieClip Button: Shape Tween Vs Motion Tween

May 1, 2009

my movieclip button was working perfectly as a motion tween. Can you use shape tweens as movie clip buttons? I just made that change, and kept my code:

[Code]....

View 1 Replies

ActionScript 2.0 :: Disable A Button After It Is Click And Then Enable It Once Another Button Is Clicked?

Sep 8, 2009

I'm trying to figure out how to disable a button after it is click and then enable it once another button is clicked. I'm stuck on how to enable the button.

on (rollOver) {
this.gotoAndPlay("s1");
_root.slideshow.gotoAndPlay("s4");

[code].....

View 1 Replies

ActionScript 2.0 :: Disable Button By On Press Another Button

Dec 1, 2010

I have a button which on press will go to next frame. I want to disable this button by on press another button.[code]

View 2 Replies

ActionScript 2.0 :: Disable Button And Renable Button?

Oct 27, 2004

I have a button that is disabled after opening an external loaded movie. if that movie is unloaded, how do i re-enable that original button?

Senario:
Button "A" is pressed
Movie "A" is loaded
Button "A" is disabled.

Button "B" is pressed
Movie "A" is unloaded.
How can Button "A" become enabled again.

View 14 Replies

ActionScript 2.0 :: Motion Tween The Button To Return Up To Its Original Spot When Another Button Is Then Pressed?

May 26, 2005

I'm trying to create a set of 4 vertically arranged buttons that 'split' apart when those buttons are pressed. For example, if you click the topmost (1st) button, the bottom three buttons will drop down so submenus (for the 1st button) can now be revealed beneath. Again, when you click the 2nd button from the top, the bottom two buttons drop down, revealing submenus, and so on.

Now, is there a way that I can use actionscripting to tween the buttons to not only motion tween a drop down when a button is first pressed, but also to motion tween the button to return up to its original spot when another button is then pressed? Right now, I have two keyframes, side-by-side which each containing a different y-scale value for an object. Can I do some actionscripting to get the object to motion tween upward to its original spot instead of "clicking," or snapping back to is original spot when another button is pressed?

View 1 Replies

ActionScript 2.0 :: Disable A Button Using Another Button?

May 10, 2003

is there a way to disable a button using another button with action script flash MX .

View 3 Replies

ActionScript 3.0 :: Disable The Esc Button?

Aug 4, 2010

can some one fullscreen and how to disable the esc button?

View 2 Replies

Button Un-highlight On Disable?

Sep 17, 2009

In my code, when a user clicks on a button, I set the alpha of the button to 50 and set enabled=0. This works to essentially disable and grey out the button. The problem is that even though the button has been disabled, it still sits in the over state until the user moves the cursor off the hit area... Funny, no?
 
Since you can't tell a button what frame to go to, how do I get it to go back to its up state (without recreating all my buttons as movieclips and doing the whole thing manually)?

View 3 Replies

ActionScript 2.0 :: Possible To Disable Button?

Jul 25, 2009

[url]...

if you click on the middle Character a popup window will open at that time i want all other buttons disable so that we cant see the small box on mouseover.[url]...

View 1 Replies

ActionScript 3.0 :: How To Disable A Button

Dec 6, 2009

I have some code similar to the following:

ActionScript Code:
//
//
var box = new Sprite();
box.graphics.lineStyle(10, 0xFF0000);

[code]...

If you click the box, its alpha is set to 1 rather than .1 because of an errant MOUSE_OUT event.What is the right way to fully disable this button when it is clicked?I'd rather not remove the event listeners because I have a bunch of different MOUSE_OVER functions on many different buttons and keeping track of which function is with which button and whether or not the listeners are already assigned seems like way too much work just to properly disable a button.

View 9 Replies

Disable Certain Button Function?

Mar 15, 2010

I have a button that when you roll over it a big window pops up, but then when you click on it, it pops the window up again, now its not a problem but i would like to know if i can disable the click function somehow. so that only the roll over works.

I know you can probably use a movie clip and just tell it with actionscript to load when rolled over, but i don't know how

View 2 Replies

ActionScript 2.0 :: How To Disable A Button

Nov 6, 2004

I have some buttons that play an external swf inside an empty movie clip on the main timeline. I was wondering what Actionscript I need to disable the button when it is pressed. I want the button to still have roll over functionality and everything, but I just want the swf to load once when the button is pressed. Below is the script I am using right now.

on (release) {
//load Movie Behavior
if(this.content == Number(this.content)){

[code].....

View 2 Replies

ActionScript 2.0 :: How To Disable A Button ..?

Apr 30, 2003

I need to know how to disable a button

i used :

_root.(buttonname).enabled=false;

for buttons which is on the stage directly but it doesn't work with buttons that inside a movie clip.

View 8 Replies

IDE :: AddEventListener RemoveEventListener?

Feb 7, 2010

I have made the flash file into CS3 and simplified the idea a bit. Basically I want to click the box on the right to start playing the song and the spectrum and then if I click it again it will stop playing the song and the spectrum then if I click it again it will start playing again ect ect. I could not upload the song.mp3 cause the file size was too big you will have to replace it with another mp3 in the root of the folder and name the mp3 song.mp3.

View 3 Replies

ActionScript 3.0 :: Cant Disable Button By Function?

Sep 23, 2009

[code]How come I cant disable the button by this function?

View 1 Replies

AS2 :: Disable Button When It Opens A New Frame?

Jul 17, 2009

I have a movie and after the intro the enter button takes me to the next frame (11) and stops. there i have a drop down menu with button instances on each of the drop downs. The drop down is in a movie clip so i am using on (release) {_root.gotoAndPlay("s1"); } on the button instances to take me to root level to say frame 12 and stops. Each button instance has a different frame label to go to, s1, s2 etc - the idea being that back at root level i can have the content of each of the buttons on each of the frame labels (s1 at frame 12 , s2 at frame 13 etc) .... this works fine except the drop down menu in each of these new frames retains the action script on the drop down button instances - this is fine for all the buttons that will take me to another content page at root level - what i dont want is the AS to remain on the button for the page i am currently on - cos if you click on it it takes you back through the intro etc to get to its frame label again .

View 3 Replies

ActionScript 3.0 :: Disable A Button Once It Has Been Clicked?

May 17, 2010

I need to disable a button once the user has clicked it! I also need the colour of the button to change once it has been clicked as well (I need it to just grey out - not sure if this can be solved using actionscript??) The only method I could think of of accomplishing this is to put each button in their own UILoader, but I'm hoping there is a simpler method!?

View 2 Replies

ActionScript 1/2 :: How To Inactivate/disable A Button

Jun 4, 2007

I need my buttons to stay put, but, I need to figure out away to make them stop working temporarily. I have layers above themthat become visible, and the buttons underneath these visiblelayers are working, even though they're covered up. Is there a wayto inactivate them, or make the layers above them take precedencewithout changing the button's _visible property?

View 4 Replies

Professional :: Disable Each Button When Someone Clicks It

Jul 12, 2011

I have a site with 908 buttons. Basically a person clicks a button, makes a donation (through paypal) and then that button gets their name displayed when the mouse hovers over it. Essentially the button becomes the property of the person who makes the donation. how to disable each button when someone clicks it. Disabling a button isn't the problem. I need it disabled only when the person has made a valid donation. Each button has a unique instance name (b001 - b908). There must be a way.

View 9 Replies

Professional :: Disable A Button Once It's Pressed?

Feb 21, 2012

As the subject says, how do I disable a button once it's pressed?For example:- Home page loads, disable the Home button- Click on Contact page, disable Contact button, re-enable Home button.I've tried removeEventListener, used button mode true/false and nothing seems to work for me... Unless I'm doing it all wrong...

View 1 Replies

Flex :: Disable The Icon On A Button?

Jun 9, 2011

I have a button which I use for sending a message. When the message text is empty, it should not be possible to click the button.

This is all fine and not an issue. The only thing that is bugging me is the fact that I can disable the send button but the image does not get disabled (like I would expect).

Is there a way to do this elegantly because I don't want to provide a sendicon_disabled.png and change it myself (I don't think this should be my job).

View 1 Replies

Actionscript 3 :: Temporarily Disable A Button In It

Dec 13, 2011

I am just playing with flash cs5.5 as3 and movieclips as buttons and have come across a problem.[code]...

View 2 Replies

ActionScript 2.0 :: Enable And Disable Button

Jan 13, 2011

i have been pulling m hair out here trying to work out how to toggle on and off states on my buttons. Once a user clicked one it fades and disables ok as I want but i also want it to enable and fade back up again when they select another button. Below is my code:

[Code]...

View 2 Replies

ActionScript 2.0 :: Disable Mouse Button?

Jun 14, 2011

I know this is a question that comes up, but there has to be another way that I haven't found, maybe simply because I was search for the right keywords.Common enough question, I'm sure; I have a flash program, published in a projector and I don't want the menu to pop-up when the mouse is right clicked.Stage.showMenu = false; and fscommand("showmenu",false)have both been tried, disables most of the menu, but the drop down menu for global settings still appears.There has to be a way to set it so the right mouse button is off entirely when in the program. I've seen script that recognizes each of the different mouse buttons to assign a different response, I've seen a script designed to turn off the mouse so it can't be clicked during a tween transition; there has to be a way to program an event, or something, that will recognize the button and ignore all input from it. What is it?

View 2 Replies

ActionScript 2.0 :: Disable The Button While The Others Are Enable?

May 17, 2004

is there anyway to disable the button while the others are enable what im trying to say if let say im on a about section of the site and i want to disable the about button while the rest is enabled

View 5 Replies

ActionScript 2.0 :: Disable Button And Reable Again?

Oct 27, 2004

I have a button that is disabled after opening an external loaded movie.if that movie is unloaded, how do i re-enable that original button?

Senario:
Button "A" is pressed
Movie "A" is loaded
Button "A" is disabled.

Button "B" is pressed
Movie "A" is unloaded.

How can Button "A" become enabled again.

View 14 Replies

ActionScript 2.0 :: Disable A Button If A Certain Event Happens

Jun 14, 2005

i am making a flash mp3 player and was wondering if there was away to disable a button if a certain event happens. I want my volume to go up to 100 and then disable the button from making the sound go any loader.

View 3 Replies

ActionScript 2.0 :: Disable Button On Another Level

Aug 10, 2005

My main movie is on level 0, of course. On level 0 I created an empty movie clip named "container". Now, I load another movie into container, and I loaded it on Level 1. Now, I want to put a code inside a Movie Clip that is on level 1, which is the new, loaded movie that will disable a red button on level1. Here's the code I used:[code]That worked to no avail as well. So, I'm wondering if the code that disables and enables buttons only work with a handler? Like an onClipEvent or on (release) handler? I'm puzzled right now, because this is really elementary but i just don't know it right now.

View 2 Replies

ActionScript 2.0 :: Disable A Button Temporary?

Jan 24, 2006

i want to disable a button temporary (for a few miliseconds) with this script:

Code:
on(release)
{
this.enabled = false;

[Code]...

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved