ActionScript 3.0 :: Button Flicker On MouseDown?
Jan 26, 2010
I have two button instances on the stage. I've created two functions, one for each button to handle their MOUSE_DOWN event. In both of those functions I have a trace statement to ensure the MOUSE_DOWN events trigger their respective function calls, which each do.
The Problem: When you hover over either button, the button state changes to the "OVER" state as it should. However, when you click the button, the button flickers for a split second and then goes to the "DOWN" state. The flicker appears to be the button going to the "UP" state momentarily and then to the "DOWN" state. The only thing I can think of causing this problem is the fact that there is a MovieClip on the "UP" and "OVER" states that may be inheriting button events.
I've had this happen in the past when using button instances that contain MovieClips inside of them, but never knew how to remedy the problem. As a last resort I guess I could just change all the button instances to movieclips, but I'd like to learn how to accomplish this without needing to do that first.
Here is the only code that exists in the entire file:
Code:
var _volumeUpButton:SimpleButton = btn_volume_up;
var _volumeDownButton:SimpleButton = btn_volume_down;
[code]....
View 3 Replies
Similar Posts:
Oct 26, 2009
I have created a button for a homepage, and, to help designate it as "clickable," I have changed its background color on the Over through Hit stages.However, the background color change flickers instead of staying the changed color.Go to and hover over "Cirlces for Rice Field Days 2009" in the Spotlight box on the homepagethis is the flickering button.
View 1 Replies
Nov 4, 2007
I am trying to make my button Flicker on/off but cannot get it too work, the best I can do is get it to go to alpha 60 and then back to 100.[code]...
View 1 Replies
Feb 11, 2010
Its been a while since i used flash and i need some action script for my latest project. On my button i want: aboutUs_mc to play when mouseover aboutUs2_mc to play when mousedown i also dont want either to play until both the mouseover and mousedown happens. i also dont want them movieclips looped.
View 3 Replies
Aug 22, 2010
Currently I have a button which is in the form of a face. On MOUSE_DOWN the face smiles and then it redirects to a new URL:
mybutton_btn.addEventListener(MouseEvent.MOUSE_DOW N, myHandler);
function myHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("newpage.html"), "_self");
}
I am trying to make it so that it will pause ON the face smiling (MOUSE_DOWN) for a second before redirecting.
View 2 Replies
Oct 13, 2011
I'm working on a project where I need to make a picture of a building fade darker on mouse over, while sections of the building get brighter. The sections rise up when you hover over them and will load a pdf when you click.
Everything works fine so far except that when the mouse goes over the edges of the buttons the background and the buttons fade back in and out again.
I only want them to fade out when the mouse leaves the stage.
Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.MouseEvent;
[Code]....
View 1 Replies
Jan 8, 2004
In a nutshell I'd like to be able to use the mouse to draw a box. But not draw the four sides. Instead, you could click and start dragging the mouse and a box would be drawn and grow as you drag. When you let go the box is there. But if you click and drag again somewhere else the first box disappears and the process starts over in the new mouse click position.
On the other hand, would it be better/easier/less processer intensive to just have a teeny box in a movie clip already on the screen and then have that change scale as the user clicks and drags?
Eventually this functionality would be built into a map. The map would be made up of tiles of a certain resolution. The box drawing comes in as a zoom tool. The user could click on the map, drag the mouse and draw a box. That would be the area they wanted to zoom in to. So I'm guessing I would use hitTest to find out which tiles the user drew the box on and then load higher resolution tiles.
But for now I just need to know how to get the box functionality!
View 14 Replies
Aug 5, 2009
i am working on a project in which i want to have the water ripple effect when i click the mouse where ever on the stage. so here is the problem i have created a file which produces the water ripple effect all across the stage randomly by using "flash.filters.DisplacementMapFilter " when playing the movie i want the ripples to appear on mouse down state and only one ripple not multiple ripples and exactly at the place where i click. now what i have done is i have put all the script i have in " mouseListener.onMouseDown = function() { " but what happens is the ripples appear when i click but not the whole movie clip for ripple is played its like i have to click fast after each other for the ripple to be continuous and full.what should i do?
View 1 Replies
Feb 26, 2012
So in Actionscript 3 and Javascript, to get touch events working for mobile devices I have to listen for ontouch events... However, touch events not fired on desktop. However, mouse events are triggered on both mobile AND desktop. My quesion is this: why does w3 have this spec
Wouldn't it make sense to have just to use the onmouseevent? In order to have things work on mobile and desktop I always have to listen for both events-bviously this causes issue on mobile devices because two events are fired when i press the screen (meaning that I have to do a bunch of conditional checking to add/remove event)
My initial thoughts were that multi-touch would be the main reason... But couldn't the design just have some parameter of the event like .touches? That could go along with the .pressure, .finger width, etc... maybe a .type = "touch" or .type="mouse"
View 1 Replies
Nov 26, 2004
I want to let the user control an object, in this case a cartoon character blowing a bubble. I want the user to be able to control the bubble by rapidly clicking their mouse. The faster they click the bigger it gets and when they dont click or click slowly the bubble gets smaller in size.[URL]
View 7 Replies
Apr 16, 2003
What i'd like to happen. but don't have enough actionscript knowhow.I have a series of small movies. i have made an interface with buttons. when the user presses a button one of the movies will be selected randomly and loaded into the main movie. that's it
View 4 Replies
Feb 20, 2009
I modified a mouseDown event to use
mouseListener.onMouseMove = function() {
moveGlow();
};
But the glow animation restarts everytime the mouse moves. Can someone point me towards a tutorial or a tip on using a conditional to detect the mouseMove so it doesn't start over?
View 3 Replies
Nov 8, 2011
I have this movieClip container/holder with several movieClips inside.The container is draggable over the Y axis with TOUCH_BEGIN(same as MOUSE_DOWN) and stops dragging with TOUCH_END(same as MOUSE_UP).But the movieClips WITHIN this holder are clickable with TOUCH_TAP(or CLICK).
Here's the problem:When I start dragging with my finger(mouse) on one of the movieClips within the holder, and release with my finger(mouse) still on the movieClip (I have an ease added to the dragging so it's possible my finger(mouse) won't be on the movieClip when done dragging) it will fire the function of this movieClip.This is really annoying because what if you started dragging, and wanted to click the movieClip beneath the one your finger(mouse) is on right now.I already tried something with removing/adding eventListeners but that doesn't work.
View 1 Replies
Nov 26, 2004
I want to let the user control an object, in this case a cartoon character blowing a bubble. I want the user to be able to control the bubble by rapidly clicking their mouse. The faster they click the bigger it gets and when they dont click or click slowly the bubble gets smaller in size.The only tutorial Ive found that is similar is this url..Anyone point me in the right direction of a tutorial closer to what im trying to do? Or can anyone suggest some action scripting to use?
View 7 Replies
Feb 10, 2011
I'm making a banner in flash, and are moving some simple objects around.I mainy use vector squares, but when I tween them (classic tween) in a slow motion, the shape starts to "flicker" or "lag". Why is this?I think there has to be something with the calculations Flash is doing, but why can't it make the animation smooth?
View 4 Replies
Feb 28, 2009
I created my flash menu over a year ago, and need to upgrade it by adding a sub menu. I'm not very savy with flash, i usually google any actionscript that i need and guess my way through. I'm having a particularly hard time trying to figure out how to resolve the issue of my submenu flickering while the cursor is over it. I understand it's probably some problem with the layers and embedding, etc. i've attached the .fla to move things along quicker.
View 10 Replies
Nov 5, 2008
I'm working on a custom AS visual component, based on UIComponent class. Inside this component, I have a button I programatically added. I set the mouseClick event of it, and it works fine. When the mouseClick for the button starts, it adds a listener for MouseDown on the stage. This is my problem. Once that MouseDown event listener is initiated it won't ever pay attention to the MouseClick listener of the button (which will
turn off the MouseDown listener!). I've tried setting the priority number when creating the listeners, but this is not working. My mouseClick listeners gets ignored.
View 3 Replies
Sep 13, 2011
I can't seem to get around it. I whant tu add an event on mousedown on the scrollpane scrollbars..
View 3 Replies
Dec 27, 2011
I have an oversized moveclip which i will place on the stage.When flash swf is running, I would like to move the movieclip left, right, up or down when i mousedown. Just like the "MOVE" tool in photoshop.
View 1 Replies
Jan 21, 2009
DisplayObject's have MouseX and MouseY getters. This is very helpful sometimes.Is there a way to easily query input state variables such as MouseDown or KeyDown?If not, I suppose I need to add listeners for these events, which is fine.
I am just wondering:why MouseX and MouseY get special treatment without a listener; if there are other getters for input data without listeners that I don't know about in other parts of as3.
View 4 Replies
Aug 19, 2010
Here attached a simplified, reduced flash file as an example of my earlier problem. With some trial and error I changed the function rotation2. I changed (180/Math.PI) to (45/Math.PI) to get the mc_arm into the half circle, but it just moves a bit in the middle of the circle when you grab and drag it. How can you optimize this behaviour, so that the arm really follows the mouse on mouse down and move, within the borders of that half circle? The formula must be changed somehow, but I don't know how.
View 0 Replies
Mar 15, 2010
I'm trying to create a script that would imitate an old rotary phone dial. I have this script, but need it to function on MOUSE_DOWN:
Code:
handle.addEventListener(MouseEvent.ENTER_FRAME, startRotate);
function startRotate(e:Event):void {
var dx:Number=mouseX-handle.x;
var dy:Number=mouseY-handle.y;
// presupposes position of object to be facing to the right.
var radians:Number=Math.atan2(dy,dx);
handle.rotation=radians*180/Math.PI;
var hR:Number = Math.round(handle.rotation);
rotationA.text = String(hR);
}
Changing the event handler doesn't work. Somehow the MouseDown function should be working like an EnterFrame event, I guess. The condition I want to check is whether or not the handle is at a certain degree angle to stop the dial from rotating.
if (handle.rotation >= 30) {
handle.rotation = ?;
}
Not sure what I need to put in there to stop it from rotating.
View 1 Replies
Oct 24, 2011
Anybody got a method of drawing a line from the mouse down point to the mouses current position.
But taking into account the direction the mouse is moving in to make the curve look more natural and directional.
This is what i have currently which is basic and rubbish:
catapultLine.graphics.moveTo(startX, startY);
catapultLine.graphics.curveTo(Main.gameStage.mouse X/3, Main.gameStage.mouseY/3,Main.gameStage.mouseX, Main.gameStage.mouseY);
View 14 Replies
Oct 18, 2004
basically I have an MC menu that I want to move to the left when you click and hold on another MC called leftButton, here's what I have.In main timeline:
Code:
menu.moveLeft = function() {
this._x -= 4;
[code]......
View 10 Replies
Sep 16, 2008
I need to load separate SWF files depending on different flash buttons being pressed. The problem is I see a flicker inbetween SWF's being played. I think the flicker is where it goes back one frame - but I do not know how to solve this.
The first bike should scroll along to the left then stop, buttons should then appear that allow you to load the external/separate SWF files.
View 13 Replies
May 19, 2011
Whenever I hide the mouse pointer to replace it with custom made graphic, it causes curors to flicker rapdily outside of the browser window. When you type or move across URL bar, or try to scale the browser window by dragging its corner, the mouse pointer goes crazy.
[Code]...
View 1 Replies
Jun 5, 2010
his gallery which I downloaded, it is AS 2.0.It works well as is on the main(Scene 1) page, except that when I create a new MovieClip, and paste all the original frames w/actions into it, it begins to flicker and none function.Here are the codes:Here is the actual gallery with my problem in it:
First Frame:
stop();
Stage.scaleMode = "noScale";
[code].....
View 1 Replies
Feb 16, 2009
I have a series of buttons on a page that I want the user to be able to re-arrange. To do this, I have a MOUSE_DOWN event listener that triggers a startDrag. However, these buttons are also essentially menu items so when user clicks on them, they should load the appropriate URL. I don't want them to act as menu buttons when a user is trying to move them about. I have three event listeners on each button, one for the MOUSE_DOWN and one for the CLICK event and one for MOUSE_UP but the function associated to the CLICK event also fires on the MOUSE_UP.
View 1 Replies
Sep 15, 2009
In Flex 3, I have an ItemRenderer that has a button in it. I want users to be able to click and drag this Renderer, but also just click the button. Right now it's working with the Renderer listening on "MouseMove" to initiate drag and drop, and the button listening on "click". However this is very screwy. If somebody is dragging a scroll bar and comes anywhere near that renderer, MouseMove gets fired on the renderer and initiates dragging.
(or if somebody is resizing a HDividedBox, basically if someone initiated a click anywhere in the app and rolls over this renderer, we get unwanted dragging. The alternative is listening on MouseDown instead of MouseMove, which fixes the previous issue, however the nested button loses it's click. I can click on the button, but the renderer just thinks it's time to Drag.
View 1 Replies
Dec 14, 2010
In Flex 4, I have a Spark List component with item renderers. I would like to select an item in the List by clicking on it, and deselect it also, by clicking on the same selected item. Like an on/off switch.
My item renderer has the following states:
<s:states>
<s:State name="normal"/>
<s:State name="hovered"/>
<s:State name="selected"/>
</s:states>
so I tried to add a click event listener to the item renderer with:
private function selectUnSelect():void {
if (currentState == 'selected') currentState = 'normal';
else currentState = 'selected';
}
with an awkward behaviour... where the item stay selected even after clicking it again in the selected state.
Think of using the List component without the Command (on mac) or the Control button on windows.
View 2 Replies