| 首页 | 新闻 | 网页 | 设计 | 色彩 | 原创 | 视觉 | 素材 | 动漫 | 酷站 | 策划 | 文案 | 访谈 | 运营 | 编程 | 数据库 | 服务器 | 下载 | 图库 | 
您的位置: 幽幽天空 > 网页 > 网页制作 > Flash教程 > ActionScript教程 > 文章正文 用户登录
网络营销之google
Google质疑艾瑞报
google使用技巧
Google Adsense改
王通:Google应该
Google真的那么容
Google 广告联盟
TOM ULINK新闻联盟
iPlus广告联盟:4
Google Adsense将

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

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

作者:佚名 来源:闪吧 作者: xucan 更新:2007-1-13 20:46:50 错误报告 我要投稿


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)<Stage.width ? _x=_xmouse : _x=Stage.width-_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;
htmlText = path.tip;
selectable = false;
if (mc == path.parent.t_toolTip) {
autoSize = true;
background = true;
border = true;
borderColor = "0x000000";
backgroundColor = path._color;
} else {
autoSize = "right";
multiline = true;
wordWrap = true;
}
//end if
}
//end with
}
//end function
function Select(mc) {
}
function Effects(mc:MovieClip) {
switch (_effects) {
case "淡出" :
mc._alpha = 0;
mc.onEnterFrame = function() {
this._alpha += 30;
};
if (mc._alpha == 100) {
break;
}
default :
break;
}
}
}

源代码
点击浏览该文件

效果
点击浏览该文件

文章录入:skyuu    责任编辑:skyuu 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    发表评论:
    姓名:  评 分: 1分 2分 3分 4分 5分
     
  • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
  • 用户需对自己在使用幽幽天空服务过程中的行为承担法律责任。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表机友个人观点,与本网站立场无关。