AS3 Error 1195: Attempted access of inaccessible method cacheAsBitmap through a reference with static type flash.display:DisplayObject.

AS3 Error 1195: Attempted access of inaccessible method cacheAsBitmap through a reference with static type flash.display:DisplayObject.

Description:
Error 1195 can have any number of methods listed in this AS3 Error so I probably should have listed it as Attempted access of inaccessible method someMethod through a reference with static type variableType. This is caused because you are either calling a private method from another class, or calling a method defined in a namespace that is not in use.

Solution:
If you are calling a method defined in an unused namespace, add a use statement for the required namespace. Otherwise, check that the method is within scope and accessible.

Thanks and 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

ActionScript Error 1136: Incorrect number of arguments. Expected 1.

1136: Incorrect number of arguments.  Expected 1.

ActionScript 3 Error #1136 Description:
This is a generic yet simple ActionScript Error.  It just means that you need one and only one argument in the method you are calling.  This error will pop up in many cases but I will only provide one code example. It should help you get through this fairly easily.

Flex / Flash Error 1136 Fix:
Add the applicable argument/parameter into the parenthesis.

Bad Code:

newempty1.removeChild();

Good Code:

newempty1.removeChild(pic1);

This should help you resolve Flex / Flash Error #1136

Thanks and as always Happy Flashing

Curtis J. Morley

Search Engine Optimization Example

The other day I consulted for the largest Agency in the state about Flash and SEO. Specifically how to get Flash on the top of the Google Ranking. As part of the presentation I described the 2 types of results that you want to score high on. The first is “Most Popular” searches and the second is the long tail results. Through this I gathered some data about the CurtisMorley.com site and thought it would make an interesting post showing what results this site has been able to produce. It also gives quick reference to some of the errors.

 

 

*Disclaimer Google Search results change daily this information is accurate as of the day of this posting.

 

Most Common Google Search Terms for Flex /Flash Errors

 

Long Tail Search Terms for Flex/Flash Errors

 

ActionScript Error #1067 – Implicit coercion of a value of type void to an unrelated type Function.

ActionScript Error #1067: Implicit coercion of a value of type void to an unrelated type Function.

ActionScript 3 Error #1067 Description:
AS3 error 1137 is describing the fact that you have entered a parameter that is not supposed to be inside the parenthesis.

Flex / Flash Error 1067 Fix:
Remove all parameters from within the parenthesis.

Bad Code 1:

alone_btn.addEventListener(MouseEvent.MOUSE_UP, trace(“The message”));

Good Code 1:

alone_btn.addEventListener(MouseEvent.MOUSE_UP, traceMe);
function traceMe (e:MouseEvent)
{
trace(“The message”);
}

AS3 Error # 1067: Implicit coercion of a value of type String to an unrelated type int.

ActionScript 3 Error #1067: Implicit coercion of a value of type Boolean to an unrelated type int.

Bad Code 2:

var TargetDate:Date = new Date(_year, _month, _date, _hour, _minute=false);

or

var TargetDate:Date = new Date(_year, _month, _date, _hour, _minute=String);

Good Code 2:

var TargetDate:Date = new Date(_year, _month, _date, _hour, _minute=10);

AS3 Error 1067 Fix #2 – In the example below you will see that the function “Return Type” is listed as “int” when it needs to be listed as String.  To fix this simply change the Return Type to String or return a valid integer.

Bad Code:

function bob():int
{
return “message”;
}

Good Code:

function bob():String
{
return “message”;
}

Related Error(s):
Flash / Flex Error 1188
AS3 Warning 1102

This should help you resolve Flex / Flash Error #1067

Thanks and as always Happy Flashing

Curtis J. Morley

Flex / Flash Error 1137

ActionScript Error #1137: Incorrect number of arguments. Expected no more than 0.

ActionScript 3 Error #1137 Description:
AS3 error 1137 is describing the fact that you have entered a parameter that is not supposed to be inside the parenthesis.

Flash Error 1137 Fix:
Remove all parameters from within the parenthesis.

Bad Code:

var fileToLoad:URLRequest = new URLRequest(“cleanhandsworkahsc.swf”)
var myLoader:Loader = new Loader(fileToLoad);
this.addChild(myLoader);

Good Code:

var fileToLoad:URLRequest = new URLRequest(“cleanhandsworkahsc.swf”)
var myLoader:Loader = new Loader();
myLoader.load(fileToLoad);
this.addChild(myLoader);

This should help you resolve Flex / Flash Error #1137

Thanks and as always Happy Flashing

Curtis J. Morley

ActionScript Error #1024

ActionScript Error #1024: Overriding a function that is not marked for override.

Description:
AS3 error 1024 means that Flash or Flex already has a function by that name.

Fix:
To solve Flex/Flash Error 1024 all you need to do is either correctly name the function something besides a reserved function in Flex/Flash or properly override the function. The example below shows how to solve issue number one. Notice that the good code solves Error 1024 because it doesn’t use the same name as a function that already exists in ActionScript.

Bad Code 1:

function nextFrame (e:MouseEvent):void
{
this.nextFrame();
}

Good Code 1:

function onNextFrame (e:MouseEvent):void
{
this.nextFrame();
}

This should help you resolve Flash / Flex Error #1024

Thanks and as always Happy Flashing

Curtis J. Morley

AS3 Error 1120

ActionScript 3 Error #1120: Access of undefined property myButton_btn.

Description:
ActionScript error #1120 means that an object “property” within Flash or Flex is not defined. But this doesn’t really help you fix it. One main reason for this AS3 Error is that you haven’t given the MovieClip or Button an instance name when you placed it on the stage in Flash. Another reason is that the reference is not correct.

AS3 Error 1120 –Fix1:
Give your instances a proper instance name.

Bad Example:

Flash properties dialog without an instance name Flash properties dialog without an instance name

Good Example:

Flash Properties Dialog with Instance Name Flash properties dialog with MovieClip instance name

ActionScript 3 Error #1120: Access of undefined property myBatton_btn.

AS3 Error 1120 –Fix2:
Check that your reference is the proper instance name.

Bad Code:

myBatton_btn.addEventListener(MouseEvent.CLICK, someFunction);

Good Code:

myButton_btn.addEventListener(MouseEvent.CLICK, someFunction);

 

ActionScript 3 Error #1120: Access of undefined property ftouchBeginHandler.

AS3 Error 1120 – Fix3:
Make sure that you are calling the function with the correct name.

Bad Code:

square.addEventListener(TouchEvent.TOUCH_BEGIN, touchBeginHandler);
function fl_TouchBeginHandler(event:TouchEvent):void
{
//Drag something
}

Good Code:

square.addEventListener(TouchEvent.TOUCH_BEGIN, touchBeginHandler);
function touchBeginHandler(event:TouchEvent):void
{
//Drag something
}

 

This should help you fix Flash AS3 Error #1120.

As Always, Happy Flashing

Curtis J Morley

Flex / Flash ActionScript Error #1065

ActionScript Error #1065: Variable MyClassName is not defined.

Description:
This ActionScript error means that Flash or Flex does not understand the definition of your Class. One reason for this is that you forgot to declare your class as public. Another reason is that the reference is not correct. Don’t be deceived by the word Variable in this error it is really a class.

Fix:
Add public before the name of your class.

Bad Code:

class MyClassName extends MovieClip

Good Code:

public class MyClassName extends MovieClip

Fix 2:

Correctly reference the class that is being used.

Good luck trouble shooting ActionScript Error #1065 and,
As always Happy Flashing

Flex 2 / Flash CS3 ActionScript Error #1105

ActionScript Error #1105: Target of assignment must be a reference value.

Description:
This ActionScript error simply means that you are trying to assign a value to something that is already a value and not a variable or a writable property. Adobe Live Docs actually has a pretty good definition about this one. It says, ” You can assign a value to a variable, but you cannot assign a value to another value.” To make this simple let me use an example. An array has a property length. An XMLList also has a property called length() . Pay attention to the parenthesis. An array will let you change the length of the array simply by calling my_array.length = 2; because it is a readable and writable property. When using XML however the length property is only readable so my_xml.length() = 0; is like saying 2 = 0; You can not change the value 2.

Fix:
When you get this ActionScript error make sure to check that you are not trying to change a value. Also make sure that the property is readable and writable.

Bad Code:

my_xml.children().length() = 0;

Good Code:

package{
	public class MySize {
		private var size:uint = 40;
		protected function Connection():void{
			trace(size);
		}
	}
}

Good luck trouble shooting ActionScript Error #1105 and,
As always Happy Flashing