Toggling specific compiler warnings in Flash CS3

The following question came up today, so I thought I’d post the answer here in case it helps a few other people out there.

In Flex, the following code generates a couple warnings:

<mx:Script>
<![CDATA[
private var i;

private function init() {
return true;
}
]]>
</mx:Script>

1008: variable ‘i’ has no type declaration.
1008: return value for function ‘init’ has no type declaration.

However, if you do the same thing in Flash CS3, you don’t get the same warnings:

var i;

function peter() {
return true;
}

If you want to see the same warnings in Flash, you can edit the EnabledWarnings.xml file in your /Configuration/ActionScript 3.0/ directory:

PC: C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\ActionScript 3.0\
Mac: /Applications/Adobe Flash CS3/Configuration/ActionScript 3.0/

Simply change the enabled attribute from false to true for the desired warnings (in this case, the warning id == 1008).

Hope that helps, and a big thanks to Nivesh for the explanation.

3 Responses to Toggling specific compiler warnings in Flash CS3

  1. Thanks, Peter. Was this done in an attempt to make Flash CS3 (and thus AS3) more timeline coding friendly for those adapting from AS2? I ask because I’d argue that it might be doing the opposite.

  2. Doug Gray says:

    Hi Peter,Can you please tell me if it is impossible to embed fonts into a DataGrid HeaderRenderer (in Flash CS3 as AS3)?I can’t suss it and it’s driving me mad…Should i create a custom HeaderRenderer as a work around?If so have you got any tutorials i could see?CheersDoug

  3. peterd says:

    Doug,Yeah, it was a bit tricky, but check out “Using embedded fonts with the Flash CS3 DataGrid component”.Hope that helps,Peter