
Step 1: Find and replace 11
This section describes only the most common targets of finding and replacing. There are
many other members of Flex classes that have changed that are not mentioned here. For a
complete list, see Chapter 3, “Flex Classes,” on page 41.
Application namespace
Change the MXML namespace. Change the following:
xmlns:mx="http://www.macromedia.com/2003/mxml"
to this:
xmlns:mx="http://www.adobe.com/2006/mxml"
For example:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
Void
Replace Void (with a capital V) with void (with a lower-case v).
Newline
The newline constant has been removed. In ActionScript, use “\n” to add a carriage return in
your Strings. In an MXML tag, use the
XML character entity to add a carriage return.
Color value formats
Replace all occurrences of 0x with # in CSS style sheets or <mx:Style> tag blocks. The
supported color value formats have changed; for example:
.b1 { color: red; } // Valid
.b2 { color: #FF0000; } // Valid
.b3 { color: 0xFF0000; } // Invalid
In calls to the setStyle() method, you can prefix RRGGBB color values with 0x or #, but
you must put quotation marks around constants and # values; for example:
b1.setStyle("color",0xFF0000); // Valid
b2.setStyle("color","red"); // Valid
b3.setStyle("color","#FF0000"); // Valid
b4.setStyle("color",red); // Invalid
b5.setStyle("color",#FF0000); // Invalid
For more information on changes to the supported color value formats, see “Using colors”
on page 121.
Commentaires sur ces manuels