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 init() {
    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.

(Originally posted on my “other blog” at http://blogs.adobe.com/pdehaan/)

 

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Spam Protection by WP-SpamFree