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


Similar Posts:


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

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

Use Semi-transparent Mask On External Swf?

Sep 12, 2009

I want to use semi-transparent mask on external swf for smooth transition. I'm using

clip.cacheAsBitmap = true;
mask.cacheAsBitmap = true;
clip.setMask(mask);[code].....

it doesn't work... what am I doing wrong?

View 7 Replies

ActionScript 3.0 :: Set Alpha On Semi Transparent Png?

May 3, 2009

I've been developing in AS2 for a few years now, and I'm learning AS3 at the moment. I ran into a problem about setting alpha on a PNG image.

I have a movieclip that holds a semi-transparent PNG image which comes straight from the library. Now I want to edit the alpha property of the movieclip. In AS2 it all works fine but when I set the alpha property in AS3 all semi-transparent pixels in the PNG image will fill with black first; then the alpha setting is applied.

Do I need to save my PNG's in particular way or do I need to edit settings in Flash to display correctly?

View 1 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

Professional :: Semi - Transparent Box That Can Execute Php Commands?

Feb 10, 2010

I am trying to find out if it is possible to a) create a semi transparent box in flash, b) motion tween that box into place, c) subsequently use it to run forms and PHP scripts (connect to a MySQL instance, ect). I know that an exact answer to c) will be long and complex, so a simple (general) yes or no will suffice... but if someone could point me in more detailed direction with a) and b), If you need to see the actual project I'm working on, or if I need to clarify my questions,

View 1 Replies

ActionScript 3.0 :: Glowing Semi Transparent Objects?

Oct 8, 2009

Once I have a semitransparent object (with alpha not equal to 1) and put a glow filter on it, the glowing area is visible not only near edges of an object, but also under the object. It changes the whole look of an object, while it (probably by my logic) only should have changed the look of edges.

how to glow (or drop shadow) only edges of an object?

View 2 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 - Adding Semi Transparent Grey Rectangle Behind Popup?

Nov 30, 2010

I'm trying to make a modal pop up in my Flash application, not unlike the ASP.NET version seen here. I've already got the dialog box made, but I'm trying to add a semi-transparent gray rectangle over everything behind the pop-up, again like the one used in ASP.NET. Is there a way to do this in ActionScript? It needs to be semi-transparent, not fully, so you can still partially see what's behind it. I'm assuming you could apply this property to a Shape class somehow.

View 3 Replies

ActionScript 3.0 :: Full Browser Image With A Semi Transparent Background?

Aug 24, 2009

Currently I have link on an HTML page, and when the link is clicked, it opens a flash movie with slideshow and a semi transparent black background. The way I have it set up is as follows

CloseButton.as (the close button for the slideshow)
FullBackground.as (the black background)
MainContent.as (loads the slideshow)

then I have

main.fla (loads the CloseBtn, FullBG, and MainContent)
preloader.fla (loads the main.fla .swf)

View 1 Replies

ActionScript 3.0 :: CurveTo - Poor Alising - Draw A Basic Shape Outline With A Semi-circle At The Top

Nov 30, 2009

I'm just starting out with AS3, so I'm trying my hand as some of the more basic drawing functions, to try and get a handle on them. The problem I've hit is using 'curveTo' to create a smooth curve is creating some very poor aliasing results. Here is an example: [URL]

The first part (which is actually on the right) is a very simple curve from 50,50 to 100,100, through 100,50. I would have expected the end points of the line to be single pixel width, but it's aliased over two pixels.

The second part (on the left) shows why this is a problem for me. I'm trying to draw a basic shape outline with a semi-circle at the top, but it really doesn't look great (it looks shifted half a pixel to the left relative to the rest of the shape).

[Code].....

View 2 Replies

ActionScript 3.0 :: Add The Shadow Filter, Parts Of The Shape Get Transparent?

Feb 4, 2011

I have some code that builds a shape and adds a shadow filter. If I use a single call to make the shape, like drawRect() or drawRoundRect() all looks fine including the shadow. However, when I do something like:

Code:
shape= new Shape();
shape.graphics.beginFill(0xfffffff, 1);
shape.drawRect();[code]...

The boundaries of these draw calls do overlap each other. The final shape by itself looks fine. But as soon as I add the shadow filter, parts of the shape get transparent. I belief it has to do with the various draw calls within begin and end fill.

View 1 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

Actionscript :: Fill Solid Color Into The Shape Of A Transparent PNG File?

Apr 11, 2012

For example, I have a transparent png file, the shape is a car.In the png file, I only draw the white border shape.Outside and inside the border are all transparent.

I want to use actionscript3 code to show the car object with different color, it means only fill color inside the border, and for the outside of the border, keep transparent.How to do that?

So far, the simplest workaround is to prepare many images with PhotoShop, but it's not good enough for me. When I have many shapes and use many colors, I've to prepare many many images.Add more details:(Because I'm using white border, you may not see the basic png file if your background of browser is white)

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

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

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

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

ActionScript 3.0 :: Spurious Mouse Out Events When Moving The Mouse Down Or Right

Dec 4, 2008

why i am getting spurious mouse_out events when moving the mouse down or right but not up or left over a Sprite?

View 3 Replies

Flex :: Mouse-event - Using 2 Distinct Mouse Events?

Mar 14, 2011

I am looking to provide some UI functionality using the mouse- I have two distinct UI events to be achieved via mouse

a) change value
b) delete object

I don't seem to have sufficient mouseclick events for both. I am avoiding using the right click as it has some default options(whose signing off will affect the whole project- not just this). I have mouse click used for change value- how do I use the doubleclick as the single-click events seems to get invoked prior?

View 2 Replies

ActionScript 2.0 :: Mouse Wheel Not Stopping?

Sep 7, 2010

ive been trying to modify this text drag script to enable it to use the mouse wheel. ive managed to make it scroll with the mouse, but i cant seem to make it limit itself to the boundaries of the mask, like the dragger behaves. it just keeps scrolling upwards or downwards to infinity. i was thinking if there was a way to make it behave like the dragger.here is the script if u want to take a look. at the bottom i added the mousewheel listener and attached it to the dragger, and it works perfectly, but as i said, it doesnt stop like when you click it and drag it.

Code:
//code by Billy T
//set a variable

[code].....

View 2 Replies

ActionScript 3.0 :: Stopping Sound On Mouse Out?

Feb 12, 2009

I am having a very difficult time stopping the sound when I mouse Out. I originally included the sound directly on the Mouse Over frame in Flash, but it wouldn't stop, so i removed that and wrote the following code:

var snd:sherrin = new sherrin();
var channel:SoundChannel = new SoundChannel();
var Symbol1:SimpleButton = new SimpleButton();

[code]....

I got this to where I get no Output or Compile errors, but the sound still doesn't play.

View 0 Replies

ActionScript 2.0 :: Detect Mouse Stopping?

Jun 22, 2004

is there a way to detect a mouse stopping?I've created something that reacts to the mouse x & y position, just wondered if there was some way of detecting if it stops moving?

View 9 Replies

ActionScript 2.0 :: Detect A Mouse Stopping?

Jun 22, 2004

is there a way to detect a mouse stopping?I've created something that reacts to the mouse x & y position, just wondered if there was some way of detecting if it stops moving?

View 9 Replies







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