1. General applications (access to namespaces)
Use namespace mx_internal;
VaR textarea: textarea = textarea ();
Textarae.html text = "<B> test </B> ";
VaR ITF: iuitextfield = textarae. gettextfield ();
2. Same Function signature for different namespaces
Package
{
Import flash. display. Sprite;
Public class namespaceexample extends Sprite
{
Public namespace French;
Public namespace Hawaiian;
Public Function namespaceexample (){
Trace (Hawaiian: Hello (); // Aloha
Trace (French: Hello (); // Bonjour
}
Hawaiian function Hello (): String {
Return "aloha ";
}
French function Hello (): String {
Return "bonjour ";
}
}
}
3. Function rewriting in The namespace
Package
{
Public class ns2-extends namespaceexample
{
Use namespace French;
Public Function NS2 ()
{
French: Hello ();
}
French override function Hello (): String {
Return "bonjour ";
}
}
}
4. namespace is not allowed for the interface
Package
{
Public interface I1
{
Public namespace French;
French function Hello ();
}
}
Severity and description path resource location creation time ID
1166: namespace declarations cannot be used in interfaces. Test i1.as line 5 1217302934515 13427
5. namespace used in XML Processing
An example provided by Adobe
var soap: namespace = new namespace ("http://schemas.xmlsoap.org/wsdl/soap/"); var W: namespace = new namespace ("http://weather.example.org/forecast"); var myxml: xml =
Quito
Ecuador
2006-01-14
; trace (myxml. soap: body. w: forecast. w: City); // Quito