2 Articles that everyone visiting my site needs to read.

Collin Moock has published two articles through O’reilly InsideRIA that are fantastic. These articles are for anyone that has wanted to throw his/her hands in the air and say, “To Heck with AS3 and Classes and New Work-Flow and Packages and Display Objects and Event Models and OOP and learning Flash over again, and (well you get the picture)

These two articles will change your paradigm of Flash CS3 and AS3 being to hard. It will really help you in the long term never visit my site for AS3 Error resolution because you won’t be getting them any more. I will miss you but the purpose of my site is to help the Flashers (that includes Flex-ers) of the world develop better Flash. These two articles will most certainly help you do that. They will help you as a Flasher and will change the way you think of Flash and ActionScript 3. The mental barriers will be torn down after reading what the great Moock has to say.

Collin really brings to light the fact that AS3 is the same or even less verbose than AS2 or AS1 in many cases. I must admit that I had this same gripe but after reading this article I stepped back and took a good look at how a little more verbose up front can be a lot less verbose in the long run.

The first article (ActionScript 3.0: Is It Hard or Not) addresses and dispels the following concerns:

  1. It’s too complicated
  2. It’s hard to learn
  3. It takes a lot more code to do things
  4. Lastly shares how to believe

The second article (The Charges Against ActionScript 3.0) addresses these specific issues:

  1. The removal of on()/onClipEvent() from Flash CS3 makes creating simple interactivity hard.
  2. Getting rid of loaded .swf files is hard.
  3. Casting DisplayObject.parent makes controlling parent movie clips hard.
  4. The removal of getURL() makes linking hard.
  5. The removal of loadMovie() makes loading .swf files and images hard.
  6. ActionScript 3.0’s additional errors make coding cumbersome.
  7. Referring to library symbols dynamically is unintuitive.
  8. Adding custom functionality to manually created text fields, to all movie clips, or to all buttons is cumbersome.
  9. The removal of duplicateMovieClip() makes cloning a MovieClip instance (really) hard.

READ THESE ARTICLES BY COLLIN MOOCK (I know I used caps but this is important. It will help you dramatically)

ActionScript 3.0: Is It Hard or Not?

The Charges Against ActionScript 3.0

Thanks and Happy Flashing

ActionScript 3 Error #1061

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

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.

AS3 Warning: 1102: null used where a int value was expected.

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“);

Related AS3 Error:
AS3 Error 1067

This should help you resolve Flex / Flash Warning #1102

Thanks and as always Happy Flashing

Curtis J. Morley

New Info added to AS3 Error 1067

Check out the new info I posted on AS3 Error #1067

It is highly related to AS3 Warning 1102

Thanks,

Curtis J. Morley

ActionScript 3 Error #2078

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”;

Good Code:

//no code here

Thanks and Happy Flashing

Curtis J. Morley

50 Megapixel

So I have been contemplating upgrading from my Nikon D200 to the D300 for a long time.

Nikon D300

Each time I have the extra money saved it seems that there is something more important to spend my money on. So the other day I was thinking about it again until I heard about the new behemoth that Kodak has just announced.

50 Megapixel!!!!

Kodak 50 Megapixel

The newest monster megapixel camera from hasselbladYes that’s right. it is not a typo. It is truly 50 megapixel. That is 5x the resolution of my D200 and oh yeah and 16x times the cost. The d300 is only $1850 but the new medium format camera that will be produced by Hasselblad will be in the range of $30,000.

Hey if I am going to splurge I think that I might go for the –

1Gigapixel Camera

Gigapixel Camera

This camera was conceived and then created to take a photo that has a resolution of over 1 gigapixel. They are actually hoping to breach the 4 gigapixel range soon. The negatives are 9″×18″ format (which is the the same size as military spy planes), which equates to a print with dimensions of 10 feet by 20 feet. To put this in perspective a 3 megapixel camera will print a nice 4″x6″ picture at it’s full resolution. The camera was created from bits and pieces salvaged from parts of spy planes and nuclear reactors. If the camera were a boxer it would definitley weigh in the heavy weight division. It is a whopping 99 pounds. If you look closley at the warning sticker on the back it says, “Don’t wear camera around your neck.” The rolls of film produced by Kodak cost more than my D200 is now worth at a pricey $1,200 a pop. I haven’t found the actual price of the camera itself but I hear it is somewhere around the $250,000 range and there is only one of it’s kind. Digital will not be catching up to this phenom any time soon since the data transfer rate you would need to capture these images would be 38 terabits per second. Does sandisk make a 38 Terabyte CF card yet?

So maybe I will buy the D300 after all. I would love to put $250k down on a camera right now but we are finishing our basement and the toilet is an important part of the bathroom that we couldn’t afford if I got the camera.

Gigapixel Image Gallery

AS3 Error 1188: Illegal assignment to class Boolean.

ActionScript Error #1188: Illegal assignment to class Boolean.

ActionScript Error #1188: Illegal assignment to class Number.

ActionScript Error #1188: Illegal assignment to class int.

ActionScript Error #1188: Illegal assignment to class uint.

ActionScript Error #1188: Illegal assignment to class String.

ActionScript Error #1188: Illegal assignment to class Array.

ActionScript Error #1188: Illegal assignment to class Object.

ActionScript 3 Error #1188 Description:

AS3 error 1188 is thrown when the keyword “var” is omitted. Adobe doesn’t offer any documentation on this ActionScript Error and the description itself is no help at all. This error will be thrown whenever the “var” keyword is missing on all variable assignments including a custom Class/Data Type. I have never experienced this error without also getting AS3 Error 1067 first.

Flex / Flash Error 1188 Fix:
Don’t forget the var when you define a new variable.

Bad Code:

import com.errors.CustomObj
myCustomObj:CustomObj = new CustomObj();
myObj:Object = new Object();
myBool:Boolean = false;
myint:int = -1;
myString:String = “Happy Flashing”;
myArray:Array = new Array();

Good Code:

import com.errors.CustomObj
var myCustomObj:CustomObj = new CustomObj();
var myObj:Object = new Object();
var myBool:Boolean = false;
var myint:int = -1;
var myString:String = “Happy Flashing”;
var myArray:Array = new Array();

Related Errors:

ActionScript Error 1067

This should help you resolve Flex / Flash Error #1188
Thanks and as always Happy Flashing

Curtis J. Morley

ActionScript RangeError: Error #1003: The radix argument must be between 2 and 36; got 0.

ActionScript RangeError: Error #1003: The radix argument must be between 2 and 36; got 0.

ActionScript 3 Error #1003 Description:
AS3 error 1003 is describing the fact that the radix parameter is outside of the bounds between 2 and 36. What is a radix you might ask. A radix “specifies the numeric base (from 2 to 36) to use for the number-to-string conversion. If you do not specify the radix parameter, the default value is 10″ Still curious as to what the radix is? Think back to your high school trigonometry class. The radix is the base for the number. In normal scripting/math you use the decimal system. In the decimal system the radix is 10, because it uses the 10 digits from 0 through 9. Binary uses only two number, 0 & 1 therefore it has a base or 2 or radix 2. Octal uses base 8 or radix of 8 and Hexadecimal uses the 16 characters 0-9 and A-f therefore it has a radix of 16. This comes in very handy when you need to convert a number to Hex if you want to generate dynamic colors etc…

Flex / Flash Error 1003 Fix:
So for all that explaining the simply fix for AS3 RangeError 1003 is most likely to just remove whatever value you have in the parenthesis of your toString() or change the value to 10.

Bad Code:

lat_txt.text = “+00 0″+currentLat.toString(this);

or

lat_txt.text = “+00 0″+currentLat.toString(1);

Good Code:

lat_txt.text = “+00 0″+currentLat.toString();

or

lat_txt.text = “+00 0″+currentLat.toString(10);

This should help you resolve Flex / Flash Error #1003

Thanks and as always Happy Flashing

Curtis J. Morley