“ReferenceError:错误 #1065:变量 TCMText 未定义”是什么意思?意思是?

发布于 2024-12-11 06:42:12 字数 566 浏览 1 评论 0原文

当您单击一个圆圈时,它的大小应该加倍。但是我收到错误:

ReferenceError:错误#1065:未定义变量TCMText。

我认为这是因为我选择了文本和圆圈并将选择作为单个符号。有谁知道如何将形状和符号组合在一起而不会收到此错误消息?

在此处输入图像描述

import flash.events.MouseEvent;

circOne.addEventListener(MouseEvent.CLICK, doubleSize);
circTwo.addEventListener(MouseEvent.CLICK, doubleSize);
circThree.addEventListener(MouseEvent.CLICK, doubleSize);

function doubleSize(event:MouseEvent):void{
    e.currentTarget.scaleX=2;
    e.currentTarget.scaleY=2;
}

When you click a circle it should double in size. However I get the error:

ReferenceError: Error #1065: Variable TCMText is not defined.

I think it's because I selected both the text and circle and made the selection a single symbol. Does anyone know how to combine a shape and symbol together without getting this error message?

enter image description here

import flash.events.MouseEvent;

circOne.addEventListener(MouseEvent.CLICK, doubleSize);
circTwo.addEventListener(MouseEvent.CLICK, doubleSize);
circThree.addEventListener(MouseEvent.CLICK, doubleSize);

function doubleSize(event:MouseEvent):void{
    e.currentTarget.scaleX=2;
    e.currentTarget.scaleY=2;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

缱倦旧时光 2024-12-18 06:42:12

除了运行时错误之外,您还会遇到编译器错误,请按照@recursivity所说修复代码:

function doubleSize(e:MouseEvent):void
{
    e.currentTarget.scaleX=2;
    e.currentTarget.scaleY=2;
}

检查“编译器错误”选项卡,如果出现任何错误,您几乎可以忽略任何错误您可以从 Flash 中获得更多输出和行为。

编辑:将许多不同的元素一起选择然后将它们(或“组合”)形成符号(MovieClip)绝对没有任何错误。

在编译器错误(这是一种非常奇怪的行为)之后出现运行时 ReferenceError 的原因是因为您正在使用 TLF 文本字段,请检查 adobe 论坛上的此帖子 了解更多信息。为了简单起见,我的建议是切换到经典文本文本字段(TextField 属性面板中有一个下拉选择器,Flash CS5+ 上默认为 TLF)。

Besides that runtime error, you are getting Compiler errors, fix your code as @recursivity said:

function doubleSize(e:MouseEvent):void
{
    e.currentTarget.scaleX=2;
    e.currentTarget.scaleY=2;
}

Check the "Compiler Errors" tabs, and if you are getting any, you can pretty much ignore any further output and behavior you get from your Flash.

EDIT: There is absolutely nothing wrong on selecting many different elements together and then making them (or "combining") into a Symbol (MovieClip).

The reason you are getting a runtime ReferenceError AFTER a compiler error (which is a very weird behavior) is because you are using TLF textfields, check this thread on the adobe forums for more information. My advice, for the sake of simplicity, is to switch to Classic Text textfields (There is a dropdown selector in the TextField properties panel, TLF is by default on Flash CS5+).

梦太阳 2024-12-18 06:42:12

当我使用 new Rectangle 绘制形状并将其添加到舞台时,触发了我的 TCMText 错误。绘制矩形没有触发错误。当我去将其添加到舞台时,出现了错误。当我尝试使用 Shape 和graphics.rect 绘制矩形时,发生了同样的事情。我终于通过使用 Shape 和 moveTo/lineTo 得到了没有 TCMText 错误的矩形。在 Adob​​e 论坛上,有人指出没有选项可以禁用此功能。

My TCMText error got triggered when I used new Rectangle to draw a shape and add it to the stage. Drawing the rectangle didn't trigger the error. The error popped up when I went to add it the stage. The same thing happened when I then tried to draw the rectangle using Shape and graphics.rect. I finally got my rectangle without the TCMText error by using Shape and moveTo/lineTo. On the Adobe forum someone states that there's no option to disable this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文