Yeah, I tried a lot of methods to attempt to get the tooltip to disappear and ran into just too many problems. I'm sure there's a way tho using some ridiculous workaround. If you find the answer, please post it!

And, perhaps I should've mentioned this earlier, but I do have a ToolTip class available on my website:
http://ubergeek.tv/article.php?pid=96

I just updated it with the latest version, which has a couple fixes/features added. For my own projects, I don't actually use onRollOver/Out etc. for toolitps because they generally muck up event handling elsewhere. I don't recommend my method necessarily but it has worked for me in the past better than mucking with event handling. Adding a tooltip to a TextInput using my method is as simple as this:

ToolTip.getInstance().addClip(txt, "My tooltip text");

You can download the zip, check out the fla, and install and modify the packages if it works for you.

C

Subba Chalamalasetty wrote:

Hey chris,

Thank you very much for your help and time.I have good news about this
program. focusIn and focusOut events worked and now as long as I am not
using onRollOver, onROllOut, onPress, onRelease the program is working
fine. But there is one problem when I use focus in and out..i.e when I
click on the textinput, I am getting the rollover and also could enter
data, but when I come out (focus out)...untill I click somewhere else,
that rollover is getting carried. If that small problem is solved..that
will be a huge conquer for me. I am trying different ways to get it. If
you have time, can you please suggest me some ideas from your side. Once
again thank you very much for your help...here is the code

 txt.addEventListener("focusIn",Delegate.create(this,txtOver));

 txt.addEventListener("focusOut",Delegate.create(this,txtPress));

private function txtOver(){
                tt786 = new
customToolTip(0xE5E5E5,0x022954,0x022954,20,10,15,20);
                tt786.showTip("Total sales.");
                
        }

private function txtPress(){
   tt786.removeTip();
             // TRIED onRollOut also    
          tx.onKillFocus = function(){
                        tt786.removeTip();
                        trace("is it coming out?");
} }


Thanks,
Subba
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Hill
Sent: Wednesday, August 09, 2006 6:23 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Tooltip rollovers for textinput..help plss

wow, ok, I've spent way too much time on this so I have to get back to work. But here's what my last hour showed me:

txt has no onPress, onRelease, etc.
You cannot determine if the TextField inside a TextInput is rolled over or out. There are no onRollOver/onRollOut methods to use. You can determine if the TextInput receives focus(ie is clicked in or tabbed to) with
txt.addEventListener("focusIn",this);
txt.addEventListener("focusOut",this);

You can consistently determine a way to show the clip by putting an invisible button above the text field. But this stops the text field from receiving input, and so you must set _visible=false on the button after its rolled over. But now we have no way of determining when we've rolled off the textfield, and so there's no way to turn off the tooltip.

I never realized how broken this whole thing is. But it seems like TextField (not TextInput) objects don't have any event handling, and instead whatever behind them will receive onRollOver/Out events. This makes it really hard to do anything like a tooltip with them.

Sorry I couldn't give you a better answer!
Chris



Subba Chalamalasetty wrote:

I did change it when using it for the first time...I noticed the
function names are different and changed them so that they are same.
I also tried this

txt.onRollOver = txt.onPress = Delegate.create(this, txtOver);
txt.onRollOut = txt.onPress = Delegate.create(this,txtPress);

private function txtOver(){
                tt = new
customToolTip(0xE5E5E5,0x022954,0x022954,20,10,15,20);
                tt.showTip("Total sales.");
                
        }

  private function txtPress(){
     tt.removeTip();
     oldOnPress.apply(txt);
  }

I am still having the same problem.

Thanks,
Subba

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Subba
Chalamalasetty
Sent: Wednesday, August 09, 2006 5:07 PM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Tooltip rollovers for textinput..help plss



I tried this also...still same problem..

Subba

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Hill
Sent: Wednesday, August 09, 2006 4:52 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Tooltip rollovers for textinput..help plss

This:

     txt.onRollOut = txt.onPress = Delegate.create(this,txtPress);

Should be this:

     txt.onRollOut = txt.onPress = Delegate.create(this,txtOut);

According to the code given.

See if that works,
Chris


Subba Chalamalasetty wrote:



Hi Chris,

I tried using Delegate and i am still having the same problem.
I used your code and tried to save the onpress handler,but didn't work
import mx.utils.Delegate;
class test {
 private var txt:TextInput;
 private var oldOnPress:Function;
 private var tt:ToolTip;
 private function onLoad(){
    oldOnPress = txt.onPress;
    txt.onRollOver = Delegate.create(this, txtOver);
    txt.onRollOut = txt.onPress = Delegate.create(this,txtPress);
 }

 private function txtOver(){
    tt = new customToolTip(0xE5E5E5,0x022954,0x022954,20,10,15,20);
    tt.showTip("Total sales.");
 }

 private function txtOut(){
    tt.removeTip();
    oldOnPress.apply(txt);
 }
}

it is still having the same problem.Am I using the right event?.I am
totally lost and donno y it is not working(I also used TeoToolTip
component and it was giving me the same problem too).can you help me
out?

Thanks,
Subba

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Hill
Sent: Wednesday, August 09, 2006 3:56 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Tooltip rollovers for textinput..help plss

You're overwriting the onPress event on your text field. You need to save your old onPress event before overwriting it, and make sure that
it


is called:

class test {
  private var txt:TextInput;

  private function test() {
  }

  private function onLoad() {
           //save the onPress handler
           txt.oldOnPress = txt.onPress;
txt.onRollOver = function() { tt = new
customToolTip(0xE5E5E5,0x022954,0x022954,20,10,15,20);
               tt.showTip("Total sales.");
        }
txt.onRollOut = txt.onPress = function() {
            tt.removeTip();
                //call the onPress Handler
            oldOnPress();
        }

I don't think my changes will compile, but I hope you get the idea. I would suggest using the ascb.util.Proxy or mx.util.Delegate class to more gracefully handle your handlers. Something like this:

import ascb.util.Proxy;
class test {
 private var txt:TextInput;
 private var oldOnPress:Function;
 private var tt:ToolTip;
 private function onLoad(){
    oldOnPress = txt.onPress;
    txt.onRollOver = Proxy.create(this, txtOver);
    txt.onRollOut = txt.onPress = Proxy.create(this,txtPress);
 }

 private function txtOver(){
    tt = new customToolTip(0xE5E5E5,0x022954,0x022954,20,10,15,20);
    tt.showTip("Total sales.");
 }

 private function txtOut(){
    tt.removeTip();
    oldOnPress.apply(txt);
 }
}

Hope this helps
Chris

Subba Chalamalasetty wrote:



Hi,
I have rollovers for textinput boxes.When i use the onRollOver,i
could
get the rollover text(movie clip), but when i click the text input,I
am


not able to enter data in the textinput.I wrote a small tooltip class
and can somebody please help me to get the focus on textinput.i.e
when
i


click on the textinput,I should be able to enter data and rollover
movie


clip be removed.here is the code



class customToolTip {
private var theTip:MovieClip;
    private var tFormat:TextFormat;
function
customToolTip(hex:Number,hex2:Number,colorOfText:Number,heightOfBox:N
u
m


b


er,x1:Number,x2:Number,x3:Number) {
movieLoader = new MovieClipLoader();
           movieListener = new Object();
           movieLoader.addListener(movieListener);
           this.theTip = _root.createEmptyMovieClip("tooltip",
_root.getNextHighestDepth());
           //this.theTip.createEmptyMovieClip("tooltip",
_root.getNextHighestDepth());

this.theTip.createTextField("theText",this.theTip.getNextHighestDepth
(
)


,


3,1,1030,70);
           this.theTip.beginFill(hex);
           this.theTip.lineStyle(1, hex2, 100);
           this.theTip.moveTo(0, 0);
           this.theTip.lineTo(x1, 0);
           this.theTip.lineTo(x2, -10);
           this.theTip.lineTo(x3, 0);
           this.theTip.lineTo(205, 0);  // (100,0)
           this.theTip.lineTo(205, heightOfBox); // (100,20)
this.theTip.lineTo(0, heightOfBox); // (0,20) this.theTip.lineTo(0, 0); // (0,0) this.theTip.endFill();
           this.theTip._visible = false;
           this.theTip.theText.selectable = false;
           this.tFormat = new TextFormat();
           this.tFormat.font = "Arial";
           this.tFormat.size = 9;
this.tFormat.color = colorOfText; this.tFormat.align = "center";
           this.tFormat.italic = true;
           this.theTip.theText.setNewTextFormat(this.tFormat);
    }
public function showTip(theTextInput:String):Void { this.theTip.theText.text = theTextInput; trace(this.theTip.theText.text); this.theTip._x = _root._xmouse;
           this.theTip._y = _root._ymouse+10;
           this.theTip._visible = true;
           this.theTip.onMouseMove = function() {
                   this._x = _root._xmouse;
                   this._y = _root._ymouse+25;
                   updateAfterEvent();
           }
    }
    public function removeTip():Void {
delete this.theTip.onEnterFrame;
           this.theTip._visible = false;
this.theTip.clear(); }
}




and here I am using the tooltip class

class test {
 private var txt:TextInput;
 private function test() {
 }

 private function onLoad() {
txt.onRollOver = function() { tt = new
customToolTip(0xE5E5E5,0x022954,0x022954,20,10,15,20);
              tt.showTip("Total sales.");
       }
txt.onRollOut = txt.onPress = function() {
           tt.removeTip();
       }



When i click on the textinput,I need to get the focus on textinput
and
able to type data in textinput box .Can somebody help me in this...

Thanks,
Subba





_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to