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

ActionScript Error 1083: Syntax error: doubledot is unexpected.

ActionScript Error 1083: Syntax error: doubledot is unexpected.

var intLat:Number = ((Math.random()*1)*..00060

ActionScript 3 Error #1083 Description:
AS3 error 1083 says that you have too many dots.  Look carefully at the line of code and you will most likely see that your speedy typing fingers hit the period one too many times.  This can happen while targeting an object or when you are using decimals.  Doubledot is valid in AS3 but only in the context of E4X.  You use doubledot otherwise known as the descendent accessor (..) operator to access child properties of an XML object.

Flex / Flash Error 1083 Fix:
Remove the extra dot.

Bad Code 1:

var intLat:Number = myNumber * ..0006;

Good Code 1:

var intLat:Number = myNumber * .0006;

Bad Code 2:

this..myObj.x = 100;

Good Code 2:

this.myObj.x = 100;

This should help you resolve Flex / Flash Error #1083

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

Flash 10 Tutorial on Saving Files from Flash

Save Files from Flash

Lee Brimelow has put up a great video tutorial on how to save files to the local system.

Save Files directly from Flash 10

http://www.gotoandlearn.com/player.php?id=76

This is a great day to have the save functionality back in Flash.  I have many uses for this.

Happy Flashing,

Curtis J. Morley

Full Flash 10 Documentation

Flash 10 documentation has been posted and linked to by Ryan Stewart and Trevor McCauley(senocular).

This is some great bedtime reading you can find out about all the great 3D support in Flash 10, dynamic sound generation, Drawing API in Flash 10, and the very exciting Local File Acces in Flash 10, etc…

I haven’t gotten to the part about bones and kinematics yet. But I will let you know when I do.

Currently it is a zip file with all the docs.

Get the Flash 10 documentation here.

Happy Flashing

Curtis J. Morley

Programming Flash 10 Dynamic Sound

Tinic Uro, the Hero to all Flash developers for putting in the sound enhancements for Flash 10 Player, has put up three fantastic posts on how to actually use the new Sound methods.

Tinics Uro’s Article on Sound In Flash 10 – part 1 (Talks about how Vista messed up the SOUND_COMPLETE event)
Sound in Flash 10 – part 2 (Gives a great explanation of how to create sound and even gives code)
Sound in Flash 10 – part 3 (Explains and displays code on how to pull data from a sound object already in Flash)

Happy Flashing Tinic and everyone,

Curtis J. Morley

Flash 10 Drawing API tutorials

Flash 10 Drawing Tutorials

In the spirit of keeping everyone on the bleeding edge, Trevor McCauley at Senocular has provided an amazingly detailed description of using the drawing API’s with for Flash 10.  This is a must read.

http://www.senocular.com/flash/tutorials/flash10drawingapi/

I will keep you up to date on all of the great tutorials I find on using Flash 10.

Thanks and Happy Flashing

Curtis J. Morley