PDA

View Full Version : Drawing lines


rixter67
07-15-2002, 02:30 AM
New to Flash, how do I go about animating a simple line that starts from nothing and end up across the stage?

texbala
07-15-2002, 05:22 AM
chk out whether the zip file is helpful!!

i used to change the shape of a line using the shape tween - with a small line in the first keyframe and increasing it the last keyframe

any better ideas?

bala

farafiro
07-15-2002, 05:37 AM
U can also do that by AS
//make a small line, convert it to a MC and make sure that its
center point is un the left edge
onClipEvent(enterFrame){
this._xscale +=3 // bigger is faster
// best effect is when the thickness is 0 (hairline)
}

Also u can do it dynamicly by MX

rixter67
07-15-2002, 03:20 PM
How would I go about it dynamically in MX? I just loaded MX and I have been going through the tutorials. It appears that using Actionscript is the way to go as the file sizes are considerably smaller. I guess it will just take some time getting used to.

Billy T
07-15-2002, 05:59 PM
see attached

cheers

rixter67
07-15-2002, 06:07 PM
Thanks for the responses, I realize now that it is just a simple shape tween. The more you work with Flash, the more you know.

texbala
07-15-2002, 08:07 PM
I was wondering how can we draw a circle or any alphabet (if possible) or say a symbol 'S' using actionscript

thnx!!

bala

Billy T
07-16-2002, 01:05 AM
does it have to animate?

texbala
07-16-2002, 01:07 AM
no need of animation.... just an automatic circle/symbol needs to be drawn!!

bala

Billy T
07-16-2002, 01:19 AM
there is probably an easier way (using PI or something) but this sort of works

cheers

texbala
07-16-2002, 02:11 AM
billy,

can u send flash 5 file for that. I don';t have MX

sorry & thnx

bala

Billy T
07-16-2002, 02:18 AM
it uses mx scripting so it won't work in 5

sorry

farafiro
07-16-2002, 04:53 AM
for flash 5 think there is a code in the library section for that, also here is a code for a REAL circle, not the one that M provides.
Sorry Billy, no harm but I hate this shape that provided with MX and the call it a circle
speed = 5;
r = 200;
xc = 150;
yc = 150;
angle = 0;
delta = Math.PI/180;
createEmptyMovieClip("circle", 1);
with (circle) {
lineStyle(0, 0x666666, 50);
moveTo(r+xc*Math.cos(angle*delta),r+xc*Math.sin(an gle*delta))
}
onEnterFrame = function () {
x = r+xc*Math.cos(angle*delta);
y = r+yc*Math.sin(angle*delta);
angle += speed;
if (angle>359) {
angle -= 360;
}
circle.lineTo(x, y);
};


As u can see, it's animated .....
oh, by the way, i wrote the code my self, BillyT ;)

Billy T
07-16-2002, 05:21 AM
I thought there would be a mathsy way of doing it...

btw my ugly circle hates you too faffy ;)

farafiro
07-16-2002, 05:32 AM
Originally posted by Billy T
I thought there would be a mathsy way of doing it...
btw my ugly circle hates you too faffy ;)

Heheheheeeeeeeee