ActionScript 3.0 :: Draw The Shape Of A Existing Movieclip Which Is Irregular Shape?
Oct 11, 2011need to draw the shape of a existing movieclip which is irregular shape.
View 2 Repliesneed to draw the shape of a existing movieclip which is irregular shape.
View 2 Repliesneed to draw the shape of a existing movieclip which is irregular shape.
View 1 RepliesI 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.
I have a class; "Game".I have a bitmap in the library; "Grass"I want to be able to run a function from the main timeline that uses the bitmap inside of a movieClip.My current attempt is as follows; I make an instance of "Game" and have an .as file for Game that has:PHP Code:
package {
import flash.display.MovieClip;
import flash.display.Shape;
[code].....
Can anyone tell me if I can copyPixels with an irregular shape instead of just a rectangle?
View 0 RepliesHow 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);
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 RepliesIn 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.
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?
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?
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 RepliesIs there anyway to tween the color of an existing shape?
View 1 RepliesIn 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]......
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
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 RepliesI look up AS3 api,I know AS3 can draw circle,Ellipse,Rect. Is there an api to draw diamond shape? How to draw it. I want to make two diamond shapes cross,and make one diamond shapes from long to short. Like star effect.How to realize it?
View 2 RepliesI use following statement to draw a shape[CODE]for(....){ sprite.graphics.beginFill(..); sprite.graphics.drawRect(x,y,1,1); sprite.graphics.endFill();}[CODE] But I find above shape is not vector shape.Because I change the IE size,I find the size of shape don't automatic change. How to use sprite.graphics to create vector shape?
View 3 RepliesI look up AS3 api,I know AS3 can draw circle,Ellipse,Rect. Is there an api to draw diamond shape? How to draw it. I want to make two diamond shapes cross,and make one diamond shapes from long to short. Like star effect.How to realize it?
View 1 RepliesIs there any way to draw text in a DisplayObject or Shape using only ActionScript? The only way I can find on the web is by creating a TextField, but I can't add a TF to a DisplayObject or Shape.
DisplayObject implements IBitmapDrawable which can be passed as an argument to the draw function of a BitmapData object, which then can be drawn using graphics.beginBitmapFill.[code]...
how to draw the attached shape progressively over time?
View 9 RepliesHow do I draw a square shape with a gradient fill in AS3?
View 3 Repliesdrawing out line that will serve as a mask im tryin to animate a drawing out of a line, but the line wont be an animation itself, itll be used as a mask that will reveal outline of a rectangle i'm starting right now and im on this stage so far, the problem is i dont understand why this line is not drawing out horizontally, while it should variables xpos and ypos are coordinates of the position i want to start drawing it from, xcor and ycor are the cooridnates that will be used to stop drawing once it reaches this point, then jump is how fast i want the line to draw(amount of pixels) ps:the type is there because i will also make another case for vertical line.
Code:
lineDraw = function(type, xpos, ypos, xcor, ycor, jump){
this.createEmptyMovieClip("temp", this.getNextHighestDepth());
this.temp.lineStyle(5, 0x003300,100);
if(type=="horizontal"){
[code]....
How you draw squares for example in AS (if at all possible) and using shape tweens in AS (again if possible).
View 3 RepliesWhen I draw a path with the pen tool, and fill it, it seems as if the shape now has two parts. If I drag the filled area around, it's breaking apart from the path (or border). So how can I make this one entity?
View 3 RepliesI'm using Flash Builder 4 and am in the process of learning. The short and simple explanation is, I want a tab navigator that has tabs that look like this: I know I could do this using an image-based skin, but I figured (and could be wrong) that programmatically drawing the shape would be better in terms of scalability. As long as I get the result I'm looking for, I guess I don't really care if it's mx or spark. I tried doing this:
[Code]...
I usually created a movieclip in flash and assign it to actionscript class(using export for actionscript method in its property panel) that exteds movieclip.but sometimes movieclip is just too heavy for that,is there any possible way to draw a sprite directly in flash(not by code),and control it in actionscript-3
View 4 Replieshow to draw border for even/uneven shape object? it is stored in a movieclip
View 0 RepliesI am trying to draw a box shape on screen which fills with a gradient, but according to the angle between your start and end mouse points. ie, if you draw from 100x100 to 200,200, the angle will be 45 degrees and it will draw your gradient fill within 100x100 to 200,200 on a 45 degree angle.
Trouble is, I can EITHER get the angle working just fine if I fill the entire shape, or the angle isn't right but the fill area is correct. Please see the attached fla and click drag within the red box, trying out the 2 matrix arrays in thereto see the 2 x scenarios listed above.
I'm on the user have to be able to draw/trace outlines of different shapes. So for example an "S" shape is on the screen, and the user needs to try to draw OVER that shape. So it's not just mouse recognition, it has to see if the user draw over that shape good enough. So it's kind of like a colorbook but you only draw the outline of the shape, if you know what I mean.
I've been searching the web and haven't found any pre made solution for this, but I thought that before I try to make it all from scratch I could ask you guys here about it.
I found a nice script for drawing a donut shape. I don't know why it only works with using 'this' or ' _root' . You should be able to apply this to a movieclip?Or am i missing something?[code]
View 3 Replies