Drawing API Corners/Curves
This was something I played with a while ago, trying to get a handle on the Flash Drawing API (another post today reminded me of it). Thought someone might be able to use it/learn from it. All code is in the first frame. (Oh, if you wonder why it isn't doing anything just click around a bit.)
KirupaForum > Talk > Source/Experiments
Posted on: 04-26-2005, 06:51 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drawing API Corners/Curves
This was something I played with a while ago, trying to get a handle on the Flash Drawing API (another post today reminded me of it). Thought someone might be able to use it/learn from it. All code is in the first frame. (Oh, if you wonder why it isn't doing anything just click around a bit.)
Help With Drawing Curves
I am currently running into a problem with drawing a curve from point A to point B and being able to drag either point while having Flash redraw the curve between the two points. I can get it to draw the curve and I am able to drag one point and Flash redraws the curve correctly. The problem is having both points dragable and keeping the curve updated.
Drawing Curves With Actionscript
Hi all,
I'm trying to achieve the effect from
http://www.deepend-sf.com/swf/findex.html
Like to know how to creat those curves (waves) by using actionscript. I would love to know how to draw curve with 2 points (or 3) instead of just connecting them with a straight line.
Appreciate any comment!
Actionscript For Drawing Curves?
i would very much appreciate if some one could tell me how to draw curves using actionscript. is this possible? i am working on a project involving ECG drawings.
Drawing Random Curves
Has anyone experimented with or seen experiments with random curves (lines) drawn within a confined area. I'm trying to produce the effect of a big mess of string in a box.
Any help would be great.
thnx.
Drawing Multiple Curves
for some reason I'm not able to find a way to create multiple curves by using variables.
So:
curveTo (x,y,xx,yy) works correctly
but if I then, say, increase y by 10, then how to leave the previously drawn curve on the stage.
and has somebody by chance seen a .fla on drawing comic-like clouds (or speech bubbles) dynamically.
Many thanks in advance
Harry S
haseppa@lpt.fi
Drawing Curves With Actionscript
Hi Guys,
Is it possible to dynamically draw curves with actionscript? I'm thinking of this with regards to generating a line graph from some data values that I read in to the movie..
thanks for your help,
darkwhiteorange
Drawing Curves, Efficiency?
Hi, I've been having fun making these curve generating movies such as this one:
http://www.walkingbaby.co.uk/experim...iderdraw4.html
The problem I am having is that after they get more detailed they start slowing down considerably. Does anyone have any suggestions as to how i can make it more efficient?
This is how I am currently doing it:
Code:
this.createEmptyMovieClip("curve",1);
curve.xPoint = Stage.width/2;
curve.yPoint = Stage.height/2;
curve.xPointA = Stage.width/2;
curve.yPointA = Stage.height/2;
curve.onMouseMove = function(){
with(this){
if(Key.isDown(Key.ENTER)){
//colour = Math.random() * 16581375;
colour = 0x555555;
lineStyle(3, colour, 10);
moveTo(xPointA,yPoint);
curveTo(_xmouse,_ymouse,xPointA,yPointA);
//curveTo(Stage.width-_xmouse,_ymouse,xPointA,_xmouse);
endFill();}
xPoint = _xmouse;
yPoint = _ymouse;
//this.xPointA+= (0.5-Math.random())*10;
this.yPointA+= (0.5-Math.random())*30;
if (yPointA > Stage.height) yPointA = Stage.height;
if (yPointA < 0) yPointA = 0;
}
}
this.onMouseDown = function(){
curve.clear();
}
Thanks.
Drawing Animated Curves
Hey guys,
I have a question probably more about individual preference, but I just can't replicate this effect. At this website there are several curvy lines that grow and draw on screen:
http://www.exopolis.com/sites/maroon...site/main.html
I don't know how to achieve this by masking out the line, because the lines are curved. Is there anyway to animate the shape of a mask, and not just the position/scale??? That's the only way I can think that they get them to draw so smoothly.
Any ideas?
Drawing Non-symmetric Curves
Hallo,
Is it possible to draw some non-symmetric curves (using non-symmetric handles) with the bezier pen tool in Flash? Just like alt-click with Illustrator, or c-click in CorelDraw.....
thanks
m.
Bezier Curves With Drawing API
Hi guys,
does anyone know how to use the drawing API to produce a bezier curve?
I need to produce a graph, much like the one here:
http://www.globfx.com/products/swfch...&fmt=swfa&dl=y
Any help would be much appreciated, I'm stumped
Dynamically Drawing Curves
I'm trying to do a tentacle effect for a header of a site. The get the liquid, flowing effect of the tentacle, i wanted to use actionscript to dynamically manipulate curves. I tried it with tweens, but it looked flashish
If there were only one tentacle, i would use the bezier curve code i've seen on a couple sites, but there's multiple tentacles and i dont want to bog down any processors (our movie's around 30fps). Anyone got any ideas for a simple way to go about this?
thanks!
Drawing Square Corners
I'm having problems trying to draw anything without rounded corners. For instance if I use the square tool to draw a square the outside corners of the stroke are rounded. I made sure that corner radius is 0 on the tool preferences and under the custom for the stroke Square corners is checked. The inside of the stroke is square but the outside is rounded. Any suggestions?
Thanks.
Animated Drawing Lines/curves Using AS2
hello, i am attempting to create an animated drawing of outline of letters --> "A-P-M". each letter drawn one after the other....
i have seen numerous posts with somewhat similar questions and answers alluding to the use of onEnterFrame or setInterval. however i have not found an onEnterFrame answer that worked, and have not actually seen any setInterval script for this type of question.
i think my biggest problem is the letter "p" as it includes curves.
i was able to create a nice "A" animation, using the Penners Tween class, but cannot for life of me figure out how to integrate drawing curves into it.
help??!
much thanks!!
Frustrated Drawing Curves [too Much Nodes]
Hi there,thanks for taking the time.
Does somebody know why the hell flash insists on adding nodes I do not need,
when drawing a curve?
Almost always when I'm drawing a curve, I take the time to adjust it and remove all
the nodes I don't need, so it'll be simpler to modify in the future, and then......I unselect it,
but if I select the curve again.....The Flash Demon adds like triple the nodes or control points !!!
( "Hiiii-hi-hiiii You'll NEVER control this curve!!")
You can imagine how frustrating is that
when trying to Shape Tween a curve.
Any tips on removing this flash
behaviour??
Thanks a lot!
-Waltman
Points Drawing Curves Animation Problem
Hey.
I hope someone can help me out ´cos the task I´m facing right now seems kind of tedious.
Here´s the deal:
I am making an intro for a site. It´s a 3d animation of a house planted on a human brain. I want to start the intro by drawing the first frame on screen. I want various points drawing the borders of the objects i have in my intro. My problem is, I need curves traced on screen. I´m fairly new to Flash and so far the only solution I see right now is doing a frame by frame animation. It´s going to take a lot of time and I´m sure there must be a better way. If it was all straight lines I´d use tweening, but the curves are not being drawn like i would like to. I would really appreciate a link to a tutorial page for example. Or maybe just a hint.
Ok then, wainting for answers...
Points Drawing Curves Animation Problem
Hey.
I hope someone can help me out ´cos the task I´m facing right now seems kind of tedious.
Here´s the deal:
I am making an intro for a site. It´s a 3d animation of a house planted on a human brain. I want to start the intro by drawing the first frame on screen. I want various points drawing the borders of the objects i have in my intro. My problem is, I need curves traced on screen. I´m fairly new to Flash and so far the only solution I see right now is doing a frame by frame animation. It´s going to take a lot of time and I´m sure there must be a better way. If it was all straight lines I´d use tweening, but the curves are not being drawn like i would like to. I would really appreciate a link to a tutorial page for example. Or maybe just a hint.
Ok then, wainting for answers...
"Fuse" And Drawing Curves
Hi all
I've just watched the "Animating with Fuse" tutorial and its completely rocked my world...I have no previous knowledge of the ZigoEngine and normally end up using the Tween and Transitions clunky animation techniques, so this has come as a huge shock to me (in a good way of course!).
I'm currently working on a project that draws a series of curved lines from an origin point to various other points on a map - imagine it as like missiles firing from a point on a world map in a "war games" style. However, even though I have all of the end coordinates in one huge array, I've found the mx.transitions way of animating to be a bit of a pain...and I'm now wondering if Fuse might be able to solve all of my problems?!
So my questions are (if these are really naive and ignorant, I apologise, this is new to me):
1. Can I incorporate a curveTo type of animation into a Fuse animation?
2. Is there a Fuse replacement for the curveTo command?
3. Is there an easier way of doing it?
4. Can you help me please!!??!! ;)
I'd appreciate any help you can offer. Thanks in advance.
Curves
How can i draw a curve with actionscript???
Coding Curves
hey i am trying to simulate a branch shooting off of a main object, however i want to make the branch fluctuate/vibrate over time. i was wondering if there was anyway of manipulating lines in code to simulate curves. and help or pointers to tutorials would be helpful.
PS: i am not talking about a shape tween which will continuously loop but rather a coded line which i can manipulate
thanx and be well
Curves In Isometrics
Is there any way to have curves in an isometric enviroment in Flash (I have version 5). I can do isometrics but I want to know if you can do curves. As in a skateboard quarter pipe. Thanks.
Bezier Curves
Is there a way to create bezier curves that contain more than one control point?
See attached .fla...
Bezier Curves
Is there a way to create bezier curves that contain more than one control point?
See attached .fla...
Precise Curves?
Hi,
I am fairly new to flash,
I am looking for a method of using the pen tool to draw geometrical curves. Say I wanted to create a button with a square shape which I then add curves to on its left and right side, I mean I don't know what the value of the curve I draw on the left side would be compared to the right so how can I keep my shape geometrical? what I'm looking for is an option for guides that could maintain a corresponding angle for both sides in order to be precise when drawing curves with the pen tool.
If anyone could possibly help me I would greatly appreciate it.
Thank you
Capo
Text To Curves
Hello,
How do you create texts to a random curve in Flash?
Thanks, Rob
Playing With Curves
hello,
i've created two mc: wall and rectangle, between them i'v got this curve:
this.createEmptyMovieClip("string", 0);
string.onEnterFrame = function() {
farx = rectangle._x-this._x;
far_away += (farx-far_away)*0.5;
this.clear();
this.lineStyle(4, 0xFF9900, 100);
/////
this.moveTo(wall._x, wall._y);
this.curveTo(far_away/2, taliczba-farx/5, rectangle._x, rectangle._y);
this.endFill();
};
y = rectangle._y;
rectangle.onPress = function() {
this.startDrag(false, 10, 600, 700, -200);
};
rectangle.onRelease = rectangle.onReleaseOutside=function () {
stopDrag();
};
i would like to make this curve 'dance' when i get close with mouse pointer to its controlY, i would like it to run away from the mouse but not to far
i'm trying something like this:
uu.onMouseMove = function() {
fare += (taliczba-farx/5-_ymouse)/100;
};
dancing = function () {
uu.onEnterFrame = function() {
//fare = (randomowa-taliczba);
mcPlusx = mcPlusx*0.8+fare*0.2;
taliczba += mcPlusx;
};
};
dancing();
but there's something missing
anybody knows how to help me with this?
Curves And Guns
hi i was on newgrounds just now and was watching some stick movies, I want to make a stick movie also,(hey u have to crawl before you walk right?) and i saw that they had highly detailed weapons and , shurly they didnt draw them. How did they get them like that? is there a site i can get these from? do i have to import somthing? and if so how do i get that cartoon look?
and theres one more thing is there a way u can make curves without drawing it yourself?
Adjust Curves
i think i saw this transition effect various times, but can't remember any site. anyway is it possible to make a transition which looks like your adjusting the curves in photoshop until the image on which the transition is made is totally white. not just the plain old tinting...
hope you understand what i mean.
Beautiful Curves
Hello.
Wondering if anyone can point me in the direction of a good tutorial which covers moving an mc between two points along a curve dynamically. So that a destination can be set at random and the mc will track to it with a curved trajectory. I can do the random part and the easing between, but not the curve.
Thanks
How Many Curves In A Shape?
Hey!
Is it possible to find out how many curves, straight segments and fills are in a shape?
Can Flash IDE do it?
Maybe there is a third party plugin?
I want this information to easily find shapes that require optimization.
Bezier Curves
hello,
does anybody know a tool, function or class that can draw a smooth curve between points? it don't need to be a real bezier, just something smooth looking.
I have just the point coordinates (anchors) but don't have that control points to draw smooth curve from more points.
or is there a tool that will generate me that control points?
"Help Me Action-Script Kenobi, You're My Only Hope"
How Many Curves In A Shape?
Hey!
Is it possible to find out how many curves, straight segments and fills are in a shape?
Can Flash IDE do it?
Maybe there is a third party plugin?
I want this information to easily find shapes that require optimization.
Bezier Curves
I was looking for a way to Tween along a curve, but couldn't find any, so to learn more about Bezier curves, I wrote this little SWF to learn and for all of you to enjoy. I started out with Quadratic Bezier Curves but ended up writing something with an arbitrary amount of control points. You can dynamically add new control points ad infinitum (although past 6 things get slow). Enjoy, and tell me what you think!
CS4 Animation Curves
Im working in the cs4 trial.
I can set and position keyframes for any channel.
However, the motion editor doesn't give me access to keyframe tangent handles for position tracks. The only thing i can use for a transition between position keyframes is some lame canned logisitc "easing" or a linear transition.
Now this is not the case with the rotation tracks. I can set keyframes and their tangents just fine.
Any help on what's going on here would be really appreciated. I sure hope adobe did not just go to market with a version of flash that no one can set custom bezier transitions for position animation...
Edited: 12/02/2008 at 09:48:51 AM by fikshin
Mathematics (curves)
Hi there! I can't pinpoint or make up a set of calculus to determine the right formula which describes a curve that goes through 3 specific points...
Do I express myself correctly? I'll try to say it with a more hand-on approach. I have a spaceship which can move vertically, located to the left. The enemies, obviously, arrive from the right. Now, when i click anywhere on the scene, I want a missile/plasma orb/projectile to be shot from the spaceship, but doing more than going in a straight line: imagine 3 points, one at the spaceship, one in front (therefore to the right) of the spaceship (5/10 units in front) and the third at the click location. How do I determine the formula of the curve that goes along these three points?
Sine Curves
Hi
I want to be able to input the start screen co-ordinates and the destination co-ordinates and plot a sine curve between them.
So for example. I may wish to start at 100,100 on the screen and end at 150,150. I want to plot a sine curve between these 2 points.
The formula I use to plot a sine curve is
x=x+1;
y=y-sin(degrees)*radius;
The question I have is is it possible to create a formula which plots a sine curve which hits 2 given points.
Best Way To Animate Curves.
Hey all
Does anyone know the best way to animate curves drawn with the API?
I have a set point
20 empty sprites
20 curve shapes.
The problem is that some sprites move so id like the curves to stick to the moving sprites.
My attemps at this are a mess, as far as i got was to update the curves via an event on the sprites but obviously drawing a for loop with 20 items per event tends to create massive slowdown.
I essentially only want one of the anchor points to move, but this basic premise is screwing my brain. I cannot seem to find a quick way to draw all curves.
Any approach to this would be grand.
Cheers eh.
Grandpaw
Dynamic Curves
Hi,
I want to set about creating a dynamic xy curve. What I want to achieve is described by the picture I attached.
Basically I want a drawn curve on an xy plot with a little dragger.
When some one drags the dragger the curve redraws itself .
Could somebody give me a few pointers on where to start, what I need to learn etc?
Thanks,
dub
Hey How Do I Get To The Curves Optimizer?
I hear about it all the time.. there's some place where you can slide a bar and reduce your file size. I've been using flash for a while now but I have never ever come across that... could someone point me in the right direction?
Mathematics (curves)
Hi there! I can't pinpoint or make up a set of calculus to determine the right formula which describes a curve that goes through 3 specific points...
Do I express myself correctly? I'll try to say it with a more hand-on approach. I have a spaceship which can move vertically, located to the left. The enemies, obviously, arrive from the right. Now, when i click anywhere on the scene, I want a missile/plasma orb/projectile to be shot from the spaceship, but doing more than going in a straight line: imagine 3 points, one at the spaceship, one in front (therefore to the right) of the spaceship (5/10 units in front) and the third at the click location. How do I determine the formula of the curve that goes along these three points?
Perfect Curves....
Last edited by Kindsage : 2004-09-06 at 04:52.
Friends,
i'd like to know a simple way to create a perfect curving arc between any two points, provided their x and y coordinates are known. By a perfect curving arc, i mean that a curve which bends nicely in the middle and looks proportionate.
I belive i can use the curveTo method to do it and i've tried, but the PCA remains elusive. I'm using Flash MX.
(Need i say, that i'm pretty bad at maths....and this is like really urgent...)
Any help will be much appreciated.
Thanks a lot,
FF
Control Car In Curves
Hi all,
i´m on writing a little car-game and i´m stucking by the car-control
in curves.
sneak preview: (http://www.manatwork.com/formel/formel1.html)
car controls are : key press Up,Left and Right
Still very ruff Beta-Version!
in curves the car should be drifting to the outside of the track and the player
should steer against the car movement by pressing the arrow keys.
i´ve already written a little script - but it looks not naturally enough, ´cause the car
moves directly the other direction "on press", but i want the car to drift on and by press just slow down drifting...
please help!
here we go...
this.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
wagen._x += 10;
} else if (Key.isDown(Key.LEFT)) {
wagen._x -= 10;
} else if (laenge == 4 && wagen._x > 0) {
wagen._x -= 30;
} else if (laenge == -4 && wagen._x < 550) {
wagen._x += 30;
}
};
please help!
_drek
Corners
Hey,
I've made a small thing in fireworx, a little arrow in a box. Now i imported that in flash mx, and put it on the scene, but i don't see the botom line of the box
So i thought, maybe i can draw this in flash itself, i started ... but i don't know how to get the corners right. They never are in 90° angle. You gotta really zoom in to see it ... cuz it's kinda small.
If you use the hairline, it's fine, but the line is to small.
I added the fla file so you could see for yourself ...
Hope you understand what i mean and somebody can help me
Greetz,
DiGiTi
Draw Lines And Curves
On my page http://members.chello.at/robert.weix...hdetection.htm I draw a curve with duplicate Movieclip. This works, but after some time it will be very slowly. I can imagine that I will delete the movieclips from time to time and put instead of it a picture with the curves. I didn't try it, and I don't know if it will work, but it is complicated and no good method. Is there an easyier way or is there another method to draw lines and curves instead using duplicate move-clip.
Draw Lines And Curves
On my page http://members.chello.at/robert.weix...hdetection.htm I draw a curve with duplicate Movieclip. This works, but after some time it will be very slowly. I can imagine that I will delete the movieclips from time to time and put instead of it a picture with the curves. I didn't try it, and I don't know if it will work, but it is complicated and no good method. Is there an easyier way or is there another method to draw lines and curves instead using duplicate move-clip.
Text Motion Along Curves
hi again...
is there anyway text could move along a specific curve? i know in swish, one can do the wavy text effect, but that's confined to a specific pattern. if we use the motion guide, it will only be realistic for very short text.
any ideas, guys?
How Can I Draw Random Curves?
I want to learn the math behind an experiment in my recently found "precious" site www.flight404.com..
the exact link for the exp. is http://www.flight404.com/version6/pr...et1/index.html
1- how does it draw a random smooth curve on the screen?
2- up to how many levels can flash player handle for duplicamovies?
3- there I count 6 squares of the same color but they do overlap each other...what is the math behind this smooth overlap that causes the eye to perceive the picture like a real 3D object?
any document..comment..link is appreciated!
thx for the precious time spent...
Random Moving Curves ?
Hi there !! thanks for taking the time.
I searched and searched FK for a similar efect
that imitates the Windows screen saver: Mystify
but with curves, but I couldn't find any.
I want to put a randomly moving set of curves
in the background, and I guess it can be made
with some math calculating script so it's
not a heavy animation.
You can get a better idea what kind of pattern
I'm looking for if you check the atached image.
Thanks a lot !!
Beziér Curves And Matrices
I don't know where this post technically belongs, so I put it here.
I want to use Bezier curves and matrice concatenation to animate, in essence, real-time NURBs. I want as little rendering overhead as possible, so I want to draw my objects using only lines.
I have heard that true Bezier curves can only be approximated in Flash using the curveTo() method, so I'm eager to find a tutorial that demonstrates this.
I want to use segmented characters (the upper arm is a set of points, the forearm is a set of points, the hand is a set of points, etc., each segment pivots off of the last.) Somehow, I want to trace the lines of each object from segment to segment. This is the tough part.
For example: Imagine a human figure with a line drawn from the shoulder straight down the body and along the leg, then across the bottom of the foot and up the back of the leg and body to the place where the line started. This line chooses certain points within each segment of the character and draws a loop. This example would be a loop around the x-axis of the character model.
By combining multiple loops within multiple axes, the overall character structure is made visible using a lofi, cross-sectional, line-based display.
Any ideas on how to achieve this? Essentially it's all a structure of arrays, but it's confusing me.
Any tutorials that explain the approach of skinned characters (painting weights in particular) and are easy to grasp conceptually are greatly appreciated as well.
+Q__
|