05.28.08
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
Viki said,
June 29, 2008 at 2:28 am
plusSym:Boolean = true;
subSym:Boolean = false;
multSym:Boolean = false;
divSym:Boolean = false;
I’m new to flash and I’ve been trying to make a simple calculator using the Youtube tutorial: http://au.youtube.com/watch?v=5k3h37YKZJI
I’ve been getting errors for these lines and I don’t know whats wrong with them, the tutorial and I have the exact same codes.
Curtis J. Morley said,
June 30, 2008 at 6:45 am
Viki,
Thanks for the comment. This one is an easy one. I haven’t watched the tutorial but am pretty sure that it is written for AS2. AS3 Error 1067 shows up in your case because you are missing the keyword var in front of each variable assignment. This was allowed in AS2 but in AS3 all variable assignments require the keyword var like so:
var plusSym:Boolean = true;
var subSym:Boolean = false;
var multSym:Boolean = false;
var divSym:Boolean = false;
Make sure to check out Flex / Flash Error 1188 as well.
Happy Flashing Viki
curtismorley.com » AS3 Error 1188: Illegal assignment to class Boolean. said,
June 30, 2008 at 11:09 am
[...] the description is is no help at all. I have never experienced this error without also getting AS3 Error 1067 first. This error will be thrown whenever the “var” keyword is missing on all variable [...]
curtismorley.com » AS3 Warning: 1102: null used where a int value was expected. said,
July 15, 2008 at 11:24 am
[...] Related AS3 Error: AS3 Error 1067 [...]
curtismorley.com » New Info added to AS3 Error 1067 said,
July 15, 2008 at 11:32 am
[...] Check out the new info I posted on AS3 Error #1067 [...]
Flash/ Flex Error « RIAdobe said,
August 10, 2008 at 8:03 pm
[...] Related AS3 Error: AS3 Error 1067 [...]
curtismorley.com » AS3 Error #1051: Return value must be undefined. said,
August 20, 2008 at 12:41 pm
[...] Flash Error 1067 (If you specified a return type of int, uint, Number, Array, Bitmap, etc…)Flash Warning 3590 (If you specified a return type of Boolean)Flash Error 1046 (If you specified a return type of Button) [...]
curtismorley.com » Another New Example in AS3 Error 1067 said,
August 20, 2008 at 1:32 pm
[...] have posted a new example under the ActionScript 3 Error 1067. This example addresses fixing an errant Return [...]