Flash CS5 won't execute AS3 code

时间秒杀一切 提交于 2019-12-11 07:35:26

问题


I am getting a strange issue in Flash CS5. I have a .fla file that was working fine up until recently. Now, when I Ctrl-Enter to Test Movie...nothing happens.

I have a Document Class set up (and when I click the pencil button, it opens up the right script, so Flash knows where the code is) called Main. In the constructor, there is a trace('Main()') just so I know the constructor got called, but that trace isn't showing up. A few days ago this same code was working fine, so i'm guessing I knocked around a setting or two in the IDE (not sure which, since Flash has the classpath set correctly)

Thanks in Advance,
-Esa

EDIT: Here's a worrying line from the Size report...Why is Actionscript Bytes '0'?

Scene      Shape Bytes    Text Bytes    ActionScript Bytes  
-------    -----------    ----------    ------------------  
Scene 1              0             0                     0

EDIT 2: I also added a trace to the timeline, and that still doesn't show up (and ActionScript Bytes is still 0...the swf size hasn't actually changed even though I added the code).
Also I have restarted the program several times, and even restarted my computer (and did the 'Delete ASO' thing that Mattias suggested). No dice.


回答1:


Try copying only the files you need (.as, .fla) into a different folder and recompile. If a big project has too many files within the main directory I think it just gets tired midway while compiling




回答2:


Seems like Flash lost the connection to the document class.

First try to remove the cache:

  1. Control -> Delete ASO
  2. Hit Ctrl-Enter

If it still does not work:

  1. Remove the document class and hit Ctrl-Enter.
  2. Add the document class again and give it a new try.

If it still does not work, try changing to an other Document Class to see if that works.

Hope this helps.




回答3:


Are you sure the FLA is set to AS3 (and not AS2) ?



来源:https://stackoverflow.com/questions/7599542/flash-cs5-wont-execute-as3-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!