# OOP Class Question

**URL:** <https://forum.kirupa.com/t/oop-class-question/174093>\
**Category:** flash\
**Created:** [January 2, 2006, 8:04pm UTC](https://forum.kirupa.com/t/oop-class-question/174093 "2006-01-02T20:04:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cki](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cki](https://forum.kirupa.com/u/cki)\
**Post date:** [January 2, 2006, 8:04pm UTC](https://forum.kirupa.com/t/oop-class-question/174093/1 "2006-01-02T20:04:25Z")

</div>

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?

```auto

/**
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;

    }
}

```
