background preloader

Flash

Facebook Twitter

ActionScript 3.0 Language and Components Reference. The ActionScript® 3.0 Reference for the Adobe® Flash® Platform contains the ActionScript language elements, core libraries, and component packages and classes for the tools, runtimes, services and servers in the Flash Platform.

ActionScript 3.0 Language and Components Reference

Filter by product using the preset filters This reference combines the information about the ActionScript language elements and libraries for the following Adobe products and runtimes. Click on a product name below to filter this reference to show only the content for the latest version of that product and related runtimes: Filter by product using the filter controls. Using the Ternary Operator in ActionScript 3.0. There's no shame in shortcuts, and when you're combing through massive amounts of code each day, every line helps!

Using the Ternary Operator in ActionScript 3.0

Many programmers across a variety of languages have long enjoyed the benefits of the ternary operator, a convenient shorthand that can be used in lieu of a standard if/else statement. The ternary operator (pronounced "toy-nairy opratuh" in New York) provides an elegant method of compacting down code where a basic true/false conditional is needed. Let's taken an everyday scenario: You're at the breakfast table eating Cheerios (or Fruity Pebbles, if large amounts of sugar and food dye are your thing), and suddenly realize you have to test the value of a Boolean variable in your code to shut the visibility of a display item on or off.

A possible and typical solution to this would be as follows: AS3 Tip: Pass …rest arguments w/ other arguments to a function. That’s about as good a title as I could come up with here.

AS3 Tip: Pass …rest arguments w/ other arguments to a function

Background This code passes 14 arguments to fun1, which is completely legit. fun1 then passes all 14 arguments to fun2. The trace output would be: That’s easy, right?