Happy New Year All,
As a resolution I’ve vowed to code AS OOP each day, off to a good start. Below is a class with the function of passing a custom greeting to a textField based upon AM or PM(to be written). Has this attempt placed too much functionality in the first pass, should the variables be more hard-coded at this stage?
/**
A Simple hello class
that assigns a custom
message to a text field
based upon time of day.
**/
class com.bushidodeep.Greet {
private var target:TextField;
private var depth:Number;
private var time:Number;
private var x:Number=_x;
private var y:Number=_y;
private var autoSize:Boolean=true;
private var autoSize:Boolean="left";
//callback function triggered after message is presented.
public var onGreetingComplete;
/**
@param target the TextField to target
@param depth the depth on the TextField
*/
function Greet($target:MovieClip, $depth:Number) {
target = $target;
depth = $depth;
public function drawTextField(tf:TextField,x:Number,y:Number,width:Number,height:Number,autoSize:Boolean,border:Boolean){
var pointer:Object=this;
target.createEmptyMovieClip("bd_greeting_mc",depth);
target.bd_greeting_mc.createTextField("greeting_txt",depth,x,y,width,height);
target.bd_greeting_mc.greeting_txt.autoSize="left";
target.bd_greeting_mc.greeting_txt.border=true;
}
}