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