Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9238439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:45:46+00:00 2026-06-18T07:45:46+00:00

I have a dropdown in a table (as a custom renderer). Some of the

  • 0

I have a dropdown in a table (as a custom renderer). Some of the options is too long to display in the table or dropdown as there is some space constraints on the screen. We do however have a tooltip that displays the full text.

The problem is that this is the last column in the table and the user’s PC has some resolution constraints as well. Now the tooltip displays and part of it is cut off on the users monitor.

Now I can go and adjust the X position (by -150) of the tooltip.

private function createToolTip(event:ListEvent):void {          
    tip = ToolTipManager.createToolTip("THE TEXT", this.parentApplication.mouseX - 150, this.parentApplication.mouseY) as ToolTip;                  
}

Now this works as expected but if the text is short it kind of dispays in the middle of no where.

So I added a width (of 200) to the tooltip

private function createToolTip(event:ListEvent):void {          
     tip = ToolTipManager.createToolTip("THE TEXT", this.parentApplication.mouseX - 150, this.parentApplication.mouseY) as ToolTip;
     tip.width = 200;                   
}

Now this displays ok with the text being displayed at least next to the dropdown.

But the problem is that whenever a text of longer than 200 is stored in the database it will not display the full text.

Does anyone know how to rather have the tooltip right aligned instead of left. That way no matter how long the text is it will display to the left.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:45:47+00:00Added an answer on June 18, 2026 at 7:45 am

    Here is a solution which implements both singleline and multiline Tooltip with right alignment.

    enter image description here

    To do it you should make two steps: create your own Tooltip class and make the TooltipManager use it.

    //Tooltip.as

    package com.tooltip
    {
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;
    import mx.controls.ToolTip;
    
    public class MyToolTip extends ToolTip
    {
        public var align:String = "left"; //left or right
    
        public function MyToolTip()
        {
            super();
        }
    
        override protected function commitProperties():void
        {
            super.commitProperties();
        }
    
        override protected function measure():void
        {
            super.measure();
    
            var tf:TextFormat = textField.getTextFormat();
    
            if (align == "right")
                tf.align = TextFormatAlign.RIGHT
            else
                tf.align = TextFormatAlign.LEFT;
    
            textField.setTextFormat(tf);
        }
    
        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
        {
            super.updateDisplayList(unscaledWidth, unscaledHeight);
    
            textField.autoSize = TextFieldAutoSize.NONE;
            textField.width = this.width - 2*textField.x;
        }
    }
    }
    

    The second step is not straightforward.

    The TooltipManager has a property “toolTipClass” which says it which class should be used to create the Tooltip.

    ToolTipManager.toolTipClass = MyToolTip;
    

    There is an error in the SDK which prevents it from correct implementation. It has been discussed often in the network.

    When a new Tooltip is created the “toolTipClass” is not taken in account. The respective code line looks like:

    var toolTip:ToolTip = new ToolTip();
    

    But should be like this one:

    var toolTip:IToolTip = new ToolTipManager.toolTipClass();
    

    The only way to correct this behaviour is to do monkey patching of the ToolTipManagerImpl class. It is described here very good.

    Now you can use your tooltip in your application:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" 
    layout="absolute" 
    minWidth="955" minHeight="600" >
    <mx:Script>
        <![CDATA[
            import com.tooltip.MyToolTip;
            import mx.controls.ToolTip;
            import mx.managers.ToolTipManager;
    
            private const TOOLTIP_WIDTH:int = 200;
    
            protected function onBtnClick(event:MouseEvent):void
            {
                ToolTipManager.toolTipClass = MyToolTip;
                ToolTip.maxWidth = TOOLTIP_WIDTH;
    
                var tip:MyToolTip;
    
                tip = ToolTipManager.createToolTip("Your text", this.mouseX - 150, this.mouseY) as MyToolTip;
    
                tip.align = "right";
                tip.width = TOOLTIP_WIDTH;  
            }
    
        ]]>
    </mx:Script>
    
    <mx:Button id="myBtn" x="194" y="145" label="Show Tooltip" click="onBtnClick(event)"/>
    </mx:Application>
    

    It is very important to use both “width” and “maxWidth” properties.
    To change the alignment to “left” use

    tip.align = "left";
    

    The sequence of lines in this code is important too.

    I hope it will help you!

    //EDIT

    Here you can find the patched version of the ToolTipManagerImpl. Put it into your project’s root. The package name is the same like in the SDK, so the system will take this one instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a wpf combobox with some custom items. When the dropdown button is
I have a custom table which I'd like to use as the DropDown portion
For example I have a dropdown box that gets a town from the table
I have a bound dropdown list populated with a table of names through a
I have a table that contains multiple dropdown menus for a list of profile
I have a table with checkbox and a dropdown in each row. I'd like
I have a table with the columns City and ZoneCode. I have a dropdown
I currently have a dropdown box which enters an integer into a table. It's
The scenario is I have got 2 dropdown list and a table in which
I have a Yii dropdown which loads a table of cities, states, zipcodes, lat

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.