ActionScript 1/2 :: HitTest For Rectangular MC Over Irregular Shape

Jan 15, 2010

In my app, a user must drag and release a rectangular mc object (rectx) over an irregular shape within another mc object (irregx). There are 13 rect/irreg pairs. Each obj shares an AS2 file that checks whether rectx is over irregx, and proceeds _only_ if the check is true. The script uses hitTest, on mouse release, to grab the number (x) of the rectx being dragged and checks whether it's over irregx. Right now, the check comes back true when rectx is _anywhere_ inside irregx's bounding box whether it's over the actual image or not.

I've noticed that, when the (unpressed) mouse rolls over any irregx, it's oblivious to irregx's rectangular bounding box. It only reacts when it reaches the edge of the irregular shape inside, toggling from arrow to hand at the image edges. Since the mouse knows where the irregx image boundary is, is there a simple way to tap the mouse's 'eyesight' to verify whether rectx is over the correct irregx shape (meaning not just within the bounding box, within the shape inside it)? This can't be that hard.

View 6 Replies


Similar Posts:


ActionScript 3.0 :: Draw The Shape Of A Existing Movieclip Which Is Irregular Shape?

Oct 11, 2011

need to draw the shape of a existing movieclip which is irregular shape.

View 2 Replies

ActionScript 3.0 :: Draw The Shape Of A Existing Movieclip Which Is Irregular Shape

Oct 11, 2011

need to draw the shape of a existing movieclip which is irregular shape.

View 1 Replies

Button In A Different Shape Than Rectangular?

Aug 2, 2009

is it possible to make button in a different shape for example i have a figure that i cut from image on a transparent background an i was wonder if it is possible to make that person in to a button but just that person not the transparent background.

View 1 Replies

ActionScript 3.0 :: Change Shape Of This Rectangular Bounding Box?

Feb 18, 2010

I have a movie clip which contains a circular image, and by default Flash CS4 gives it a rectangular bounding box. This is a problem however because I am using this movie clip as a button, so the rollover area includes the entire rectangular bounding box and not just the circular image. How can I change the shape of this rectangular bounding box?

View 2 Replies

Flex :: Crop Image Using A Non-rectangular Shape?

Oct 30, 2009

I've been following this tutorial to crop images in flex: [URL]

At the heart of its cropping is using a method called "copyPixels". However, this method takes as one of its arguments a rectangular shape for its crop region. Are there other strategies I can use to crop it not using a rectangle.

I am going after letting the user specify the region that should be cropped using a series of points.

View 1 Replies

ActionScript 2.0 :: Using Hittest For A More Irregular Object Than A Circle?

Dec 15, 2004

ive recently made a game in which you have to avoid some big evil round planets. i found out the in the making of that that using the function hittest uses square objects. i dident bother much then with it, i just brought out the ol'e algebra book and looked up the distance formual and made my own hittest. now my questyion is is there a more refined way of using hittest for a more irregular object than a circle.

I made somewhat irregualr objects have hittest boxxes so that it was split up into many smaller parts, this gets kinda tedious if its really irregualr or if i need to move it around on the screen btw if anyone wants ta c the game i made [URL] avoid everyting , and shop at the store on the planet , u can go over the big planet in lower left corner but not the ones in orbit a few bugs still like only way to restart is the reload button in browser

View 2 Replies

ActionScript 2.0 :: CopyPixels With Irregular Shape

Jan 19, 2009

Can anyone tell me if I can copyPixels with an irregular shape instead of just a rectangle?

View 0 Replies

ActionScript 2.0 :: BitmapData Onto Irregular Shape?

Dec 10, 2007

How can I attachBitmap to an irregular shape?I load a pattern into my movie (pattern.jpg), it is a square image 500x500. I want to draw that image onto an irregular shape. If I do the following it simply shows the large square overtop of my shape. The pattern isn't actually applied to my shape.

Code:
var bitmap:BitmapData = new BitmapData(500, 500, true, 0x00000000);
myShape.attachBitmap(bitmap,1,"auto",true);
bitmap.draw(pattern);

View 2 Replies

ActionScript 3.0 :: Draw A Line That Goes Around An Irregular Shape?

Apr 21, 2011

I am trying to draw a line that goes from point A to Point B. Along the way there are objects (of any shape) that force the line to go around them in order to reach point B. It cant go through them. This is like directing someone using a map. You can only draw a line between the blocks / along the streets.

I tried that using collision tests. Fine, I can now find the coordinates at that instance, but I still cant get the line to go around the object before proceeding to point B.

View 0 Replies

ActionScript 2.0 :: Restrict A Draggable Object To A Non-rectangular Shape (like Triangle)

Jun 23, 2007

whats the best way to restrict a draggable object to a non-rectangular shape (like triangle) I did it with hittest but i cant get it to go to the nearest point when the cursor is outside the shape...

View 5 Replies

ActionScript 3.0 :: Crop Image But With Use Of Rectangle Class Or In Rectangular Shape

Apr 17, 2009

I am having some problems regarding image crop.I am able to crop an image but with the use of rectangle class or in rectangular shape.But i would like to crop in circular shape(for example go to URL...).

View 8 Replies

ActionScript 3.0 :: Make The Irregular Shape Of The Silo The Hit Area?

Jun 18, 2009

I'm using actionscript to place a bitmap into an empty movieclip like so:

var bitmap_mc:MovieClip = new MovieClip;
addChild( bitmap_mc );
bitmap_mc.addChild( bitmapPNG );

bitmapPNG is an irregular shaped png of a person, but when I use the movieclip as a button, the hit area is the square shape of the movieclip, not the silo. How do I make the irregular shape of the silo the hit area, and not the surrounding square of the moviclip?

View 2 Replies

ActionScript - Display Flash Video In Irregular Quadrilateral Shape

Jun 20, 2011

I'm a novice to Flash and I've been trying unsuccessfully to display video with defined irregular dimensions (practically a quadrilateral with various edge size). Would that be possible? I see that there are only several customization options:
1. Positioning in a plane defined by (x,y) that corresponds to the position of the top left corner of the video.
2. Width and height.
If it's not possible in flash, are there any other options with programmable features like that of flash?

View 1 Replies

ActionScript 3.0 :: Crop A Specific Irregular Shape From An Imported Image?

Jan 18, 2010

How can I crop letteraly crop a part of an imported image into a specific irregular shape that already exists on the stage as a MovieClip... a jigsaw puzzle piece for example ? (it would be prefered not to use masks).

View 3 Replies

ActionScript 2.0 :: Making Animation To A "rectangular Shape" And Converted To An Mc

Dec 12, 2003

ive started making a menu but nothing technical just animation to a "rectangular shape" as and converted to an mc..

[Code]....

View 3 Replies

ActionScript 2.0 :: Animation To A "rectangular Shape" And Converted To A Mc?

Dec 12, 2003

ive started making a menu but nothing technical just animation to a "rectangular shape" as and converted to an mc..Ive applied actions to the shape mc like this:

onClipEvent (enterFrame) {
var speed = 4;
var viscosity = 1.3;[code]....

View 3 Replies

ActionScript 3.0 :: "MouseEvent.ROLL_OVER" On Irregular Shape?

Apr 10, 2011

In my design I've got a button which is styled in a unique shape. It ties in directly with another button. The simplest way to describe the button is a regular square split into two diagonal shapes (except the hypotenuse is curved).Well, I said Button, I've actually created the button as a MovieClip.Inside the movieclip I use code resembling the following:

ActionScript Code:
this.addEventListener(MouseEvent.ROLL_OVER, myFunction);
function myFunction(event:MouseEvent) {

[code]......

View 9 Replies

ActionScript 2.0 :: Way To Do A Shape HitTest

Jul 9, 2009

I'd like to know if there's a way to do a shape hitTest.Not as the normal hitTest would do, but shape colliding another shape, not the rectangle
of a movieclip.This shape can be in a movieclip, of course ).If there's this way, please make it in a way that our processors would thank you.

View 1 Replies

ActionScript 2.0 :: Set The Hittest To False So It Just Reads The Box Of The Clip, And Not The Shape?

Sep 15, 2002

I can't get the hit test (true) to work on a clip that animates (all it does is grow in size). If I set the hittest to false so it just reads the box of the clip, and not the shape it works just fine. The clip in question is simply a circle.

View 11 Replies

ActionScript 2.0 :: HitTest And Positioning - Create An Invisible Movieclip That Has The Exact Size And Shape Of The Animated Movieclip

Aug 23, 2005

This is the third thread I've written for my current project (1st was answered perfectly, 2nd failed [but I still figured it out anyways]) but I'm not sure if there is a solution to this problem. I can't really explain my problem, so once again I've included a helpful animation to show you what I mean. Bear in mind that the pale-blue box represents the movie clip's borders, and those borders are usually changed to include the animation (instead of the borders moving with the animation, the borders get bigger).

For the animation problem, I've already got a solution: create an invisible movie clip that has the exact size and shape of the animated movie clip and make it follow the movie clip as it animates, and make the hitTest check the invisible movie clip instead of the animated one. As for the rotation problem, well, I don't know how to fix it. Is there a way to change that?

View 1 Replies

ActionScript 3.0 :: New Shape - 1046: Type Was Not Found Or Was Not A Compile-time Constant: Shape

Nov 30, 2009

ActionScript Code:
package {
import flash.display.MovieClip;
public class Base extends MovieClip {
public var baseHP:int = 50;
var newRect:Shape = new Shape();

1046: Type was not found or was not a compile-time constant: Shape. 1180: Call to a possibly undefined method Shape. What does it mean by "undefined method"? I am somewhat of a newby, so sorry if there are any stupid errors

View 1 Replies

Professional :: Adding Shape Hints Makes Shape Disappear In Between Frames

Jun 22, 2010

Whenever I add shape hints to a shape tween the shape disappears in the between frames. I am using CS5 on Vista. I using files from [URL]to practice.

View 2 Replies

ActionScript 3.0 :: Non-Rectangular Buttons With Images?

Feb 11, 2009

is it possible to create a non-square "button" in flash cs4 programmatically using as3?

Using a xml document, i'm trying to be able to retrieve a png file with transparency, and have said transparent area's be not clickable.

Long story short, I'm creating a map with a bunch of clickable areas. These areas are non-rectangular and I need them to not obscure other area's which would be in their rectangle. I need this to be done programmatically since the area's are going to be dynamic as is the data attached to them.

fyi: I have a fairly good grasp of OOP, so don't be afraid to post up complex instructions.

View 8 Replies

ActionScript 3.0 :: Fit Bitmap To Non Rectangular MovieClip?

Nov 27, 2009

I'm loading bitmaps dynamically using AS3 and I'd like to fit/tile them within a movieclip. (like a texture but in 2D)

However, my movieclip is not rectangular and everything I tried resulted in the texture getting out of the boundaries of my movieclip and being displayed as a big rectangle.

View 5 Replies

ActionScript 2.0 :: Using A Non Rectangular Drag Boundary?

Jan 17, 2007

When you call startDrag on a Sprite/MovieClip/whatever, you can specify a rectangle which the object in question will stay within.

Eg... startDrag(false, rect1); where rect1 is of type :Rectangle

how you would go about constraining the dragging to an arbitrary shape, say a triangle or a circle rather than a rectangle?

I figure I could just have a Timer calling a function to check the whole time but that doesn't seem particularly nice.

View 1 Replies

ActionScript 1/2 :: Shape Colliding Another Shape, Not The Rectangleof A Movieclip?

Jul 9, 2009

Id like to know if there is a way to do a shape hitTest.Not as the normal hitTest would do, but shape colliding another shape, not the rectangleof a movieclip.It can be in a movieclip.

View 23 Replies

ActionScript 3.0 :: Specify Rectangular Region Zoom Into Video

Jul 3, 2009

If it's possible to zoom into a video? For example specify a rectangular region in the video and zoom in.

View 1 Replies

ActionScript 3.0 :: Getting The Average Pixel Value Of The Rectangular Area Behind A Mc?

Nov 28, 2009

I have a vector movie-clip of a cat. Behind it, there is a picture of a park. The picture of the park takes up the entire stage, but the cat is only 32x16. How could I use BitmapData to sample all pixels (of everything, not just the park) within the cat's bounding box (but not including the cat itself in the samples (so like the cat is invisible); also 4 pixels wider in each direction, so it would effectively be 40x24) and then return the RGB average (in hexidecimal) so that I can set a masked transparent mc in front of the cat to that value?

Basically, so it looks like the color of the cat's surroundings affect its tint, to crudely simulate global illumination in 2d.

View 1 Replies

ActionScript 2.0 :: Create An "hitTest" Script Inside A Movieclip That Is Actually Part Of That HitTest Code?

Jan 15, 2009

i just would like to know how to create an "hitTest" script inside a movieclip that is actually part of that hitTest code?I mean... I have mc A, and mc B. and the current hitTest code im using (that is on the timeline) makes mc A, destroy mc B when collide with it... but there are many mc B on the stage (with the same instance name) so, when mc A collide with one mc B, it destroys ALL mc's B... but i want it to destroy only the mc B that he collides, not all the others... maybe an hitTest script inside a movieclip B would work (somethig like "if MC A hitTest ME = i die" (not all the others)).

View 1 Replies







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