1
votes

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.

2
possible duplicate of Flash CS5 won't execute AS3 codeshanethehat
@shanethehat How is marking this a 'possible duplicate' helpful if a) that post has no correct answers and b) I obviously know about that question, since I asked it and I referenced it in my post?Esaevian
The preferred approach is to update your existing question with more info. Whenever you edit the question it will get bumped back up the front page.shanethehat

2 Answers

0
votes

This may be a silly question but did you set the Document Class in the .FLA?

0
votes

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