class Tooltip extends mx.core.UIComponent { var parent_mc, tooltip_width, invalidate, __get____width, tooltip_height, __get____height, auto_show, __get__autoShow, auto_drag, __get__autoDrag, auto_size, __get__autoSize, tooltip_str, __get__text, txt_color, __get__textColor, txt_font, __get__textFont, txt_size, __get__textSize, txt_align, __get__textAlign, txt_html, __get__textHtml, tooltip_position, __get__position, tooltip_tail_height, __get__tailHeight, tooltip_color, __get__color, tooltip_alpha, __get__alpha, tooltip_border_display, __get__border, tooltip_border_color, __get__borderColor, tooltip_border_size, __get__borderSize, tooltip_border_alpha, __get__borderAlpha, shadow_display, __get__shadow, shadow_distance, __get__shadowDistance, shadow_angle, __get__shadowAngle, shadow_color, __get__shadowColor, shadow_alpha, __get__shadowAlpha, shadow_blur_x, __get__shadowBlurX, shadow_blur_y, __get__shadowBlurY, shadow_strength, __get__shadowStrenght, shadow_quality, __get__shadowQuality, shadow_inner, __get__shadowInner, shadow_knockout, __get__shadowKnockout, shadow_hide_object, __get__shadowHideObject, __set__autoShow, __set__autoDrag, __set__autoSize, __set__textColor, __set__textFont, __set__textSize, __set__textAlign, __set__textHtml, __set__position, __set__tailHeight, __set__color, __set__alpha, __set__border, __set__borderColor, __set__borderSize, __set__borderAlpha, __set__shadow, __set__shadowDistance, __set__shadowAngle, __set__shadowColor, __set__shadowAlpha, __set__shadowBlurX, __set__shadowBlurY, __set__shadowStrenght, __set__shadowQuality, __set__shadowInner, __set__shadowKnockout, __set__shadowHideObject, __get__parent, _x, _height, _y, $obj, __set____height, __set____width, __set__text; function Tooltip() { super(); parent_mc = this; parent_mc.swapDepths(1500); mx.events.EventDispatcher.initialize(this); this.init_tooltip(false); } // End of the function function get parent() { return (parent_mc); } // End of the function function set __width(w) { tooltip_width = Math.ceil(w); this.invalidate(); //return (this.__width()); null; } // End of the function function get __width() { return (tooltip_width); } // End of the function function set __height(h) { tooltip_height = Math.ceil(h); this.invalidate(); //return (this.__height()); null; } // End of the function function get __height() { return (tooltip_height); } // End of the function function set autoShow(bool) { auto_show = bool; this.invalidate(); //return (this.autoShow()); null; } // End of the function function get autoShow() { return (auto_show); } // End of the function function set autoDrag(bool) { auto_drag = bool; this.invalidate(); //return (this.autoDrag()); null; } // End of the function function get autoDrag() { return (auto_drag); } // End of the function function set autoSize(bool) { auto_size = bool; this.invalidate(); //return (this.autoSize()); null; } // End of the function function get autoSize() { return (auto_size); } // End of the function function set text(str) { tooltip_str = str; this.invalidate(); //return (this.text()); null; } // End of the function function get text() { return (tooltip_str); } // End of the function function set textColor(num) { txt_color = num; this.invalidate(); //return (this.textColor()); null; } // End of the function function get textColor() { return (txt_color); } // End of the function function set textFont(str) { txt_font = str; this.invalidate(); //return (this.textFont()); null; } // End of the function function get textFont() { return (txt_font); } // End of the function function set textSize(num) { txt_size = num; this.invalidate(); //return (this.textSize()); null; } // End of the function function get textSize() { return (txt_size); } // End of the function function set textAlign(str) { txt_align = str; this.invalidate(); //return (this.textAlign()); null; } // End of the function function get textAlign() { return (txt_align); } // End of the function function set textHtml(bln) { txt_html = bln; this.invalidate(); //return (this.textHtml()); null; } // End of the function function get textHtml() { return (txt_html); } // End of the function function set position(str) { tooltip_position = str; this.invalidate(); //return (this.position()); null; } // End of the function function get position() { return (tooltip_position); } // End of the function function set tailHeight(num) { tooltip_tail_height = num; this.invalidate(); //return (this.tailHeight()); null; } // End of the function function get tailHeight() { return (tooltip_tail_height); } // End of the function function set color(num) { tooltip_color = num; this.invalidate(); //return (this.color()); null; } // End of the function function get color() { return (tooltip_color); } // End of the function function set alpha(num) { tooltip_alpha = num; this.invalidate(); //return (this.alpha()); null; } // End of the function function get alpha() { return (tooltip_alpha); } // End of the function function set border(bln) { tooltip_border_display = bln; this.invalidate(); //return (this.border()); null; } // End of the function function get border() { return (tooltip_border_display); } // End of the function function set borderColor(num) { tooltip_border_color = num; this.invalidate(); //return (this.borderColor()); null; } // End of the function function get borderColor() { return (tooltip_border_color); } // End of the function function set borderSize(num) { tooltip_border_size = num; this.invalidate(); //return (this.borderSize()); null; } // End of the function function get borderSize() { return (tooltip_border_size); } // End of the function function set borderAlpha(num) { tooltip_border_alpha = num; this.invalidate(); //return (this.borderAlpha()); null; } // End of the function function get borderAlpha() { return (tooltip_border_alpha); } // End of the function function set shadow(bln) { shadow_display = bln; this.invalidate(); //return (this.shadow()); null; } // End of the function function get shadow() { return (shadow_display); } // End of the function function set shadowDistance(num) { shadow_distance = num; this.invalidate(); //return (this.shadowDistance()); null; } // End of the function function get shadowDistance() { return (shadow_distance); } // End of the function function set shadowAngle(num) { shadow_angle = num; this.invalidate(); //return (this.shadowAngle()); null; } // End of the function function get shadowAngle() { return (shadow_angle); } // End of the function function set shadowColor(num) { shadow_color = num; this.invalidate(); //return (this.shadowColor()); null; } // End of the function function get shadowColor() { return (shadow_color); } // End of the function function set shadowAlpha(num) { shadow_alpha = num; this.invalidate(); //return (this.shadowAlpha()); null; } // End of the function function get shadowAlpha() { return (shadow_alpha); } // End of the function function set shadowBlurX(num) { shadow_blur_x = num; this.invalidate(); //return (this.shadowBlurX()); null; } // End of the function function get shadowBlurX() { return (shadow_blur_x); } // End of the function function set shadowBlurY(num) { shadow_blur_y = num; this.invalidate(); //return (this.shadowBlurY()); null; } // End of the function function get shadowBlurY() { return (shadow_blur_y); } // End of the function function set shadowStrenght(num) { shadow_strength = num; this.invalidate(); //return (this.shadowStrenght()); null; } // End of the function function get shadowStrenght() { return (shadow_strength); } // End of the function function set shadowQuality(num) { shadow_quality = num; this.invalidate(); //return (this.shadowQuality()); null; } // End of the function function get shadowQuality() { return (shadow_quality); } // End of the function function set shadowInner(bln) { shadow_inner = bln; this.invalidate(); //return (this.shadowInner()); null; } // End of the function function get shadowInner() { return (shadow_inner); } // End of the function function set shadowKnockout(bln) { shadow_knockout = bln; this.invalidate(); //return (this.shadowKnockout()); null; } // End of the function function get shadowKnockout() { return (shadow_knockout); } // End of the function function set shadowHideObject(bln) { shadow_hide_object = bln; this.invalidate(); //return (this.shadowHideObject()); null; } // End of the function function get shadowHideObject() { return (shadow_hide_object); } // End of the function function draw() { if (this.__get__autoShow() == undefined) { this.__set__autoShow(true); } // end if if (this.__get__autoDrag() == undefined) { this.__set__autoDrag(true); } // end if if (this.__get__autoSize() == undefined) { this.__set__autoSize(true); } // end if if (this.__get__textColor() == undefined) { this.__set__textColor(3355443); } // end if if (this.__get__textFont() == undefined) { this.__set__textFont("Verdana"); } // end if if (this.__get__textSize() == undefined) { this.__set__textSize(10); } // end if if (this.__get__textAlign() == undefined) { this.__set__textAlign("left"); } // end if if (this.__get__textHtml() == undefined) { this.__set__textHtml(false); } // end if if (this.__get__position() == undefined) { this.__set__position("right"); } // end if if (this.__get__tailHeight() == undefined) { this.__set__tailHeight(15); } // end if if (this.__get__color() == undefined) { this.__set__color(16774847); } // end if if (this.__get__alpha() == undefined) { this.__set__alpha(100); } // end if if (this.__get__border() == undefined) { this.__set__border(true); } // end if if (this.__get__borderColor() == undefined) { this.__set__borderColor(13421772); } // end if if (this.__get__borderSize() == undefined) { this.__set__borderSize(1); } // end if if (this.__get__borderAlpha() == undefined) { this.__set__borderAlpha(100); } // end if if (this.__get__shadow() == undefined) { this.__set__shadow(true); } // end if if (this.__get__shadowDistance() == undefined) { this.__set__shadowDistance(3); } // end if if (this.__get__shadowAngle() == undefined) { this.__set__shadowAngle(45); } // end if if (this.__get__shadowColor() == undefined) { this.__set__shadowColor(0); } // end if if (this.__get__shadowAlpha() == undefined) { this.__set__shadowAlpha(2.500000E-001); } // end if if (this.__get__shadowBlurX() == undefined) { this.__set__shadowBlurX(10); } // end if if (this.__get__shadowBlurY() == undefined) { this.__set__shadowBlurY(10); } // end if if (this.__get__shadowStrenght() == undefined) { this.__set__shadowStrenght(1); } // end if if (this.__get__shadowQuality() == undefined) { this.__set__shadowQuality(1); } // end if if (this.__get__shadowInner() == undefined) { this.__set__shadowInner(false); } // end if if (this.__get__shadowKnockout() == undefined) { this.__set__shadowKnockout(false); } // end if if (this.__get__shadowHideObject() == undefined) { this.__set__shadowHideObject(false); } // end if } // End of the function function init_tooltip(bool) { this.__get__parent().createEmptyMovieClip("btm_mc", 1); this.__get__parent().createEmptyMovieClip("top_mc", 2); this.__get__parent().createTextField("txt", 3, 5, 5, this.__get____width() - 10, 10); this.__get__parent().btm_mc._visible = false; this.__get__parent().top_mc._visible = false; this.__get__parent().txt._visible = false; if (bool) { this.dsp_txt(); } else if (this.__get__autoShow()) { this.dsp_txt(); } // end else if } // End of the function function dsp_txt() { Tooltip.txt_fmt.font = textFont; Tooltip.txt_fmt.size = textSize; Tooltip.txt_fmt.color = textColor; Tooltip.txt_fmt.align = textAlign; if (this.__get__autoSize() == false) { this.__get__parent().txt.multiline = true; this.__get__parent().txt.wordWrap = true; } // end if this.__get__parent().txt.html = true; this.__get__parent().txt.selectable = false; this.__get__parent().txt.autoSize = true; this.__get__parent().txt.htmlText = text; if (!this.__get__textHtml()) { this.__get__parent().txt.setTextFormat(Tooltip.txt_fmt); } // end if this.dsp_tooltip(); } // End of the function function dsp_tooltip() { var _loc3 = this.__get__parent().txt.textHeight + 15; var _loc2; if (this.__get__autoSize()) { _loc2 = this.__get__parent().txt.textWidth + 20; } else { _loc2 = __width; } // end else if this.__get__parent().top_mc.clear(); if (this.__get__border()) { this.__get__parent().top_mc.lineStyle(this.__get__borderSize(), this.__get__borderColor(), this.__get__borderAlpha()); } // end if if (this.__get__position() == "left") { var _loc4 = _loc2 - 28; var _loc5 = _loc2 - 38; } else if (this.__get__position() == "right") { _loc4 = 38; _loc5 = 28; } else if (this.__get__position() == "auto") { if (this.__get__parent()._x > Stage.width / 2) { _loc4 = _loc2 - 28; _loc5 = _loc2 - 38; } else { _loc4 = 38; _loc5 = 28; } // end else if } // end else if this.__get__parent().top_mc.beginFill(this.__get__color(), this.__get__alpha()); this.__get__parent().top_mc.moveTo(0, 0); this.__get__parent().top_mc.lineTo(_loc2, 0); this.__get__parent().top_mc.lineTo(_loc2, _loc3); this.__get__parent().top_mc.lineTo(_loc4, _loc3); this.__get__parent().top_mc.lineTo(_loc4, _loc3 + this.__get__tailHeight()); this.__get__parent().top_mc.lineTo(_loc5, _loc3); this.__get__parent().top_mc.lineTo(0, _loc3); this.__get__parent().top_mc.lineTo(0, 0); this.__get__parent().top_mc.endFill(); if (this.__get__shadow()) { var _loc6 = new flash.filters.DropShadowFilter(this.__get__shadowDistance(), this.__get__shadowAngle(), this.__get__shadowColor(), this.__get__shadowAlpha(), this.__get__shadowBlurX(), this.__get__shadowBlurY(), this.__get__shadowStrenght(), this.__get__shadowQuality(), this.__get__shadowInner(), this.__get__shadowKnockout(), this.__get__shadowHideObject()); parent_mc.top_mc.filters = [_loc6]; } // end if if (this.__get__autoDrag()) { this.drag_tooltip(_loc4); } // end if this.__get__parent().btm_mc._visible = true; this.__get__parent().top_mc._visible = true; this.__get__parent().txt._visible = true; } // End of the function function drag_tooltip(pos) { _x = _root._xmouse - pos; _y = _root._ymouse - _height; Tooltip.mouseListener.$obj = this; Tooltip.mouseListener.onMouseMove = function () { $obj.parent._y = _root._ymouse - $obj.parent._height; $obj.parent._x = _root._xmouse - pos; }; Mouse.addListener(Tooltip.mouseListener); } // End of the function function showTooltip() { this.init_tooltip(true); } // End of the function function hideTooltip() { this.__get__parent().btm_mc._visible = false; this.__get__parent().top_mc._visible = false; this.__get__parent().txt._visible = false; Mouse.removeListener(Tooltip.mouseListener); } // End of the function var className = "Tooltip"; static var symbolOwner = Tooltip; static var symbolName = "Tooltip"; static var txt_fmt = new TextFormat(); static var mouseListener = new Object(); } // End of Class