LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-02-2006, 03:51 PM
nasdaq404 nasdaq404 is offline
Registered User
 
Join Date: Mar 2006
Posts: 13
Rep Power: 0
nasdaq404 is on a distinguished road
Source adding an image to the toolTip class - help

i’m creating a toolTip on a movieclip. so far I have the text to load on the toolTip. I need some help on adding an image to the right of the toolTip. what should I do guys …..

Code:
code: in as 
 
class com.site.ToolTip
{
    var oldOnRollOver, toolTipText, toolTipDelay, oldOnRollOut;
    static var _text, __get__text, label, _cont, _caller, __get__caller, _mouseListener, intervalID, shadow, bg, __get__active, __set__caller, __set__text;
    function ToolTip()
    {
    } // End of the function
    static function set text(_t)
    {
        _text = _t;
        //return (com.site.ToolTip.text());
        null;
    } // End of the function
    static function get text()
    {
        return (com.site.ToolTip.label.text);
    } // End of the function
    static function get active()
    {
        return (com.site.ToolTip._cont._visible);
    } // End of the function
    static function set caller(_c)
    {
        _caller = _c;
        //return (com.site.ToolTip.caller());
        null;
    } // End of the function
    static function get caller()
    {
        return (com.site.ToolTip._caller);
    } // End of the function
    static function show(_t, time)
    {
        if (time && time > 0)
        {
            com.site.ToolTip.setText(_t ? (_t) : (com.site.ToolTip._text));
            com.site.ToolTip._mouseListener.show = mx.utils.Delegate.create(com.site.ToolTip.getInstance(), com.site.ToolTip.show);
            intervalID = setInterval(com.site.ToolTip._mouseListener, "show", time);
            return;
        } // end if
        clearInterval(com.site.ToolTip.intervalID);
        Mouse.addListener(com.site.ToolTip._mouseListener);
        com.site.ToolTip._mouseListener.onMouseMove = mx.utils.Delegate.create(com.site.ToolTip.getInstance(), com.site.ToolTip.setToolTipToMouse);
        com.site.ToolTip.setToolTipToMouse();
        com.site.ToolTip._cont._visible = true;
    } // End of the function
    static function hide()
    {
        Mouse.removeListener(com.site.ToolTip._mouseListener);
        delete com.site.ToolTip._mouseListener.onMouseMove;
        com.site.ToolTip._cont._visible = false;
        clearInterval(com.site.ToolTip.intervalID);
    } // End of the function
    static function getInstance()
    {
        if (com.site.ToolTip._instance == undefined)
        {
            _instance = new com.site.ToolTip();
            com.site.ToolTip.init();
        } // end if
        return (com.site.ToolTip._instance);
    } // End of the function
    static function init()
    {
        _cont = _root.createEmptyMovieClip("__tooltip_mc", 9000);
        shadow = com.site.ToolTip._cont.createEmptyMovieClip("shadow", 1);
        bg = com.site.ToolTip._cont.createEmptyMovieClip("bg", 2);
        com.site.ToolTip._cont.createTextField("label", 3, 5, 0, 5, 20);
        label = com.site.ToolTip._cont.label;
        com.site.ToolTip.label.autoSize = "left";
        com.site.ToolTip.label.html = true;
        com.site.ToolTip.label.selectable = false;
        com.site.ToolTip.label.multiline = true;
        _mouseListener = new Object();
        com.site.ToolTip.hide();
    } // End of the function
    static function setText(_t)
    {
        com.site.ToolTip.label.htmlText = "<font face=\"Verdana\" size=\"10\">" + _t + "</font>";
        com.site.ToolTip.resetBG();
    } // End of the function
    static function setToolTipToMouse(Void)
    {
        com.site.ToolTip._cont._x = _root._xmouse + 15;
        com.site.ToolTip._cont._y = _root._ymouse;
        if (com.site.ToolTip._cont._x + com.site.ToolTip._cont._width > Stage.width)
        {
            com.site.ToolTip._cont._x = _root._xmouse - com.site.ToolTip._cont._width - 5;
        } // end if
        if (com.site.ToolTip._cont._y + com.site.ToolTip._cont._height > Stage.height)
        {
            com.site.ToolTip._cont._y = _root._ymouse - com.site.ToolTip._cont._height - 5;
        } // end if
        updateAfterEvent();
    } // End of the function
    static function resetBG(Void)
    {
        var _loc2 = com.site.ToolTip.label.textWidth + 12;
        var _loc1 = com.site.ToolTip.label.textHeight + 4;
        com.site.ToolTip.bg.clear();
        com.site.ToolTip.bg.lineStyle(0, 3355443, 80);
        com.site.ToolTip.bg.beginFill(16777164, 80);
        com.site.ToolTip.bg.moveTo(0, 0);
        com.site.ToolTip.bg.lineTo(0, _loc1);
        com.site.ToolTip.bg.lineTo(_loc2, _loc1);
        com.site.ToolTip.bg.lineTo(_loc2, 0);
        com.site.ToolTip.bg.lineTo(0, 0);
        com.site.ToolTip.bg.endFill();
        com.site.ToolTip.shadow.clear();
        com.site.ToolTip.shadow.beginFill(3355443, 60);
        com.site.ToolTip.shadow.moveTo(2, 2);
        com.site.ToolTip.shadow.lineTo(2, _loc1 + 2);
        com.site.ToolTip.shadow.lineTo(_loc2 + 2, _loc1 + 2);
        com.site.ToolTip.shadow.lineTo(_loc2 + 2, 2);
        com.site.ToolTip.shadow.lineTo(2, 2);
        com.site.ToolTip.shadow.endFill();
    } // End of the function
    static function install(mc, text, delay)
    {
        trace ("install ToolTip on " + mc);
        mc.toolTipText = text ? (text) : ("");
        mc.toolTipDelay = delay ? (delay) : (500);
        mc.oldOnRollOver = mc.onRollOver;
        mc.onRollOver = function ()
        {
            if (oldOnRollOver)
            {
                this.oldOnRollOver();
            } // end if
            if (toolTipText != "")
            {
                com.site.ToolTip.show(toolTipText, toolTipDelay);
            } // end if
        };
        mc.oldOnRollOut = mc.onRollOut;
        mc.onRollOut = function ()
        {
            if (oldOnRollOut)
            {
                this.oldOnRollOut();
            } // end if
            com.site.ToolTip.hide();
        };
    } // End of the function
    static var _instance = com.site.ToolTip.getInstance();
} // End of Class

Code:
code in fla:
 
com.site.ToolTip.install(_root.myMc, "this is my text this is my text<br>this is my text this is my text<br>this is my text this is my text<b>text</b>", 250);

Last edited by nasdaq404 : 12-02-2006 at 03:54 PM
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading image with Flash 9 and PHP - without using FileReference Class agoldust Flash CS3 / Flash 9 1 08-13-2008 05:06 AM
Invisible Stage with ToolTip Class petey_pablo Actionscript 2.0 3 10-27-2006 02:58 PM
Adding a dragable image barryandersonuk Newbies 2 02-16-2005 04:46 PM
Numbers not adding in my class disbot4 Actionscript 2.0 3 08-18-2004 06:45 PM
tooltip image array wyclef Flash MX ActionScript 1 07-11-2003 04:42 PM




All times are GMT. The time now is 12:22 PM.