toolTip类响应号召用AS2.0编写
作者 佚名技术
来源 服务器技术
浏览
发布时间 2012-07-14
class toolTip { private var _tip:String; private var _movie:MovieClip; private var _color:String = "0xffffe1"; private var _style:String; private var width:Number = 0; private var height:Number = 0; private var _timer:Number = 450; private var _effects:String; private var selected:Boolean = true; public function get _width() { return width; } public function set _width(w) { width = w; } public function get _height() { return height; } public function set _height(h) { height = h; } public function get parent() { return _movie._parent; } public function get style() { return _style; } public function set style(s:String) { _style = s; } public function get effects() { return _effects; } public function set effects(e:String) { _effects = e; } public function get tip() { return _tip; } public function set tip(str:String) { _tip = str; } public function set movie(m) { _movie = m; } public function get color():String { return _color; } public function set color(cl:String) { _color = cl; } public function toolTip(movie:MovieClip, tip:String) { _movie = movie; _tip = tip; } public function Show() { var path = this; _movie.onRollOver = function() { var tip_mc = this._parent.createEmptyMovieClip("t_toolTip", _root.getNextHighestDepth()); path.msgBox(tip_mc); path.Cheak(tip_mc); }; removeTip(parent.t_mc); } public function showTip() { var path = this; _movie.onRollOver = function() { var timer = getTimer(); this._parent.onEnterFrame = function() { var time = getTimer(); if (time-timer>=path._timer) { path.Draw(); delete _root.onEnterFrame; } //end if }; //end onE }; //end onR removeTip(); } function removeTip() { var path = this; _movie.onRollOut = _movie.onReleaseOutside=_movie.onPress=function () { this._parent.Tip_toolTip.removeMovieClip(); this._parent.t_toolTip.removeMovieClip(); delete _root.onEnterFrame; }; } function Draw() { var path = this; var tip_mc = parent.createEmptyMovieClip("Tip_toolTip", _root.getNextHighestDepth()); with (tip_mc) { lineStyle(1, "0x000000", 50); beginFill(path._color, 100); moveTo(0, 0); switch (path.style) { default : //矩形 lineTo(path.width, 0); lineTo(path.width, path.height); lineTo(0, path.height); lineTo(0, 0); endFill(); } } Effects(tip_mc); Cheak(tip_mc); msgBox(tip_mc); } function Cheak(mc:MovieClip) { var path = this; with (mc) { (_xmouse+_width) var b:Object = path._movie.getBounds(mc._parent); (b.yMin-_height-2)>0 ? _y=b.yMin-_height-2 : _y=b.yMax+2; } } function msgBox(mc:MovieClip) { var path = this; mc.createTextField("msg", _root.getNextHighestDepth(), 2, -2, width, height); with (mc.msg) { HTML = true; htmlTe |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于toolTip类响应号召用AS2.0编写的所有评论