Shape GeneratorWelcome to the page of the Shape Generator Project.
This class provides an easy way to generate regular polygons and animate them using tweens.
Why this class ?I made this class because sometimes we need perfect regular polygons for our flash animations, and because it is kinda hard to make it using the drawing tools.
How to use it.First, create a new Action Script 2 project.
Save your file inside a folder for your project.
Then download the Shape.as file.
You can find it here
Now inside your project folder, create a folder called nirahiel, containing a folder called graphic and finally this one containing the Shape.as
Do not rename or move the Shape.as file !
Ok, now we are gonna add some code.
import nirahiel.graphic.Shape; //import the class
var clip = createEmptyMovieClip("clip",getNextHighestDepth()); //create a new clip
var shape = new Shape(clip);//make the shape
clip._x = clip._y = 200;//move the clip so we will see it on the stage ;)
shape.rayon = 100;//a really big ...
shape.faces = 4;//... square
shape.build();//now render the shape.After each modification of the shape you can shape.build() it again to apply the changes, or, if you're gonna edit it several times, activate the auto-build shape.start() and then , desactivate it shape.stop()
For any suggestion, feel free to contact me at :
GMdebbyatgmaildotcom (PS : I'm a guy, don't mind the girly name)
These details are provided for information only. No information here is legal advice and should not be used as such.