I would really appretate some help. I am very new to creating my own classes and have hit a bump in the road here. I made a tooltip class but it dont work ???
Can someone tell me what Im doing wrong?
this is the class:
import flash.filters.DropShadowFilter;
class ToolTip extends MovieClip {
//-< declare variables >-\\
var ds:DropShadowFilter;
var theTip:TextField;
var myformat:TextFormat;
var msg:String;
var timer:Number;
var myMC:MovieClip;
//-< declare functions >-\\
public function ToolTip(myMC, msg) {
myMC.onRollOver = function() {
timer = setInterval(showTip, 350);
};
myMC.onRollOut = function() {
clearTip();
};
}
private function clearTip() {
clearInterval(timer);
theTip.removeTextField();
}
private function showTip() {
clearInterval(timer);
var ds:DropShadowFilter = new DropShadowFilter(2, 45, 0x000000, .50, 4, 4, 1, 1.5, false, false, false);
_root.createTextField("theTip", 500, _xmouse+10, _ymouse-30, 10, 10);
myformat.font = "Arial";
myformat.bold = true;
myformat.size = 10;
_root.theTip.autoSize = true;
_root.theTip.border = true;
_root.theTip.background = true;
_root.theTip.backgroundColor = 0xFFFFC9;
_root.theTip.text = msg;
_root.theTip.setTextFormat(myformat);
_root.theTip.filters = [ds];
positionTip();
}
private function positionTip() {
_root.onEnterFrame = function() {
_root.theTip._x = _xmouse+10;
_root.theTip._y = _ymouse-30;
};
}
}
this is how I’m trying to use it:
import ToolTip;
myClip.Tip = new ToolTip(myClip, "Please Help!");