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
11
votes
7 answers

How to determine if a string contains a specific substring

Given a string A, how can I determine if that string contains the substring "video/x-flv"?
Rella
  • 65,003
  • 109
  • 363
  • 636
11
votes
5 answers

Can ActionScript tell when a SWF was published?

I'd like to write a little class that adds a Day/Month box showing the date a SWF was published from Flash. The company I work for regularly produces many, many SWFs and many versions of each, iterating over the course of months. A version-tracking…
ivanreese
  • 2,718
  • 3
  • 30
  • 36
11
votes
6 answers

Get Current Browser URL - ActionScript 3

I'm trying to get current browser url. I have already tried with External Call, and it didn't work. And with loaderInfo.url I receive the current SWF url.
lfduvidas
  • 111
  • 1
  • 1
  • 3
11
votes
4 answers

Understanding Array::splice in ActionScript 3

I am trying to remove an object from an array, but for some reason it's not working. I am under the impression that a splice accepts 2 parameters: first, the position in the array to begin at. And for parameter 2, how many to delete from then on…
numerical25
  • 10,524
  • 36
  • 130
  • 209
11
votes
5 answers

remove a listener that has an anonymous function in Actionscript 3

up.addEventListener(MouseEvent.CLICK, function clickFunc(event:MouseEvent):void { revealSpinner(event,51.42,1,spinner); event.currentTarget.removeEventListener(event.type, arguments.callee); autoTimer.stop(); …
ed209
  • 11,075
  • 19
  • 66
  • 82
11
votes
3 answers

Finding the actual text height AS3

How can I get the actual height of a text in AS3 TextField? It appears that TextField.textHeight reports some fixed value that doesn't depend on the contents of a TextField. The example code below produces the following: text=o p g y d…
user1566515
  • 1,637
  • 4
  • 17
  • 25
11
votes
1 answer

actionscript 3 and JSON

I've been trying to get JSON working with AS3 for a while now, but to no avail. I keep getting the following error when I get the JSON back: TypeError: Error #1034: Type Coercion failed: cannot convert Object@26331c41 to Array. I've tried changing…
minimalpop
  • 6,997
  • 13
  • 68
  • 80
11
votes
3 answers

Passing a function to another function in Actionscript 3

I have a function that passes an array to another function as an argument, there will be multiple data types in this array but I want to know how to pass a function or a reference to a function so the other function can call it at any…
Brandon
11
votes
7 answers

Actionscript3: Does variable exist?

I'm a little bit new to Actionscript, but I can't figure this one out. I've done a lot of searching on this topic and haven't found a clear answer. I've tried the following solutions that people posted online but none of them work. All the following…
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
11
votes
6 answers

E4X Add CDATA content

Basically I need to define a node name and its CDATA content using variables. var nodeName:String = "tag"; var nodeValue:String = ""; Naively I thought this would work : var xml:XML =…
Theo.T
  • 8,905
  • 3
  • 24
  • 38
11
votes
4 answers

AS3 Timers vs. ENTER_FRAME performance

I'm building a game that got some moving things all the time, so I'm using a lot of Timer instances to control repetition and trigger motion. Now the thing is that I started to notice some performance "lags". Is this due to the timers? and do you…
Makram Saleh
  • 8,613
  • 4
  • 27
  • 44
11
votes
2 answers

How to divide tiny double precision numbers correctly without precision errors?

I'm trying to diagnose and fix a bug which boils down to X/Y yielding an unstable result when X and Y are small: In this case, both cx and patharea increase smoothly. Their ratio is a smooth asymptote at high numbers, but erratic for "small"…
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
10
votes
1 answer

In Actionscript 3, why is the dynamic type of large int values Number?

I have noticed that if I create an int with a large value, the dynamic type of the object seems to be Number. Example: var int1:int = 0x8000000; var type1:String = flash.utils.getQualifiedClassName(int1); // Returns "int" var int2:int =…
user829876
  • 723
  • 5
  • 6
10
votes
3 answers

Check if a string is empty in action script, similar to String.Empty in .net

Is there a static property in Action similar to that in the String object in .net to check if a string is empty, that is String.Empty. Thanks
Hassan Mokdad
  • 5,832
  • 18
  • 55
  • 90
10
votes
3 answers

How can I convert curveTo() to a list of Points?

Take the following AS3 that will draw a curved line using curveTo(): var line:Shape = new Shape(); line.x = line.y = 20; line.graphics.lineStyle(2, 0xFF0000); line.graphics.curveTo(200, 200, 200, 0); addChild(line); The resulting visual is: Now…
Marty
  • 39,033
  • 19
  • 93
  • 162