快速业务通道

toolTip类响应号召用AS2.0编写

作者 佚名技术 来源 服务器技术 浏览 发布时间 2012-07-14


http://www.Flash8.net/bbs/UploadFile/2004-12/2004125175742571.swf
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) _y = _ymouse;
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 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号