PDA

View Full Version : Complex Shapes to sprites



jazzman121
October 16th, 2008, 10:17 PM
hey! If i have a sprite that im using in my flash movie..
I know you can use

sprite.graphics

and draw vector graphics

but what if i want the shape to be something really complex ... is there a way to attach a vector shape to it.. that ive drawn in the flash IDE or... can i take a shape and convert it to code somehow.. dont know if this makes sense??

thanks

jazzman121
October 17th, 2008, 09:48 AM
anybody please help? or let me know if it doesn't makes sense.. So i can explain it better

Ranoka
October 17th, 2008, 10:25 AM
That doesn't really make much sense...

Why don't you draw what you want in the IDE, and then give it a class name like ComplexShape and have it extend Sprite (instead of the default MovieClip). Then in your code, instead of making an instance of a blank Sprite, make an instance of your ComplexShape instead -- which will basicly be a Sprite with your artwork inside it.

Are you trying to do something different?

scottc
October 17th, 2008, 10:32 AM
Well, there are a few different ways... like linking to a symbol in your library.

goto your library in flash to the movieclip, graphic, png, mp3 whatever..

right click -> linkage
then tick the box that says "export for actionscript"

remember the name that it puts there.. eg mydrawing

then in your code put something like:
var mysprite:mydrawing = new mydrawing();
addChild(mysprite);

jazzman121
October 20th, 2008, 01:41 AM
thanks.. that helped... one more question any place where I can take a complex shape and convert it to as3 code?