[COLOR=“Black”]I am attempting create a class for the first time. My idea with this class is that you will be able to pick a colour scheme “warm”, “cold” and all the code will be there for you when you need it. So with warm, I have it randomly selecting different warm colours.
I have the code working the way it should in an action script 3 file, but when I transfered it into a class I have gotten many problems which I probably half solved. If someone could take a look at my work and let me know what I might be missing that would be helpful.
Right now when I go to preview it it just shows a black box. I’m assuming its something to do with my “beginFill();” which just has a “1” in it right now becuase I can’t seem to write anything correctly!!
Here is what I have in my class;[/COLOR]
[COLOR=“Red”]
package com.avis340.randomColor
{
import com.avis340.math.MoreMath;
import fl.motion.Color;
import flash.display.Sprite;
public class ColorScheme extends Sprite
{
public var red:Number;
public var green:Number;
public var blue:Number;
public var coolColor:Color;
public function COOL (color:Number):void
{
red = MoreMath.random( 160, 200);
green = MoreMath.random( 149, 219);
blue = MoreMath.random( 154, 230 );
coolColor = new Color( 0, 0, 0, 0, red, green, blue, 1 );
}
}
}
[/COLOR]
and this is what I have in my fla
[COLOR=“red”]import com.avis340.math.MoreMath;
import com.avis340.randomColor.ColorScheme;
var coolColor:ColorScheme = new ColorScheme ();
this.graphics.beginFill(1);
this.graphics.drawRect( 0, 0, 100, 100 );
trace ( coolColor );
[/COLOR]