我有這個ActionScript 2.0文件,用於爲我的Flash中的一些影片剪輯創建工具提示。 我打電話我的場景的#include的第一幀tooltip.as「tooltip.as」 而我給一個字符串,我提示ActionScript 2緩慢運行
var tooltip:String="Assembleia Geral\nAlice Freitas, Presidente\nJorge Correia, 1º Secretário\nCeleste Madureira, 2º Secretário\n"
tooltip.as的內容:
import mx.transitions.Tween;
var lst:Object = new Object();
this.createEmptyMovieClip ("d_mc", 650000);
var mc_isim:String = new String();
function olustur (f_mc:MovieClip, f_str:String)
{
var my_fmt:TextFormat = new TextFormat();
my_fmt.size = 13;
my_fmt.font = "Arial";
var w:Number = f_str.length * my_fmt.size/3 * 2;
var h:Number = 20;
f_mc.createEmptyMovieClip ("tool_mc", 5);
f_mc.tool_mc.createTextField ("tool_txt", 1, 5, 5, 10, 10);
f_mc.tool_mc.tool_txt.autoSize = true;
f_mc.tool_mc.tool_txt.setNewTextFormat (my_fmt);
f_mc.tool_mc.tool_txt.text = f_str;
f_mc.tool_mc.tool_txt._visible = false;
f_mc.tool_mc.beginFill (0xCDCDCD, 80);
f_mc.tool_mc.lineStyle (1);
f_mc.tool_mc.moveTo (5, 5);
f_mc.tool_mc.lineTo (f_mc.tool_mc.tool_txt._width+10, 5);
f_mc.tool_mc.lineTo (f_mc.tool_mc.tool_txt._width+10, (f_mc.tool_mc.tool_txt._height + 5));
f_mc.tool_mc.lineTo (5, (f_mc.tool_mc.tool_txt._height + 5));
f_mc.tool_mc.lineTo (5, 5);
f_mc.tool_mc.endFill();
f_mc.tool_mc._y = 0 - h;
f_mc.tool_mc._visible = false;
var bos:Tween = new Tween (f_mc.tool_mc, "_x", null, f_mc.tool_mc._x, f_mc.tool_mc._x, 2, true);
bos.onMotionFinished = function()
{
f_mc.tool_mc._visible = true;
var my:Tween = new Tween (f_mc.tool_mc, "_alpha", null, 0, 100, 1, true);
my.onMotionFinished = function()
{
f_mc.tool_mc.tool_txt._visible = true;
my.stop();
};
};
}
lst.onMouseMove = function()
{
d_mc.startDrag (true);
if (typeof (eval (d_mc._droptarget)) == "movieclip")
{
f_mc = eval (d_mc._droptarget);
if (f_mc.tooltip != undefined)
{
d_mc._visible = true;
if (mc_isim != f_mc._name)
{
olustur (d_mc, f_mc.tooltip);
mc_isim = f_mc._name;
}
}
}
else
{
d_mc._visible = false;
}
};
Mouse.addListener (lst);
我的問題是:我可以使這個工具提示出現得更快嗎?大約需要2秒鐘才能出現。
定義 – David 2013-03-21 15:11:42
工具提示需要很長時間才能出現,大約2秒 – 2013-03-21 16:23:43