I am creating a video player utilizing the VideoDisplay component.  I
want to change the sliderDataTip property to use a custom class so
that the tooltip will display the video time rather than the value
(between 0 and 1).

I am new to flex (and OOP).  I have created a class that extends
mx.controls.ToolTip - but I need to pass values to the constructor -
and when I do it gives me an error.

Any help?

Here is the custom class

<pre>
package sample.package
{
        import mx.controls.ToolTip;
        import mx.controls.sliderClasses.Slider;
        import mx.controls.VideoDisplay;
        import mx.controls.HSlider;

        public class TimeTip extends ToolTip {
                
                private var _videoDisplay:VideoDisplay = new VideoDisplay;
                private var _slider:HSlider = new HSlider;
                
                public function TimeTip(videoDisplay:VideoDisplay,
slider:HSlider):void {
                        super();
                        _slider = slider;
                        _videoDisplay = videoDisplay;
                }
                
                override public function set text(value:String):void {
                        text = value;
                }
                
                override public function get text():String {
                        var rText:String = formatTime(_slider.value * 
_videoDisplay.totalTime);
                        return rText;
                }
                
                private function formatTime(value:Number):String {
                        var minutes:Number = Math.floor(value / 60);
                        var seconds:Number = Math.floor(value % 60);
                        var rString:String = "( " + addZeroes(minutes) + " : " +
addZeroes(seconds) + " )";
                        return rString;
                } 
                                
                private function addZeroes(value:Number):String {
                        var newValue:String = "";
                        if(value < 10) {
                                newValue = "0" + value.toString();
                        } else {
                                newValue = value.toString();
                        }
                        return newValue;
                }
        }
        
}
</pre>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to