从点击as2截取对象

时间:2013-07-02 12:13:09

标签: for-loop actionscript onclick actionscript-2 movieclip

在ActionScript2中有一种拦截movieClip点击的方法吗?

我会解释;我有这段代码:

planGroup.createEmptyMovieClip("textObject", 90);

if (textArray != "")
{
    for (tn = 0; tn < textArray.length; tn++)
    {
        textFormat = new TextFormat();
        textFormat.size = 100 * 0.35;

        var lbl = planGroup.textObject.createTextField("My_Instance_Name", tn,xt - minPlanX, yt - minPlanY,150,90);
        lbl.text = textArray[tn].attributes.text;

        xt = textArray[tn].attributes.x * multFactor;
        yt = -textArray[tn].attributes.y * multFactor;

        planGroup.textObject.createEmptyMovieClip("invis", getNextHighestDepth());
        with (planGroup.textObject.invis) {
          beginFill(0x22ffff, 50);
          moveTo(xt - minPlanX, yt - minPlanY);
          lineTo(xt - minPlanX + 150, yt - minPlanY);
          lineTo(xt - minPlanX + 150, yt - minPlanY + 90);
          lineTo(xt - minPlanX, yt - minPlanY + 90);
          lineTo(xt - minPlanX, yt - minPlanY);
          endFill();
        }
        planGroup.textObject.onRelease = function() {
          trace("click");
        }

这是我想使文本可点击..并且使用这个代码,但是我希望onRelease()在不同的文本上做出不同的东西..那么,我怎样才能理解点击的来源?

此外,我注意到形状仅在'for'的最后一项上绘制。

有什么想法吗?提前致谢!

0 个答案:

没有答案