Questions tagged [actionscript-3]

ActionScript 3 (AS3) is the open source object oriented programming (OOP) language of the Adobe Flash and AIR Platforms. AS3 is widely used for RIAs, mobile apps, and desktop applications. (ActionScript 3 is a dialect of ECMAScript.)

ActionScript 3 (AS3), developed by Adobe, is an open source, object-oriented programming (OOP) language. It is a dialect of ECMAScript.

AS3 can be used to create web programs deployed using Flash Player, applications for iOS, Android, Blackberry (PlayBook OS and BlackBerry 10), and desktop using Adobe AIR, as well as TV applications using Adobe AIR for TV.

ActionScript is an object-oriented language originally developed by Macromedia Inc. (now owned by Adobe Systems). It is a dialect of ECMAScript (meaning it is a superset of the syntax and semantics of the language more widely known as JavaScript), and is used primarily for the development of websites and software targeting the Adobe Flash Player platform, used on Web pages in the form of embedded SWF files. The language itself is open-source in that its specification is offered free of charge and both an open source compiler (as part of Apache Flex) and open source virtual machine (Mozilla Tamarin) are available.

References:

Books:

Useful Links:

41246 questions
22
votes
3 answers

How do you decide between using an Abstract Class and an Interface?

I have been getting deeper into the world of OOP, design patterns, and actionscript 3 and I am still curious how to know when to use an Abstract class (pseudo for AS3 which doesn't support Abstract classes) and an interface. To me both just serve…
Brian Hodge
  • 2,125
  • 2
  • 19
  • 29
22
votes
3 answers

How to define enum in as3?

Is there a way to define an enum in AS3 in a way we do it in other languages? I can define constants with defined values like that: private const CONST_1:int = 0; private const CONST_2:int = 1; private const CONST_3:int = 2; and so on. If I want to…
Nava Carmon
  • 4,523
  • 3
  • 40
  • 74
21
votes
4 answers

Interactive ActionScript interpreter?

Is there some sort of interactive ActionScript interpreter? Similar to Firebug's JavaScript command line or Python's interactive shell?
David Wolever
  • 148,955
  • 89
  • 346
  • 502
21
votes
5 answers

How to determine if an associative array has a key?

In ActionScript 3, is there any convenient way of determining if an associative array (dictionary) has a particular key? I need to perform additional logic if the key is missing. I could catch the undefined property exception, but I'm hoping that…
Soviut
  • 88,194
  • 49
  • 192
  • 260
21
votes
5 answers

Enums in AS3 / Flash / Flex?

One thing I really like about AS3 over AS2 is how much more compile-time type-checking it adds. However, it seems to be somewhat lacking in that there is no type-checked enumeration structure available. What's a good (best / accepted) way to do…
HanClinto
  • 9,423
  • 3
  • 30
  • 31
21
votes
8 answers

Calculating Text Width In ActionScript And Flex

I'm trying to calculate how WIDE to make my button, based on the text that it will contain, and when I try to google for how to calcuate something as simplistic as the WIDTH OF SOME TEXT, I go cross-eyed just trying to wade through apparently…
Joshua
  • 6,643
  • 15
  • 55
  • 76
21
votes
5 answers

How to explain to client that you can't give them some of the source

We have a number of AS/Flex components that we've built over time and improved upon. They've been turned into components so they can be reused in different projects and save us time. So you can think of them as part of an in-house framework of…
Bo.
  • 229
  • 2
  • 5
21
votes
3 answers

How to control indentation after an open parenthesis in Emacs

When I use emacs python-mode, if the last character of a line is an open parenthesis it indents the next line just one step in from the indentation of the previous line. call_some_function( …
lacker
  • 5,470
  • 6
  • 36
  • 38
21
votes
1 answer

MXMLC in Flex SDK 4.5 doesn't work on Mac OS 10.8

Starting mxmlc on the latest mac exits with error message: Error: This Java instance does not support a 32-bit JVM. Please install the desired version. How to fix?
20
votes
6 answers

how do I delete/gc an object in Actionscript 3?

I want to delete/force garbage collection on a class instance from inside itself. Obviously, this = null and delete this don't work. Is it any way I can do that, or am I barking up the wrong tree? I'm basically looking for a destructor of some…
evilpenguin
  • 5,448
  • 6
  • 41
  • 49
20
votes
4 answers

Flex / Air obfuscation

I've written (most of) an application in Flex and I am concerned with protecting the source code. I fired up a demo of Trillix swf decompiler and opened up the swf file that was installed to my Program Files directory. I saw that all of the…
Shawn
  • 19,465
  • 20
  • 98
  • 152
20
votes
3 answers

How do I access the global object (window) using webpack?

I'm trying to interface ActionScript with JavaScript using ExternalInterface and webpack. ExternalInterface can only provoked (call) functions found on the global object (window). How can I get a webpack module reference on window (global…
20
votes
5 answers

As3 - How to clear an array efficiently?

I've been looking to clear an array in ActionScript 3. Some method suggest : array = []; (Memory leak?) Other would say : array.splice(0); If you have any other, please share. Which one is the more efficient? Thank you.
ALOToverflow
  • 2,679
  • 5
  • 36
  • 70
20
votes
3 answers

Flash Actionscript 3 Bug? Using an int and negative numbers in a switch/case

Running this code var myValue1:int = 2; switch (myValue1) { case -3: trace(myValue1 + " == -3"); break; case -2: trace(myValue1 + " == -2"); break; case -1: trace(myValue1 + " == -1"); break; case 0: trace(myValue1 + " == 0");…
20
votes
5 answers

Flash performance for game dev: native render VS BitmapData framebuffer

I develop a 2D shooter game with lots of objects and aggressive scrolling. QUESTION: which way is better? CHOICE 1 - use native Flash rendering: derive game objects from Bitmap, use existing x, y, width, height, bitmapData add all objects as…
oshyshko
  • 2,008
  • 2
  • 21
  • 31