On Fri, Mar 5, 2010 at 12:41 PM, Benny <[email protected]> wrote:
> No need for inheritance then, just give your Star class the desired
> parameters in the constructor, e.g
>
> package
> {
> import flash.display.MovieClip;
>
> public class Star extends MovieClip
> {
> public function Star(lineColor:uint, fillColor:uint)
> {
> graphics.lineStyle(1, lineColor);
> graphics.beginFill(fillColor);
> graphics.moveTo(144, 277);
> graphics.lineTo(188, 184);
> graphics.lineTo(288, 170);
> graphics.lineTo(216, 98);
> graphics.lineTo(232, 0);
> graphics.lineTo(144, 47);
> graphics.lineTo(55, 1);
> graphics.lineTo(72, 100);
> graphics.lineTo(0, 170);
> graphics.lineTo(99, 184);
> graphics.endFill();
> }
> }
> }
>
> When you then instantiate your class you just pass on the desired
> parameters, like:
>
> import Star;
>
> var myStar:Star = new Star(0xFFFFFF, 0xFF0000);
> addChild(myStar);
>
> THAT'S what I was looking for! Thanks.
Susan
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders