i am creating the line using graphics methods. i dont think they support event listeners.
Akshar Kaul On Tue, Jun 1, 2010 at 19:09, valdhor <valdhorli...@embarqmail.com> wrote: > > > If it were me, I would create a custom tooltip; add a mouseover event > listener to your line; check the color directly under the mouse pointer and > show the tooltip. > > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "akshar" > <akshar.k...@...> wrote: > > > > i have a line in my application. i require that a tooltip should come > > only on the line. The line is in a custom component. when i add the > > tooltip to the component it shows the tooltip for whole of the > > component. is there a way to show the tooltip only for the line. > > here is a sample which i am trying :- > > > > main application file:- > > > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > > layout="absolute" width="100%" height="100%" xmlns:local="*"> > > <local:drawtheline/> > > </mx:Application> > > > > drawtheline component :- > > > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Box xmlns:mx="http://www.adobe.com/2006/mxml" width="400" > > height="300" creationComplete="createLine()" toolTip="this tooltip > > should come only on the line" > > borderColor="#00FF00" borderStyle="solid"> > > <mx:Script> > > <![CDATA[ > > import mx.core.UIComponent; > > private function createLine():void > > { > > var g:Shape = new Shape(); > > g.graphics.lineStyle(2, 0xFF0000, .75); > > g.graphics.moveTo(0,0); > > g.graphics.lineTo(400,300); > > this.rawChildren.addChild(g); > > } > > ]]> > > </mx:Script> > > </mx:Box> > > > > >