09.08.08
List of 22 ActionScript 3.0 API’s
Adobe APIs
corelib, mappr, flickr, youtube and more.
http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries
APE (Actionscript Physics Engine)
http://www.cove.org/ape/
as3awss3lib
ActionScript 3.0 library for interacting with Amazon S3
http://code.google.com/p/as3awss3lib/
as3soundeditorlib
Actionscript 3.0 library for sound editing
http://code.google.com/p/as3soundeditorlib/
as3ds
AS3 Data Structures For Game Developers
http://code.google.com/p/as3ds/
ASCOLLADA
http://code.google.com/p/ascollada/
As3Crypto
ActionScript 3 Cryptography Library
http://crypto.hurlant.com/
asinmotion
Animation Library for AS3
http://code.google.com/p/asinmotion/
Away3d
http://code.google.com/p/away3d/
ebay API
http://code.google.com/p/as3ebaylib/
facebook-as3
AS3 API to access Facebook’s Platform API
http://code.google.com/p/facebook-as3/
flest
Flest Framework for Adobe Flex and ActionScript3 Applications
http://code.google.com/p/flest/
FZip
Actionscript 3 class library to load standard ZIP archives and extract/decompress contained files.
http://codeazur.com.br/lab/fzip/
lastfm-as3
Actionscript 3.0 library to access the Last.fm web services
http://code.google.com/p/lastfm-as3/
MapQuest
http://company.mapquest.com/mqbs/4a.html
mecheye-as3-libraries
A set of ActionScript 3 Libraries, primarily for Flash game development.
http://code.google.com/p/mecheye-as3-libraries/
Papervision3D
http://code.google.com/p/papervision3d/
Salesforce Flex Toolkit
http://wiki.apexdevnet.com/index.php/Flex_Toolkit
Tweener
Full featured animation library
http://code.google.com/p/tweener/
Twitter AS3 API
http://twitter.com/blog/2006/10/twitter-api-for-flash-developers.html
uicomponents-as3
Lightweight AS3 UI component library
http://code.google.com/p/uicomponents-as3/
XIFF
XMPP client library
http://svn.igniterealtime.org/svn/repos/xiff/branches/xiff_as3_flexlib_beta1/
Yahoo AS3 APIs
http://developer.yahoo.com/flash/as3_api_libraries.html
08.11.08
Flash/ Flex Error
ActionScript 3 Error: 1038: Target of break statement was not found.
ActionScript 3 Error #1038 Description:
A break statement is used only with loops. They will not work in if statements. This is directly from the documentation:
Appears within a loop (for, for..in, for each..in, do..while, or while) or within a block of statements associated with a particular case in a switch statement. When used in a loop, the break statement instructs Flash to skip the rest of the loop body, stop the looping action, and execute the statement following the loop statement. When used in a switch, the break statement instructs Flash to skip the rest of the statements in that case block and jump to the first statement that follows the enclosing switch statement.
In nested loops, break only skips the rest of the immediate loop and does not break out of the entire series of nested loops. To break out of an entire series of nested loops, use label or try..catch..finally.
The break statement can have an optional label that must match an outer labeled statement. Use of a label that does not match the label of an outer statement is a syntax error. Labeled break statements can be used to break out of multiple levels of nested loop statements, switch statements, or block statements. For an example, see the entry for the label statement.
Pay attention to the last two paragraphs if you want to break all the way out of a function/method rather than just the loop that the break statement is inside then you need to use label. A very handy but seldom used method
Flex / Flash Error #1038 Fix:
Make sure that your break statement is within a valid loop such as for, while, switch statements, etc… Another alternative is to use a return statement without any parameters. Warning: Using return will break out of the function entirely and will not execute any code after the if statement. return is typically used as the last line of code in a function.
Bad Code:
if (totalScore < 10)
{
finalMsg = “Sorry!<br /> You need more practice”;
break;
}
else if (totalScore < 20)
{
finalMsg = “Congratulations!<br /> You kept yourself and others safe”;
break;
}
Good Code:
if (totalScore < 10)
{
finalMsg = “Sorry!<br /> You need more practice”;
return;
}
else if (totalScore < 20)
{
finalMsg = “Congratulations!<br /> You kept yourself and others safe”;
//break can be removed to get rid of the error;
}
This should help you resolve Flex / Flash Warning #1038
ActionScript 3 Error #1061: Call to a possibly undefined method addEvent through a reference with static type flash.utils:Timer.
ActionScript 3 Error #1061 Description:
AS3 error 1061 appears when you have misspelled a property or function and have not assigned a value to it. If you haven’t properly typed the Object to begin with you will get AS3 Error 1069. See the examples below. AS3 error 1061 is actually pretty nice to work with because it tells you exactly which method/property didn’t work and it tells you which object it didn’t work on.
Flash / Flex Error 1061 Fix:
Find the object listed in the error and then check the spelling after the dot.
Bad Code 1:
var t:Timer = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick);
Good Code 1:
var t:Timer = new Timer(1000, 60);
t.addEventListener(TimerEvent.TIMER, Tick);
Related ActionScript Error(s):
Flash / Flex Error 1069 - You will get AS3 Error 1069 instead of 1061 if you don’t properly type your object before referencing a property on it. For example var t:Timer = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick); will give error 1061 but var t = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick); will give Error 1069.
Flash / Flex Error 1119 - The dreaded AS 3 Error 1119
Flash / Flex Error 1056 - This is the error you will get if you try and call a property with a misspelled name in the same way as calling a property with a misspelled name.
ReferenceError: Error #1069: Property addEvent not found on flash.utils.Timer and there is no default value.
ActionScript 3 Error #1069 Description:
AS3 error 1069 appears when you have misspelled a property or function and have not assigned a value to it. If you have properly typed the Object to begin with you will get AS3 Error 1061. See the examples below. AS3 error 1069 is actually pretty nice to work with because it tells you exactly which method/property didn’t work and it tells you which object it didn’t work on.
Flash / Flex Error 1069 Fix:
Find the object listed in the error and then check the spelling after the dot.
Bad Code 1:
var t = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick);
Good Code 1:
var t = new Timer(1000, 60);
t.addEventListener(TimerEvent.TIMER, Tick);
This should help you resolve Flex / Flash Error #1069
Thanks and as always Happy Flashing
Curtis J. Morley
Related ActionScript Error(s):
Flash / Flex Error 1061 - You will get AS3 Error 1069 instead of 1061 if you don’t properly type your object before referencing a property on it. For example var t:Timer = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick); will give error 1061 but var t = new Timer(1000, 60);
t.addEvent(TimerEvent.TIMER, Tick); will give Error 1069.
Flash / Flex Error 1119
Flash / Flex Error 1056 - This is the error you will get if you try and call a method with a misspelled name in the same way as calling a property with a misspelled name.
ActionScript 3 Warning: 1102: null used where a int value was expected.
ActionScript 3 Warning#1102 Description:
This warning is pretty good at describing what is happening but is needs to add a little to explain why. This error will appear when you try and force a variable to be a certain Type within a predefined function. For example if you have a variable like _minute below
Flex / Flash Warning1102 Fix:
Find where you are using null and make sure that you are using the proper value
Bad Code:
var TargetDate:Date = new Date(_year, _month, _date, _hour, _minute=null);
or
var TargetDate:Date = new Date(_year, _month, _date, _hour, _minute=”10″);
or
var TargetDate:Date = new Date(_year, _month, _date, _hour, _minute=false);
Good Code:
var TargetDate:Date = new Date(_year, _month, _date, _hour, _minute=10);
Warning:
You will not get this error with the code below even though it seems like the same as the code above. The smart folks at Adobe put in logic that will accommodate for numbers-as-strings and also boolean which will result in the number 0. The AS3 Warning will will only show when you assign an non-permitted variable within the parameters of a method call. The code below will output a valid date. Direct assignment in quotes will be translated into a valid Number not an int. False shows up as 0 in the date.
var TargetDate:Date = new Date(_year, _month, _date, false, “10“);
This should help you resolve Flex / Flash Warning #1102
Flash / Flex Error #2078: The name property of a Timeline-placed object cannot be modified.
ActionScript 3 Error #1061 Description:
The MovieClip or Button that you have on the stage cannot be changed with code. It already has a name so you can’t change it. If you are visiting this page my guess is that you are thinking that you have a dynamic movieClip that you named with code, yet you probably have one with the same name on the stage already.
Flash / Flex Error 1061 Fix:
Stop trying to change a named object on the stage that already has one.
Bad Code:
myMovieClip.name = “Bob”;
08.01.08
Adobe proposes AMF support for Zend Framework
AMF will soon be coming to the Zend Framework. Much like AMFPHP, the proposed Zend_Amf component Will wmake communication between Flash and PHP lightening fast.
07.23.08
Flash Actionscript Goodies
Heres a few helpful bits or flash actionscript code to help you on your way with developing dynamic flash content.
Random Number
There are a few ways to generate a random number in flash it all depends on what you need and how your going to do things, heres some examples:
Generate a random number between 0 and 10
variable = Math.random()*10;
Result: variable = 7.967452
Rounding a Random Number
variable = Math.floor(Math.random()*10);
Result: variable = 7
Random Number (Between specific numbers 10-20)
variable = Math.floor(Math.random()*(20-10+1))+10;
Result: variable = 15
Useful Key ASCII/ALT Codes
|
ENTER |
13 |
|
BACKSPACE |
8 |
|
0 |
48 |
|
1 |
49 |
|
2 |
50 |
|
3 |
51 |
|
4 |
52 |
|
5 |
53 |
|
6 |
54 |
|
7 |
55 |
|
8 |
56 |
|
9 |
57 |
07.14.08
12 Websites To Help You Learn Flash/ActionScript
In this article, you’ll find 12 wonderful websites that’s worth a bookmark if you’re looking into sharpening your Flash development skills. For each entry, you’ll find three tutorials from the website so that you can see what’s in store for you.
1. kirupa.com
kirupa.com is a site that features excellent Flash tutorials (as well as Silverlight, ASP.net, PHP, and Photoshop). There are plenty of well-written, detailed tutorials and articles pertaining to Flash sectioned into seven categories including Basic Drawing, Special Effects, Server-side Flash, and Game Development.
Tutorial examples:
2. gotoandlearn.com
Some people learn best by visualization and following along with the instructor step-by-step in real-time. If you’re the type that prefers to learn by watching instructional videos, check out gotoandlearn.com – a website by Lee Brimelow that offers free Flash video tutorials.
Tutorial examples:
3. gotoAndPlay()
gotoAndPlay() is dedicated to providing resources for Flash game developers. It’s a community that has a forum, interviews from professional developers, and reviews of books and resources. It also has tutorials and articles about Flash game development that can be filtered by topic, expertise, and type.
Tutorial examples:
4. Adobe - Flash Developer Center
Adobe’s Flash Developer Center is a community for Flash developers. Here, you’ll find tutorials, articles, and related resources about Flash. You should also check out the ActionScript Technology Center for articles on specifically about ActionScript.
Tutorial examples:
- Using ActionScript to pause and loop the timeline in Flash
- Drawing with the Pen tool
- Creating a 3D button animation for Flash
5. Flash Kit
Flash Kit is one of the biggest and oldest community dedicated to Flash development. With over 600,000 members, you won’t have a hard time finding people with a similar interest in Flash. There’s a forums section, free resources that you can download and use in your Flash projects, and a large tutorials section that includes 18 categories.
Tutorial examples:
- Making movieclips point at the mouse
- Move a sprite with the keyboard
- How to use hitTest in a simple game
6. ActionScript.org
ActionScript.org is a site that provides resources and information pertaining to Flash, Flex, and ActionScript. They have a fairly active Forums section as well as an ActionScript Library that currently has over 700 objects you can download.
Tutorial examples:
7. Flash and Math ActionScript 3 Tutorials
Flash and Math has a great collection of tutorials on AS3. They cover basic to advanced topics so that Flash developers of any level can find something they can read and learn from. Many of the tutorials include the source files for download.
Tutorial examples:
- Drag-and-Drop in Flash CS3
- Tween Tricks in Flash CS3 and ActionScript 3
- Simple 3D Drawing in Flash CS3 and ActionScript 3
8. Flash Tutorials on Pixel2Life
Pixel2Life, according to the site, is the “largest tutorial index catering to graphic designers, webmasters and programmers”. With over 40,000 indexed tutorials, you’ll find many links to tutorials in their Flash Tutorials section.
Indexed tutorial examples:
- Creating a Basic Flash Website (AS3 Version)
- Actionscript 3 Timer Class
- Stars animation above the city
9. Flash Perfection
Flash Perfection is a website with a large collection of Flash tutorials, tips, and tricks from various websites. Flash Perfection has 23 categories to help you find information more quickly.
Indexed tutorial examples:
10. metah.ch
metah.ch has some awesome video tutorials on Flash, ActionScript, Flex, and AIR. Files associated with the tutorials can be downloaded and used in your own projects.
Tutorial examples:
- Introduction to Loop and Event in AS3
- Connecting AS3 with a Database
- Interaction between AS3 and JavaScript
11. LukaMaras.com
LukaMaras.com offers detailed Flash tutorials and resources designed to help you learn Flash. There’s also a small forums section with over 3,000 registered users where you can discuss anything related to Flash.
Tutorial examples:
- ActionScript drop-down menus
- How to make pixel buttons in Flash the easy way.
- How to make an amazing dynamic image gallery in Flash 8
12. Flashmagazine
Flashmagazine is an online magazine dedicated to Flash news, reviews, information, and resources. The Tutorials section has some excellent tutorials for Flash developers.
Tutorial examples:
I hope you found this article useful! Since there’s so many websites out there dedicated to Flash development, I can’t include them all, so if you didn’t see your favorite – please share it with all of us in the comments.
07.08.08
CS3 and Web 2.0 Icon Generator on Adobe AIR
I came across this cool little application built on AIR that lets you generate a CS3 or Web 2.0 style icon. They seem to have gotten the fonts correct so you can pick your color, type in a couple of characters, and have your very own icon. And of course when you save it the application uses the file APIs to write 4 different sizes of the icon for you. Perfect for an application.xml file.
06.27.08
Great Slide Deck on Learning ActionScript 3
Grant Skinner has released an immensely useful slide deck from his Introductory AS3 workshop. There are 165 slides in the deck and they are filled with useful code snippets.
06.26.08
Using AMF with flash.net.URLLoader
lash.net.NetConnection is a native Flash Player class that is the workhorse for AMF based communication. Flash and Flex applications make use of NetConnection to send AMF formatted requests over HTTP or HTTPS to servers such as Flash Remoting, ColdFusion, BlazeDS, etc. However, less HTTP features are exposed by NetConnection than those of flash.net.URLLoader.
To know more about this please visit:
http://blogs.adobe.com/pfarland/2008/06/using_amf_with_flashneturlload.html
06.05.08
Collection of tools and resources for actionscript developers
Very useful AS2 to AS3 migration reference.
AMFPHP
PHP implementation of the Action Message Format. If you need to transfer large data sets between the server and your Flash application remoting enables you to use native Flash data types which cuts down on time and resources needed to parse and transfer data.
AS3 Optimizations
Collection of useful AS3 optimization suggestions and links.
ASUnit
Unit test framework for Actionscript.
Charles
Web debugging proxy which I find indispensable for inspecting traffic between server and swf files.
Has support for remoting (AMF0 and AMF3) and can do bandwidth throttling.
The only resource listed here that is not free, but definitely worth a mention here due to being extremely useful.
You can try the 30 day demo and see if you think it’s worth the asking price compared to for example Fiddler which is a free alternative.
FlashDevelop
My favourite Actionscript editor. IMO the code completion is much better than FlexBuilder and it comes with MTASC and SWFMill to create AS2 swf’s and integrates with MXMLC for AS3 projects so it very easy to get started using it as an all-in-one solution for developing Actionscript applications.
FlashTracer
Simple but very useful Firefox extension that enables you to view trace output in your web browser which is very handy when you need to debug an application while it’s running on the server.
GAIA Framework
I have to admit that I haven’t actually tried it out properly yet since it hasn’t been applicable for the kind of projects I have been working on lately, but I had a quick look at it and it really seems like a very neat framework for certain types of projects.
MinimalComps
A neat little AS3 component set from bit101. As the name suggests it’s very minimal but usually I find full fledged architectures, like ASWing or the ones that comes with CS3, to be a bit overkill in most cases and it’s a great example to study if you like to make your own AS3 components.
They are drawn from code and hence have a tiny footprint but are not skinning friendly.
For AS2 I have mostly been using Bit101’s commercial
BitComponentSet and I would love to see a similar set for AS3 but for now MinimalComps has come in very handy for simple little apps and prototyping.
Popforge
Open source AS3 audio library started by Andre Michelle and Joa Ebert.
If you want to be able to generate or process sound without using Flash Player 10 it will help you do that, but it’s also possible to use the generators and processors with the new samplesCallbackEvent functionality of FP10 as well.
So if you are interested in Flash audio it certainly very worthwhile to check out.
Red5
Open source Flash server for media streaming and remoting. A very good free alternative to Flash Media Server.
SWFAddress
To implement deeplinking and back button functionality when possible on Flash projects have been a concern of mine for quite a while, both due to usability and SEO concerns. Back in 2005 I developed my own solution, but it was something I quickly hacked together and although functioning and better than anything I could find at that time I always thought it could be a lot neater and was hoping someone would step up and create a package that could gain popularity with a lot of developers.
Hence I was very happy when SWFAddress came along with a package that is solid, neat and easy to implement.
SWFObject
I guess there is not much to say here. You’re probably familiar with SWFObject already, but in case you are not just get it and start using it to embed you swf with it now.
Not only is it a very convenient way of adding version detection, providing alternate content and passing on query parameters to the swf but it also has the benefit of avoiding the < a href = “http://www.baekdal.com/articles/technology/microsoft-ie-activex-update/” >IE issues with activation of embedded content.
TortoiseSVN
Easy to use version control software for Windows.
TweenMax
The fastest tweening engine for AS3 with very neat syntax and always my first choice for tweening duties along with it’s smaller siblings TweenLite and TweenFilterLite.
I have come across scenarios where it doesn’t behave as expected (I guess due to the fact that it doesn’t search for overlapping tween properties to overwrite only those properties) and then I stick with Tweener which has very respectable speed and equally neat syntax.










