简体   繁体   English

Flash CS5 SWF编译中未包含ActionScript

[英]Actionscript not included in Flash CS5 swf compile

Whenever I compile a swf in Flash, nothing happens. 每当我在Flash中编译swf时,都不会发生任何事情。 No traces, no compile errors, nothing. 没有痕迹,没有编译错误,什么都没有。 The swf that is produces is severely limited in size (several times smaller than the file with Actionscript), leading me to believe that Flash is outright ignoring the code. 生成的SWF文件的大小受到严格限制(比使用Actionscript的文件小几倍),这使我相信Flash完全忽略了代码。

Is there a way to get Flash to recognize Actionscript again? 有没有办法让Flash重新识别ActionScript?

Using Flash CS5 on Mac OSX 10.6.8 在Mac OSX 10.6.8上使用Flash CS5

My other thread that has more information (but no answers), if you need it: Flash CS5 won't execute AS3 code 我的另一个具有更多信息(但没有答案)的线程(如果需要): Flash CS5将不会执行AS3代码

Here's some of the code: 这是一些代码:

Frame 1: 框架1:

trace('Hello World: Frame'); //doesn't trace

And in the document class, Main.as 在文档类Main.as中

public class Main extends Movieclip
{
    public function Main()
    {
        trace("Hello World: Doc"); //doesn't trace
        this.addEventListener(Event.ADDED_TO_STAGE, onAdded);       
    }

    public function onAdded(e:Event)
    {
        trace("Main: onAdded()");
        //more stuff about loading in external content
        //this function never gets run, since the constructor doesn't get run.
    }
}

ANSWER FOUND See Plastic Sturgeon's comment. 答案见《塑料St鱼》的评论。 It involved a regrettable reinstall of the entire Flash CS5 app, as well as wiping out my preferences while uninstalling. 遗憾的是,整个Flash CS5应用程序都重新安装,并且在卸载时清除了我的偏好设置。 Seems like the preference file just got corrupted. 似乎首选项文件已损坏。 Hope this won't happen after another year of use. 希望在使用一年后不会发生这种情况。

这可能是一个愚蠢的问题,但是您是否在.FLA中设置了文档类?

Try installing the flash debugger. 尝试安装Flash调试器。 Install the Netscape-compatable content debugger if you use Chrome, Firefox, Safari, Opera, etc... Install the ActiveX control content debugger if you use IE for testing. 如果您使用Chrome,Firefox,Safari,Opera等,请安装与Netscape兼容的内容调试器。如果您使用IE进行测试,请安装ActiveX控件内容调试器。 This is required if you use Flash Builder, anyway. 无论如何,如果您使用Flash Builder,这是必需的。 Not sure about Flash CS. 不确定Flash CS。

ADOBE FLASH PLAYER 11 — 32 BIT DEBUGGER ADOBE FLASH PLAYER 11 — 32位调试器

EDIT: As an alternative, you can try using ExternalInterface to make sure your code is working correctly. 编辑:作为一种选择,您可以尝试使用ExternalInterface来确保您的代码正常工作。 This can help with troubleshooting your system. 这有助于对系统进行故障排除。 Here's a tutorial: Debugging in ActionScript 3.0 – Part 1 – Trace Tutorial 这是一个教程: 在ActionScript 3.0中进行调试–第1部分–跟踪教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM