Whenever I compile a swf in Flash, nothing happens. 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.
Is there a way to get Flash to recognize Actionscript again?
Using Flash CS5 on Mac OSX 10.6.8
My other thread that has more information (but no answers), if you need it: Flash CS5 won't execute AS3 code
Here's some of the code:
Frame 1:
trace('Hello World: Frame'); //doesn't trace
And in the document class, 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. It involved a regrettable reinstall of the entire Flash CS5 app, as well as wiping out my preferences while uninstalling. Seems like the preference file just got corrupted. Hope this won't happen after another year of use.
这可能是一个愚蠢的问题,但是您是否在.FLA中设置了文档类?
Try installing the flash debugger. 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. This is required if you use Flash Builder, anyway. Not sure about Flash CS.
ADOBE FLASH PLAYER 11 — 32 BIT DEBUGGER
EDIT: As an alternative, you can try using ExternalInterface to make sure your code is working correctly. This can help with troubleshooting your system. Here's a tutorial: Debugging in ActionScript 3.0 – Part 1 – Trace Tutorial
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.