ActionScript 3.0 :: Drag An Object That Is Behind A Transparent Png?
May 30, 2010
have in my movie clip a png image with a Hole.
And I have another picture behind the png.
I've used this code to drag the picture:
Quote:
nave.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
nave.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
function mouseDownHandler(evt:MouseEvent):void{
[Code].....
It works well, but only if the picture is is Front of the PNG image.
View 2 Replies
Similar Posts:
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
Jan 21, 2009
I have a simple Flash movie which loads several external PNG-24 images into movie clipsEach movie clip is partially transparent (using alpha transparency), and made drag-and-droppable. Everything works properly except that for each movie clip, I am able to drag and drop the clip using the transparent space around the image. I want the "grab-able" area of each clip to correpond to only the non-transparent areas of the PNG, not a rectangular box around each movie clip.
View 2 Replies
Mar 26, 2009
is there a way in action to group to object so when one object is drag across the screen the other object sticks with it, im using flash btw
View 6 Replies
Jan 26, 2010
Is there a way to transparent an object background which is imported into Flash? I have imported an object but it has with blue background color. I want to make its background to transparent.
View 1 Replies
Aug 25, 2009
I am developing a drag and drop functionality and take a JPEG screen shot of droped objects. my problem is. when i drag and drop an object the object jumps off some distance.. i am unable to clear tat.. Below is my application.as file
[Code]...
View 4 Replies
Oct 12, 2009
[URL] Comes in handy with jpg and gif elements in html.
View 1 Replies
Jan 31, 2011
Getting this little button to properly highlight in it's "over" state when it is behind another object with transparency.[url]...
View 1 Replies
Mar 17, 2010
I have several objects that share a single mask. I can see all of them when wmode is set to window but i want the background image on the page to show through the flash and have designed the flash around that. However when I set the wmode to transparent some of the objects don't render at all even though others do and they share the same mask.
View 3 Replies
Aug 13, 2009
Is it possible to export a 9-slice scaled object as a transparent PNG? At the moment File > Export > Export Image > Transparent PNG will not output any 9-slice objects. This is quite a hassle, since I can't seem to get these objects transparently into Photoshop or Illustrator (both CS4) - what's the use of working with 9-slice objects if you can't export them flattened even to other applications? I use them extensively, but looks like I will have to convert them all the separate movieclips without this cool functionality, since it is more a pain than anything else once you need to use these graphics outside Flash CS4.
Am I missing something? "Work seamlessly between Adobe apps" is starting to sound more than a marketing/sales pitch than an actual reality. I have tried export these images as EPS/AI to open in Illustrator CS4 - they don't come out correctly at all / gradients messed up / errors on open. So, no more 9-slice scaling objects if I want to export to tranparent PNG from the IDE?
View 4 Replies
Mar 17, 2002
I need to know how you drag an object into another object and when the click is released it goes to another frame, and if you release not touching the other object the draggable object will go back to the place it started in
View 7 Replies
Dec 20, 2010
I'm having troubles getting the dimensions I'm looking for for a given display object. This display object has some transparent area to the top-left of the opaque content but to the bottom-right of 0,0. As such, the display object's reported width ONLY includes the opaque area, not the transparent area. For example:
Code:
var myChild:Sprite = new Sprite();
myChild.graphics.beginFill(0xff0000);
myChild.graphics.drawRect(100, 100, 100, 100);
myChild.graphics.endFill();
trace(myChild.width);
This reports 100 as the width and height. I need to somehow retrieve 200 as the width and height.
I'm trying to take a bitmapdata snapshot of the display object, but when I do new BitmapData(myChild.width, myChild.height) and then draw into it I don't get the full opaque content of myChild drawn because the dimensions are too small.
View 3 Replies
Dec 5, 2011
I have a flash object which dimension and position are as same as the HTML button. The button is under the flash object. I want when the flash is clicked and hovered, the button has the styles as if it is clicked and hovered at the same time. I am trying to call: ExternalInterface.call("mouseEventHandle", elementId, eventName); in flash to pass event to JS. And in JS(coffeescript): window.mouseEventHandle = (elementId, eventName) -> id = '#' + elementId switch event when "down" then console.log("down") when "up" then console.log("up") when "enter" then console.log("enter") else console.log("leave") # leave the function is responsible for styling the HTML button. The question is how to style the button under in JS? Or is there other way to achieve the goal?
View 1 Replies
Oct 17, 2010
I imported a video into flash and have a transparent photoshop layer to create an iPod skin. The video works fine, but I cannot get the "stage" to be transparent so that you do not see the flash background color behind the iPod skin.
I've read in the forums and have followed the instructions here from Adobe. If you look at my code, I have
[Code]...
View 6 Replies
Feb 5, 2012
I'm trying to draw PNGs onto BitmapData that is transparent.
I create my BitmapData like this (using ARGB for the color):
new BitmapData(width, height, true, 0x00000000);
And clean it by using the same ARGB value:
bitmapData.fillRect(bitmapData.rect, 0x00000000);
When I use copyPixels() to draw graphics onto the cleaned BitmapData, I get this result:
If I don't use ARGB for the BitmapData color, it works fine:
But I have to specify a solid fillColor, meaning I can't render what's behind the Bitmap.
How can I make my BitmapData transparent, but not have the above occur?
View 1 Replies
Feb 27, 2010
I am creating a map in flash cs4 with all the countries on it. I used photoshop for creating the map and separated countries. Now I imported all pngs in Flash and I want to give Mouse CLICK event and Mouse Hover on all pngs, but as the transparent pixels are overlapping the other states, it is getting difficult. So, I converted all pngs in movieclips and now then I broke up pngs. Now I want to delete all pixels having alpha 0 using eraser tool, as per the borders. And I have to do it manually for individual countries. So is there a way to remove transparent pixels from the bitmap data?
View 2 Replies
Jan 4, 2011
i need a way to use one object to drag another object in a movie.one object, when clicked and mouseover-ed onto another, should drag the other clip as well.and i've been reading that you can only drag one object at a time when it comes to as3.
View 1 Replies
Oct 16, 2009
I want to drag an object on this path or random path .If you are not getting my point Please look on the attached image.or look to this link.
View 5 Replies
Mar 10, 2011
I am able to drag a copy of an object and drop it on the canvas, using drag-drop manager functionality in Flex.
The original object remains unchanged and a new copy of the object is created. However, If i further want to drag this copy and position it differently on the canvas, I find that the object is not draggable.
Since this copy is created at runtime, I am not sure how I can achieve to drag it? [code]...
View 1 Replies
May 26, 2011
I have an object I need to rotate by clicking and dragging. Following some AS2 code I got the object to rotate a bit every time the mouse is clicked, but can't get it to work with drag.
needle.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);
function fl_ClickToDrag_2(event:MouseEvent):void
[Code].....
View 1 Replies
Jan 14, 2007
I'd like to have some graphic object which is possible to drag along the VA path. I've tried something to do but no success. The path is a random up-down hills. Exactly like the Motion guide does it.
Maybe some solution: put some object on the motion guide, create some possition sniffer, apply position to the drag-object.... but there's the problem how to obtain the direction of the drag... even when I use Beziere curve, the right direction still persists...
View 3 Replies
Jul 6, 2009
I want to drag an object on this path or random path. If you are not getting my point Please look on the attached image. or look to this link. [URl]
View 1 Replies
Apr 3, 2012
To get flash to sit behind html elements on a page I read that I have to add this inside the object tag:
<param name="wmode" value="transparent"></param>
And this to the embed tag:
wmode="transparent"
Is it necessary to add both? Because in FF I got it to work with just the second, just wondering if that may cause issues in other browsers and devices.
View 1 Replies
Apr 24, 2010
I have a page which displays dynamic flash content from issuu.com. I need to add wmode="transparent" because otherwise navigation menu shows under flash. Is there a short way to do this with jQuery or simple java-script?I don't want to change embed code every time a flash is added.
View 4 Replies
Mar 29, 2011
[URL]I got it working but the problem is, is when i go to the next frame the items that are matched succesfully stay there, I want to know how to clear them, so they don't get in the way of the next frames.
View 10 Replies
Feb 6, 2010
Would like to develop simple (in browser) puzzle games where shapes (such as a puzzle piece shape) can be simultaneously dragged and rotated, then dropped on the screen or canvas. The game mode would be to click and drag the shape or object, while simultaneously rotating the piece using arrow keys Is this possible in Flash? This simple general activity of simultaneous drag and rotate, then drop, is my intended overallweb site game basis. I'm new to Flash but have developed Windows executables for many years. I'm trying to decide whether to purchase and learn Flash as platform for interactive educational puzzle games running in browser windows.
View 4 Replies
Oct 10, 2010
Stuck on this big time. Using as2. I have a draggeable record. I want a button on the record that when I hit it, it plays a sound. I've attached the source. I've tried a few different tests and I've figured out that the onpress action of the main mc itself I believe acts for the mc of the speaker. I want the record draggable but need to have the speaker activate if i hit it.[URL]..
View 1 Replies
Dec 28, 2010
i want to drag and drop movieclip, but its restricted path should be circular instead of rectangle.
View 3 Replies
Mar 29, 2011
I got it working but the problem is, is when i go to the next frame the items that are matched succesfully stay there, I want to know how to clear them, so they don't get in the way of the next frames. Maybe it is something simple?
View 22 Replies
Sep 16, 2010
I need to drag a component along a programmatically drawn path composed by different kinds of graphic, like lines, curves, etc.
View 3 Replies