ActionScript 3.0 :: Make A Sibling Sprite Transparent To Mouse Events?

Jun 10, 2010

Essentially, the simplified problem is this: I have a parent sprite "PARENT" with two children: One child sprite "A" that contains a number of children which respond to mouseover/mouseout and rollover/rollout events, and a second child sprite "B" that is shown/hidden based on the events in "A".

The problem is that "B" appears over "A" on the stage and when the mouse enters "B", the children in "A" throw mouseout/rollout events. Ideally, I would be able to make "B" completely mouse transparent so that the hit testing in AS3 will "see through it" to the underlying "A" sprite, but this doesn't seem possible.

Note that "B" has mouseEnabled and mouseChildren set to false... but the problem seems to be that the AS3 hit testing engine won't look at siblings when determining mouse hit testing. (i.e. It sees "B" under the mouse, sees the mouseEnabled=false setting, and then moves on to "B"'s parent ("PARENT"), but never checks to see if "A" is under the mouse (which it is)).

I can't make "B" a child of "A", because "A" is clipped and "B" needs to extend beyond this clipping area.

At this point I'm thinking I'm going to have to do my own hit testing, which is far from ideal given that "A" contains a large number of children.

View 4 Replies


Similar Posts:


Flash :: Transparent Parts Of Sprite Responding To Mouse Events

Jul 17, 2010

I'm making a puzzle game in Flash cs5/as3 which can have custom puzzle shapes. Basically, the user can draw basic protrusions of a puzzle. Then I create a black and white puzzle piece with a custom function like this var piece:PuzzlePiece= new PuzzlePiece(true,true,false,false); PuzzlePiece is a class that extends Sprite. The four arguments correspond to the four sides of a puzzle piece (up, down, left, right). If the argument is true, it means that protrusion should stick out of that side of puzzle piece. If it's false, it should have a hole on that side, so it fits the protrusion. I first attach the protrusions that stick out, then i flip the protrusions that stick in, attach them to a new sprite (in_part) and invert them with the following function:

[Code]...

View 2 Replies

ActionScript 3.0 :: Semi-transparent Shape Stopping Mouse Events

Oct 3, 2010

I'm a bit boggled by a MouseEvent/layering problem.

I have a filled Shape, with alpha 0.5, on top of a Sprite. The Sprite has various MouseEvent listeners attached to it.

I'd like the user to be able to click on the Sprite. Unfortunately, Flash doesn't pass the events to the Sprite. (It does, of course, if the shape is unfilled.)

Is there any way to tell Flash to treat this object like an unfilled object, rather than a filled one, for the purpose of MouseEvents?

View 5 Replies

ActionScript 3.0 :: Routing Mouse Events Through A Sprite?

Jul 27, 2009

In a pure ActionScript 3 project, I have a sprite that overlaps another sprite. The lower sprite normally handles mouse clicks. The lower sprite no longer processes mouse events when it is overlapped by the higher sprite. I would like the lower sprite to handle mouse events when it is overlapped. (In my particular instance, the higher sprite is just a decorative piece; it has no normal mouse interactivity anyway.) Is this possible? Is there a way to route mouse events through the higher sprite?

View 3 Replies

ActionScript 3.0 :: Avoid Transparent Part Of Bitmap To React With Mouse Events?

Dec 20, 2011

What I have is a bitmap as render cache for a sprite, and there're many of them present on the stage. I expected that they would react like sprites with mouse-click event, but they didn't. They're like rectangles all around, matter what the original sprite look like, And I tried put bitmap cache into sprite container and use sprite's hitArea property like [code]...

View 1 Replies

ActionScript 3.0 :: Click&drag On The L - No Object The Transparent Area Of The L Receives Mouse Events?

Aug 25, 2009

I have objects that the user can click&drag. They're PNGs, mainly rectangular, no problem till here.But I then had to put an L-shaped object (a PNG with a lot of transparency), so i've made a movieclip with an shape with the same L shape than the png, and use it as its hitArea:

shape.visible= false;
shape.mouseEnabled= false;
obj.addChild(shape);
obj.hitArea= shape;

This works PERFECT, the mouse events respond as expected, and I can click on objects that are below/above the transparent area of the png/object.All objects are inside a Sprite called playgroundLayer1. The issue comes when I take the L-shaped object and put it on another Sprite (playgroundLayer2), that is above the playgroundLayer1.I this case, I can click&drag on the L, but no object below the transparent area of the L receives mouse events.

View 8 Replies

Flash :: Mouse Event Handling (Make Symbol Transparent To Mouse)?

Feb 3, 2010

I have a flash that has a background symbol that responds to CLICK event. On top of that symbol I have a sprite that contains a Bitmap with transparent pixels. Both of them are added to the stage, so they are not related directly.

I want clicks on the transparent pixels on the sprite to go straight through to the background. I have read about mouseEnabled / mouseChildren but have not been able to make these work. The symbol ignores the mouse events when I use them, but does not pass it along as if its transparent.

Is this possible to do with flash? Or will I have to re-route mouse events?

View 2 Replies

ActionScript 3.0 :: Override Event Target - Move Other Sprite According To The Mouse Events On The Stage

May 27, 2009

i am trying to do a simple blackboard on mouse down, start drawing on mouse move, if drawing, draw line on mouse up, stop drawing i set the listeners on a simple clip with a rectangle. if i dont fill the rectangle, the mouse events wont fall into the rectangle, but if i fill the rectangle, it will paint behind the rectangle, so anyway i wont see any succesfull results. what i did was create another sprite and paint within it; something like

[Code]...

View 3 Replies

ActionScript 3.0 :: Textfield.htmlText Link Doesn't Receive Mouse Events Underneath Sprite?

Oct 28, 2010

TextFiled is not receiving mouseEvents, coz of the sprite on top:

[Code]...

View 3 Replies

ActionScript 3.0 :: Make A Unique TweenFunction For Different Buttons Mouse Events?

Oct 27, 2009

I'm developing a web site which needs animation for buttons in the Mouse_over and Mouse_out state.[code]...

What i want to do is change the red text which is the button to be animated for a variable which gets the name of the button in which the mouse event is taking place. This way i dont have to do a function for each button. [code]...

View 1 Replies

ActionScript 3.0 :: Make The Music Override Or Ignore The Mouse Events?

Apr 24, 2009

I need to have background music playing in a movie that has multiple tabs for the user to click on and go to different frames in the main timeline. I want background music throughout the movie, but it is interrupted by the mouse events. It skips to whatever frame the tabs are associated with. how I can make the music override or ignore the mouse events? I'm new to Actionscripting.

View 6 Replies

Actionscript 3 :: Make A Button Respond To Mouse Events Which Is Placed Under A Movie Clip?

Jan 4, 2011

if I attach two movie clips MC1 and MC2 on the stage.MC1 has a simple button also. MC2 is transparent.First I attach the MC1 and then I attach MC2. Both on the stage. So obviously, MC2 is added over the MC1. In this situation, I cannot click the button which is place in the MC1.If Im not wrong, in AS2, if the MC2 is transparent, the button in the MC1 can still respond to the mouse events.

View 1 Replies

Flash :: Make Flex Only Consume Mouse Scroll And Keyboard Events?

Feb 5, 2011

This one's been irking me for a while. When I'm using the mouse scroll wheel to scroll up and down in a webpage, and a flash movie comes into the path of the cursor, the scroll wheel stops working. Also, when a flash movie has focus, you can't use browser shortcuts like Ctrl + L or Ctrl + R.

I'm writing a flex application now and I'd like to find a solution, so that at least my users aren't plagued by this inconsistency of the user interface behavior.

I should think there would be a way to tell flash to propagate such events as the mouse scroll wheel and keyboard input back up to the browser unless they occur in an element for which they are useful, like in a flex textarea. I can't find any solutions out there though, nor even anyone talking about it.

Specifically, how can I make it so that:

When the user is scrolling with the mouse, the browser scrolls unless the mouse is over a flex container with scrollbar, or another component that wants to scroll.When the user presses a button or combination of buttons on the keyboard, it will be propagated to the browser unless there is an active keyboard listener, or the cursor is in a text field, etc.

View 3 Replies

Flash :: Make Movieclips Respond To Mouse Events With Invisible Button On Top

Dec 2, 2011

I have a banner with big invisible button covering the stage and underneath it I have movieclips which must respond to mouse events. But I can't get through invisible button. I only get button events and cant interact with movieclips underneath it. Here's simple code:

invisibleBtn.addEventListener(MouseEvent.CLICK, onTopClick);
bottomMc.addEventListener(MouseEvent.MOUSE_OVER, onBottomOver);
function onTopClick(e:MouseEvent):void{

[Code]....

View 4 Replies

IDE :: Make The Transparent Area From An Png Image Not To Register When I Add With A Mouse Event To That Image?

Apr 11, 2009

Is there a way to make the transparent area from an png image not to register when I add with a mouse event to that image? What is happening is the rectangle around the symbol is effected by the mouse event.

View 2 Replies

ActionScript 3.0 :: Control Mouse Events With Other Mouse Events?

Feb 12, 2012

Right now all the sounds (78 of them) on my guitar play using the roll_over event but that doesn't give the user much control over what sound is played.
 
The actionscript im using to play my sounds is this;
 
for(var i:uint = 0; i < buttonArray.length; i++){
buttonArray[i].addEventListener(MouseEvent.ROLL_OVER, buttonRolledOver);
}

[Code]....
 
What i want to do is only play a sound with the roll_over event when the left click is held down.

View 18 Replies

Flash :: Transparent Sprite With Event Mouseover

Dec 27, 2011

I have a actionscript "Sprite" class which load a transparent png. When i set a "mouseover" event over the Script, it is throw when the mouse goes over the "square" containing the transparent png. I would like a glow effect to be displayed on mouseover, but only when the mouse is on the displayable part of my transparent .png. How can i do to throw the event only when the mouse is not over the transparent part of the png? Do i have to check by myself in the mouseover handler then do what i have to do?

View 2 Replies

Actionscript 3 :: Iphone - Touch Events Vs Mouse Click Events?

Jan 11, 2012

Just wanted to ask if there is any advantage for either using mouse click event or touch tap events, when writing apps for mobiles or tablets (for the iphone especially)?

I know that both of them should work fine, but in term of performance, is anyone better? Are there any things I should be aware of when choosing either?

By the way am using actionscript3 to implement the app.

View 3 Replies

ActionScript 3.0 :: Mixing Stage Mouse Events And Children Events?

Sep 30, 2009

I have an animation that I want to start when clicking on the flash window. However, I've also have some buttons on the stage. If I add an event listener for MouseEvent.CLICK on the stage, then it 'eats up' the events and the buttons don't work.

I've tried some tricks, by adding some invisible buttons on top of the real ones, and use the MOUSE_OVER event to selectively enable/disable the mouseEnabled flag for the stage, but didn't work because it complains that the property or method doesn't exist (which I find odd).

View 3 Replies

Making An Image Transparent In The Area Of The Mouse While Mouse Button Is Down?

Mar 25, 2010

I would like to make a flash movie with a picture, where when the user holds down the mouse button, part of another picture will emerge in that general area (like a magnifying glass looking into another dimension).

Technically, my idea was to make a flash file with two images, and then code the mouse to be able to make the top picture transparent in a circle-like area around the cursor, while the mouse button is down.

But how to do that? I am using Flash CS4, but I don't really care if the solution is in AS2, or AS3, as long as it works

View 2 Replies

ActionScript 2.0 :: Disable Mouse (no Transparent, No Mouse.hide()), Just Turn It Off

Nov 6, 2010

I dont know if it is possible, but I need to disable reaction on mouse.

Here is the example. Dont worry about the second snowboard. If mouse remains on the first, movie still replay over and over. How do I stop it?

[URL]

View 1 Replies

Flash :: Narrow A Rectangle Within A Sprite To Exclude Transparent Pixels?

Oct 2, 2011

I have a Sprite that contains opaque objects surrounded by transparent pixels. I also have a Rectangle that represents a part of the Sprite that I want to render using BitmapData.draw(). The problem is that the Rectangle that I obtained also contains transparent parts. How can I narrow the Rectangle to only include the opaque parts and ignore the transparent surroundings?

kapep's answer is just what I want to do, but the problem is that the source is a Sprite, not a BitmapData object, and I don't have getColorBoundsRect() on a Sprite.

View 2 Replies

ActionScript 3.0 :: Explosion Generator With Many Options To Play With And It Saves A Transparent Png Sprite Sheet

Jul 8, 2010

Here's a link to a particle explosion generator with many options to play with and it saves a transparent png sprite sheet: [URL] The same particle engine is used in my latest game:Tank Rush. But since my next game will use only sprite sheets for effects, I created this generator out of the tank rush engine.

View 2 Replies

Flex :: Sprite Not Receiving Keyboard Events?

Jan 14, 2011

I have a Sprite which is a child of a Flex object, and acts as the main "game window". So during game-play it should get keyboard input but at other times not. When I add a keyboard listener to it, it never fires.

Do I need to stop parent objects 'eating' the events somehow, or something similar? I get the same thing with mouse-wheel events, but mouse-click events are fine. Sprite doesn't seem to have the concept of focus unless I missed it.

More generally in this kind of approach, are there any suggestions on the best way? For instance some keys might still be needed to be intercepted before getting to the game-window, like ESC or F1 or something... the aim is the game-window isn't aware of other UI.

View 3 Replies

ActionScript 3.0 :: Duplicate A Sprite With All Its Children And Events?

May 10, 2011

I am trying to duplicate a sprite that I loaded a bunch of images in from an xml.

I even tried senocular's way of duplicating display objects and it just returned an empty sprite.

View 2 Replies

ActionScript 3.0 :: Movieclip Being Dragged Is Blocking The Mouse From Initiation Mouse Events Properly?

Jun 2, 2010

In a project i'm doing I have a custom cursor, using the start drag command and mouse.hide. the issue being that the movieclip being dragged is blocking the mouse from initiation mouse events properly.

View 3 Replies

ActionScript 3.0 :: MOUSE_OVER Listener - Animation Is Triggered Both On Mouse Over And Mouse Out Events

Aug 2, 2009

I have a movie clip I am using as a button (instance name btn1) and I added an event listener to it (using the following line): btn1.addEventListener(MouseEvent.MOUSE_OVER, animate1); the function "animate1" triggers some small animation when the mouse is over the movieclip. my problem is that the animation is triggered both on mouse over and mouse out events.

View 5 Replies

ActionScript 3.0 :: Mouse Events Fail To Trigger If Mouse Move Too Fast?

Nov 18, 2009

It has been awhile since I have worked in flash.Right now I am working on something where I would like a panel to disappear when someone mouses off the stage.stage.addEventListener(Event.MOUSE_LEAVE, leaveHandler); It usually works fine but if I move my mouse really fast it doesn't fire. I have also tried the same thing using a custom invisible button that surounds the perimeter of the stage and I have tried ROLL_OVER and MOUSE_OVERand again, if I do it too fast my event doesn't fire (I am using trace)I can't find anything on the net about this - is this typical of flash that if you move your mouse too fast you break it? Do I need to increase my frame rate (I would really rather not because I have perfectly timed animations - I am at 30 frames per second)

View 1 Replies

ActionScript 3.0 :: Using Mouse Events (mouse Leave) For Conditional Statements?

Dec 14, 2010

I have a menu drawer at the edge of the screen that shows when the user rolls the mouse over it, but if the user overshoots it an moves the cursor slightly outside the browser window this is unfortunenatly registered as a mouse out.

I want to stop this by using event.MOUSE_LEAVE, but i need to use it as a condition not to triger a "leaveHandler".

View 3 Replies

Flash - Flex 3: Preventing Keyboard Events From Reaching A Sprite?

Feb 9, 2012

I'm working on a Flex 3 app, implemented in Actionscript 3 and MXML, that includes an embedded video player, which is essentially a black box--I load it as a SWF from another site on demand, and I don't have access to its source code. It does, however, inherit from Sprite.The problem is that, when focus is on the Flash app, the video player is somehow receiving and processing keyboard events, even when the player itself isn't in focus.So when users are typing text elsewhere in the GUI, if they hit the space bar, the video pauses.

I've tried intercepting key events in the Sprite's parent, and setting tabEnabled = false, tabChildren = false, and buttonMode = false on the Sprite, but nothing seems to work. It's as if the Sprite is getting keystrokes through an alternate Event path.how I can prevent the player from receiving keyboard events or input events entirely? It's fine with me if no input events reach the player, since I've implemented my own,separate video controls.

View 1 Replies







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