Copy link to clipboard
Copied
Hi All,
I'm a learning novice.
When I was working in Director, I could type a line of code (an 'if/then' statement, for example) into a window and hit enter and it would run and show me if the code was functional. It would send results to an 'output' window (the sum of a math function, for example) or I could have the system produce a beep, etc.
Is there anything comprable in Flash CS5?
Thanks
Copy link to clipboard
Copied
The closest thing is just creating a new document and typing code on the timeline. I do that all the time.
Copy link to clipboard
Copied
Use the trace function. The code will always have to be compiled.
Code that doesn`t afflict the stage will result in an empty movie
trace(1+2)
//outputs 3
import flash.system.Capabilities;
trace(flash.system.Capabilities.screenResolutionX);
//outsputs horizontal resolution
Copy link to clipboard
Copied
Ok I'll continue to use new, stripped down movies to test.
Thanks Aaron and moccamaximum.
Copy link to clipboard
Copied
There are several ways. When you're working in an ActionScript Class in the Flash IDE, there's a little check box you can click that will check to see if the syntax is valid.
If you create a Flash Project in Flash Builder and leave "Build Automatically" on, it will compile the project every time you save a change, reporting problems to the error window. This can be time-consuming, so I usually leave that off and just compile when I need to useing Ctrl-B (Build all).
You can also create and run unit tests. I might at one point have recommended that you use FlexUnit with Flash Builder, but the process for getting that set up is not trivial, particularly if you've never used FlexUnit with Flex. So today I'd say you might want to look at ASUnit. Unit tests are a good practice anyway.
Copy link to clipboard
Copied
Thanks Amy.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now