ActionScript 3.0 :: Percentage Overlapping Of Irregular Shapes?
Oct 29, 2009
I was working on a game idea where I have to compare one underlying movie Clip and the movie clip being dragged and dropped upon it ,are exactly overlapping each other or not. I am not able to think of a solution when using irregular shapes.
View 0 Replies
Similar Posts:
Jul 5, 2011
I have maze-like game and I'm trying to get the player mc to respond to a collision between the boundary mc.hitTestObject doesn't work since it's not a rectangle. Is there a way to do this?
View 7 Replies
Jan 10, 2009
I have a MovieClip that contains a GIF bitmap that is a non-rectangular object (e.g. a star). All the pixels outside of the star are Transparent. Is there a way I can somehow programmatically limit Mouse events to fire only when the mouse cursor is within the star region (but not in the rest of the transparent rectangular area)?
View 6 Replies
Mar 1, 2010
In Flex, I am trying to design 3 buttons similar to the image uploaded at [URL]
The mouse over/click on image should work only on red colored area of the button.
How can I manage the Mouse clicks or Irregular Button shapes in Flex?
View 3 Replies
Aug 17, 2011
I want to make a jigsaw puzzle in flash. I know how to create square kind of shapes. But I want to create this kind of irregular shapes. See the live demo of puzzles in the links shown
[URL]
I just want to how to create the irregular shapes.
View 4 Replies
May 26, 2009
I draw a shape with the AS3's drawing API, then I draw another shape that intersects the previous shape, both the shapes have fill in them, but the intersecting area does not have any fill. I am not able to manage the "direction" that the shape is drawn in. what I need is for flash to just fill everything up to the outer borders of all the shapes, how would i achieve this? I found this forum thread that has almost the exact same problem that i have, but it is not resolved. [URL]
View 4 Replies
May 26, 2009
I use AS3's drawing api to draw filled shapes, but when they overlap, instead of filling the overlapped area, it becomes clear again, with no fill.
My question is, how can i get rid of this behavior, i need to just fill everything, is there a way to somehow "flatten" the shapes?
View 5 Replies
Feb 17, 2009
I have a question about shapes (i mean the flash.display.Shape class). Is it possible to import Shapes directly from the library as Shapes and not as Sprites/MovieClips? Shapes are supposed to be faster than MovieClips/Sprites, right? So why is it only possible to import MCs/Sprites from the library? I understand that generally shapes could be created solely by actionscript, but in my case the shape comprises of many points and is curved - so it's quite infeasible.
Is there maybe some sort of plugin to generate code that would draw the desired shape from a drawn shape in CS4? And a last one: Are there any benchmarks out there for performance comparison between sprites/mcs/shapes? How much performance do i loose by using a sprite instead of a shape?
View 2 Replies
Feb 7, 2010
When I hit enter to play back my animation, it does not play at the 30 FPS at which I set it to. Instead, it ranges from about 15-20 FPS randomly going up and down throughout the whole animation. When I publish the animation as a .swf, it plays back just fine, at the normal speed. Just wondering why it's doing this, it was fine before.
View 5 Replies
Aug 14, 2010
What would be the best way to check if a user clicked on a sprite or movieclip if the sprite or movieclip contains irregular shapes.
View 2 Replies
Jan 19, 2009
Can anyone tell me if I can copyPixels with an irregular shape instead of just a rectangle?
View 0 Replies
Apr 5, 2010
I have a pair of triangular movieclips that are up against each other real snug and are practically touching. As a result their bounding boxes overlap so using onPress for them causes the one on the higher depth to be clicked. How do I use onPress to mathematically determine if the cursor is within some boundaries I set?
View 1 Replies
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
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
Apr 26, 2010
I am trying to create irregular Mask from Bitmap (Who has Alpha) and then apply it to Sprite. Then register mouse hover on sprite. My mask should be made considering bitmap Alpha, I need irregular shape Mask. I read somewhere that I should set cacheAsBitmap = true for Mask, then it will consider Alpha, but I can`t get it to work.
[Code]....
View 0 Replies
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
Dec 16, 2010
What I'm trying to do is hittest two irregularly shaped objects using their alphas and not the bounding box.
The code below hittests two objects named target 1 & target 2. This is not my code, but mine looks exactly alike, except target 1 & target 2 are replaced with my MC's. the thing is, I keep getting an error.At every function line, like the "public static function complexHitTestObject I get an error that says: Expecting right paren before left-bracket. I don't know what this error is caused by, because I can't really see why Flash wants another right paren.
[Code]...
View 6 Replies
Jul 15, 2011
I have a bunch of different Movieclips from about 10 different classes moving about the stage. What would be the fastest/most efficient way to detect collisions between two of them? They can overlap each other a bit before the collision is detected, so I thought the easiest way would be to draw a couple rectangles that take up a majority of the object for each class and use hitTestObject to see if any of the invisible rectangles of one instance are colliding with the invisible rectangles of another. Is this a good method? I figured that since a bit of overlapping is okay and actually preferred, that two or three rectangles can easily take up all the room I need for each object.
View 2 Replies
Apr 14, 2012
attached is an .fla file that has a number of movieclips that move around at random, this part works great. but the movement is only applicable to a rectangle/uniformed area - defined in the action script on frame 1.
PHP Code:
function getdistance (x, y, x1, y1) { var run, rise; run
= x1-x; rise = y1-
[code].....
View 4 Replies
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
Jan 30, 2012
I am looking for a way to get a similar effect as posted in the Adobe forums The current solution is very brute force using about 60 intermediate shapes gradually going from the outer shape towards the inner shape while slightly changing the color each time.
[Code]...
particular problem, I only wanted to have a shape fade into the color of the background so my solution was to draw the image slightly larger than usual and use Flash's blur filter to create the gradient effect. This is suitable only because my background image is a solid color so this won't work for everybody. This is also a very cpu intensive method but is faster than drawing 60 shapes.
View 1 Replies
Oct 1, 2009
I have a circle: Width 530 and height 800. I want an object to follow this circle using a motion path, but you cant do that in pure actionscript, so I tried rotating the circle with the object attached, but warping the circle at the same time... so width becomes 530 and height becomes 800... but because the circle has rotated at the same time, it looks like it hasn't moved - except for the object attached.
ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var Tween1:Tween = new Tween(circle,"width",None.easeNone,800,530,2,true);
var Tween2:Tween = new Tween(circle,"height",None.easeNone,530,800,2,true);
var myTween:Tween = new Tween(circle,"rotation",None.easeNone,0,180,2,true);
This was the closest... but it still dances around the page before anything happens.... and it isn't reading the sizes properly? 530 isn't 530, but something bigger, and 800 is actually smaller?
View 1 Replies
Nov 18, 2009
I have several movie clips on the stage each of which are started by buttons. When started, each clip simply plays a sound every two, four or six frames depending on the clip. The regularity of the sound playback is important. The movies start on frame 2 to avoid sound being heard when the swf file is initialized. On the last frame of each clip I have gotoAndPlay(2); to create the loop.
Now what I'm noticing is that when the loops repeat there's a slight stutter and it sounds like the duration of the first frame is extended. I've tried inserting an additional keyframe at the end of the movie but it doesn't resolve the problem. The loops just aren't regular at the loop point.
View 1 Replies
May 13, 2009
The subject pretty much sums it up; I have a bunch of movieclips on the stage, that are already filled with a bitmap pattern in the IDE. Now I need to fill them with another pattern once they are clicked, and I can�t seem to figure out how to do it.This is the closest yet, but i just get a recangle with the new pattern behind my selected mc. I realize that the rectangle comes from the drawRect method (duh) but I cant seem to find something the will allow me to fill the entire movieclip with the new pattern.in District.as
Code:
public function doSelect(){
_selectPattern = new SelectPattern(0,0); //class from my library
[code].....
View 5 Replies
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
Feb 3, 2012
I have a series of dots on a world map that depending on certain criteria move from one country to another. At the moment they move to a random point around the country's (mc) centre, as calculated by addind half the width to the x or y coordinate etc. This pressents certain problems such as the centre of the US is actually outside the boundries of the countries borders because of Alaska. Other countries such as the UK have dots floating just off the coast. The dots also cluster coveringing each other up.
Is it posible to generate a random x and y coordinate that is inside the boundries of an irregular shaped mc such as a country. I know that Flash must have these values because of colision detection and mouse overs. I just don't know how you go about accessing them.
View 3 Replies
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
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
Mar 19, 2009
Ok so i'm trying to create a percentage bar that automaticlly adjust depending on data pulled from a XML file. and I'm currently have some problems with the data getting to the second frame.. here is what I havethe xml file code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<myxml>
[code].....
View 1 Replies
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