ActionScript 2.0 :: Make A Self-drawing Shape?
Oct 23, 2003how to make a self-drawing shape with actionscript
View 2 Replieshow to make a self-drawing shape with actionscript
View 2 RepliesI'm making an android air application for school, a sketch app.But I'm facing an annoying problem, when I'm drawing I can draw over my bar and my menu, here's some code:
[code]....
--> so this is the function for drawing a shape on stage the shape is declared as
Actionscript Code:
public static var brushDraw:Shape = new Shape();
now the problem is that I can draw over my menu and everything. Putting the setChildIndex of brushDraw to 1 doesn't work, it gives some error...
How can I create such a shape using the Drawing API? where red means filled and white means not filled
View 1 RepliesThe issue I am having is how to tackle forming a logo using circles. I have done one letter manually, however it would take forever to do this with every single letter, and so I am asking here if anyone knew of a faster method. Requirements:
- Has to fill non-circular letters(i.e. does not have to be precise, but look like it has edges)
- Circles have to animate in, therefore they need to have drop shadow and seem like they are landing in place
Is it possible to draw a border around an arbitrary Shape (or Sprite) dynamically with ActionScript? From the IDE is really easy, just select the line color and click the Shape with the paint tool (S).
View 3 RepliesIs it possible to draw a strokeless shape with the pen tool (as in Illustrator)? It is quite tedious to have to go back and remove strokes from my shapes.... especially since I can't see how to do it without clicking on each segment and hitting "delete"!
View 2 RepliesI'm trying to draw an image in actionscript, I set it as a BitmapFill within a rectangle. The problem is that if I move the rectangle away from the origin(0,0), in my case I start drawing the rectangle at (20,35), the bitmap background doesn't follow along. The background is always drawn at (0,0) and then repeated, so I don't get a centered image but rather 2 halved images. Here's what my code looks like:
public class PageTileRenderer extends VBox
{
private var sp:Shape;
[Code]....
how to move the background fill origin. Or is there another solution to draw the image centered.
I've found a similar thread to this but my problem's a little different.I've never used the drawing function on Flash and I followed the fairly simple tute on it just recently.Is there any way to confine the drawing area to a specific shape. Mine's a rectangluar shape that's rotated. You can download my FLA with the background image here > url...I'd like to try and keep it confined to the notepad area.I think it might be a hitTest thing with if/else. My other thing would be to just rotate the notepad so that it's straight.Even still i'd like it confined to the area beginning with the corner of the notepad, not the corner of my movie.
View 2 RepliesThis is my first meeting with the Shapes; which don't seem cooperating, at all. Following is the Class code:
Code:
package
{
[code]......
I have 2 shapes, in different color, and i would like to have this effect ( see the attached file ).
How can i achieve that by using pure actionscript 3, or using source like TweenLite, TweenMax etc...
i have been tasked to create a rollover state that has dynamic irregular shapes that surround the movieclip target. The target is always a rectangle and the shapes will look roughly like:I think i will have to draw this old school without using the easy predfined shape classes. I first thought about doing two rounded rectangles to fake it, but the line cross over (pointing green arrow) will overlap. Anyone have ideas on how to approach this? If i go with the drawing api, is there a formula to working out the rounded curveTo angles on the corners to always be the same radius?
View 2 RepliesI have a movieclip that contains code for an API drawing shape. I can use it to mask a movieclip containing an image but not a moviclip that contains a dynamic gradient.
Code:
// CREATE MASK SHAPE WITH DRAWING API
// create empty movieclip
[code].....
I've never used the drawing function on Flash and I followed the fairly simple tute on it just recently. Is there any way to confine the drawing area to a specific shape. Mine's a rectangluar shape that's rotated. You can download my FLA with the background image here > [URL]. I'd like to try and keep it confined to the notepad area. I think it might be a hitTest thing with if/else. My other thing would be to just rotate the notepad so that it's straight. Even still I'd like it confined to the area beginning with the corner of the notepad, not the corner of my movie.
View 2 RepliesI'm trying to draw a mask that's a pill shape but I can't seem to adjust the linestyle properly.
Code:
import flash.display.Sprite;
var pill:Sprite = new Sprite();
pill.graphics.beginFill(0xFF0000,1);
pill.graphics.lineStyle(1,0x000000,1,false,"normal","round","round");
pill.graphics.moveTo(0,6);
[Code] .....
Im giving a action script for drawing a predefined process shape that is used in flow chart. There are action script to draw a square, rectangle, circle and triangle. Can anyone in the forum give code for drawing the shape.
View 1 RepliesIf I draw a rectangle or trapezium, how might I go about drawing bitmap data into that shape? I need to give a slight perspective to a loaded photo. Native 3D rotations seem to leave the bitmap really blurry, and a full 3D engine is too heavy for this project.
View 3 RepliesI drew a line (stepVoltage) in a fla using the graphics class. Once drawn, I want to move it to the right in an update function, but am having trouble. I tride just moving the line with statements like stepVoltage.x = newX; stepVoltage.y = newY; but this didnt work. Then I tried to delete the previous line and draw a new one with a clear () function (see below) but this blocked the next drawn line from showing up.
The code:
var stepVoltage:Shape = new Shape ();
stepVoltage.graphics.lineStyle(2,0x000000);
addChild (stepVoltage);
[Code]....
If I have a circle shape, or any else shape, what I should do to make a nice simple outline to that shape. Is there any way to make this simple. I tried to make this with the pen tool, bun it wasn't very precise. I want to use something else.
View 1 Repliesi have rectangle movie and i want to make it triangle or round so it show round in the page. can i do so with i embed it or it must be done in flash before i export swf?Also i forgot how you make transparent area in flash?
View 1 RepliesHow do I make a picture available to be used as a fill for a shape?
View 2 RepliesI have an array of mc's, and i need them to form smiling face on roll over event. How can i define positions of these mc's on this shape?(smiling face).
View 6 RepliesI am trying to make a random shape, I want each different point to draw a line to every other point, which I know this won't do yet even if it worked the way that I wanted. But, at the moment, my code does nothing. It is supposed to draw a line from from the first value in the point array to the second value in it to the third value in it.
Here's my code:
Code:
onLoad = function() {
drawIt(10);
}
function drawIt(numberOfPoints) {
[code]...
I have got a website design, here I need to make round shape scrollbar I never create round shape scrollbar, how can make round scrollbar?
View 3 RepliesI currently got a movieclip. On the timeline of the movieclip i've put a keyframe on frame 100, so that my movieclip is 100 frames long.On the stage I got a 100px wide red square as BG and on top of that a copy of the 100px square just in blue (my shape tween).What im basically trying to do is having the 100px blue square act as a percentagebar. So when I do something like:
ActionScript Code:
percentagebar.gotoAndStop(50);
The shape tweener should tween from frame 1 to frame 50 (with 50 representing 50%).
I draw a shape,like follows:
var shape1:Shape;
shape1=draw();
addChild(shape1);
shape1.rotation=50;
[Code]....
Then I want to rotate the shape at it's center point(200,202) by using shape1.rotation=50,but I find the shape don't rotate at the the center of it's shape. How to realize the function which make shape rotate at its center point?
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 have a flash ecard that I am working on and had one of those "wouldn't it be cool if..." moments!
I would like find out if it is possible to:
1) load in an xml file that contains several names
2) Load each one of those names into a predefined movie clip which would display the name
3) randomize the placement of each name in a given shape area so that the Movie clips with names would randomly fill in to make a specific shape.
I want to know how can I make a logo or image appeares like some one is drawing it. I am not sure that I have to break the image to multie peices then put them in a different time line or use Masking. Please help me with this.Here is a sample of a logo What I want to do is when the flash starts I want the drawing start with the bottom of the "P" and work its way around all the way ending in "G"
View 3 RepliesI keep trying to change the code so that I can control the area for drawing. The attached code is where I left of after many tries. The movie clip box_mc is being called from the library.
View 3 RepliesHow can you make the entire thing for drawing bigger? Not just the white space. Cause I'm making a scroller game..
View 1 Replies