View Full Version : FMX growing circle
borispc
July 29th, 2003, 06:55 PM
Hi people!...this message is not really aimed to an ActionScript answer...more like just tweening probably...:
how do you make a line grow into a circle (trying to animate a mask to do that is a pain in the neck).
Has anyone done this, or knows an easy way to do it?
thanks!:esmirk:
borispc
July 29th, 2003, 07:00 PM
I want to use that in an animation for a preloader so a tweening is the easiest...but how to animate mask ??
Keith130
July 30th, 2003, 06:18 AM
You can just do a shape tween from a line to a circle or a motion tween with the circle starting as a free transformed very small thing.
borispc
July 30th, 2003, 01:11 PM
meant was to make a circle grow from beginning to end (clockwise)..I guess I didn't explain myself very well..sorry about that.
See www.podlab.com/JAFFE/www3
borispc
July 30th, 2003, 01:12 PM
go to portfolio/interiors and select one of the 8 choices to see what I mean
kode
July 30th, 2003, 01:42 PM
It might not be the best way, I'm not a math guy, but it does the job quite well. :P
this.createEmptyMovieClip("circle", 0);
circle._x = Stage.width/2;
circle._y = Stage.height/2;
circle.radius = 20;
circle._rotation = 270;
circle.onEnterFrame = function() {
var t, l, p, i;
l = this._parent.getBytesLoaded();
t = this._parent.getBytesTotal();
p = Math.floor(100*l/t);
this.clear();
this.lineStyle(1, 0x000000, 100);
this.moveTo(this.radius, 0);
for (i=0; i<p*(Math.PI*2)/100; i += (Math.PI*2)/100) {
this.lineTo(Math.cos(i)*this.radius, Math.sin(i)*this.radius);
}
if (l>0 && l == t) {
this._parent.play();
}
};
this.stop();
Scootman
July 30th, 2003, 06:55 PM
oh heh you posted while i was makin an fla.... anyway ill post mine too... hope it helps..... i commented the code (i did it on the enter frame for an empty mc i manually put on the stage though... im not too good with the frame functions and stuff)
Scootman
July 30th, 2003, 06:58 PM
oh and looking at the other code i realized that if you want the circle to start drawing from the top select the empty mc and rotate it 270 degrees ( i think that might work)
kode
July 30th, 2003, 07:01 PM
Originally posted by Scootman
oh heh you posted while i was makin an fla...
Come on... it took you 5 hours to make that FLA!? :P
borispc
July 30th, 2003, 07:41 PM
I haven't tried kax's script yet but thanks to both...I guess you can make it dependent to any object you want to load just changing the path of that object (the one we would get the Bytes Loaded from) :P
senocular
July 30th, 2003, 07:46 PM
you could always use my path class
...
kode
July 30th, 2003, 07:57 PM
Originally posted by lostinbeta
Wow, that is excellent Sen.
**** your skills....lol.
That would be my answer, senocular. :P ;)
senocular
July 30th, 2003, 08:01 PM
I missed that one ;)
Scootman
July 31st, 2003, 03:25 AM
oh heh kax i must have just not seen it before i made the fla... lol it took me about 10-15 minutes :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.