by Peter deHaan

 Comments (3)

Created

February 4, 2008

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.

COMMENTS

  • By Jon MacDonald - 4:13 PM on February 4, 2008   Reply

    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.

  • By Doug Gray - 1:58 PM on February 9, 2008   Reply

    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

  • By peterd - 11:00 AM on February 12, 2008   Reply

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

ADD A COMMENT