MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Guia do Utilizador Página 86

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 256
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 85
86 Using MXML
Writing a simple application
Because MXML files are ordinary XML files, you have a wide choice of development
environments. You can write MXML code in a simple text editor, a dedicated XML editor, or
an integrated development environment (IDE) that supports text editing. Adobe supplies a
dedicated IDE called Flex Builder that you can use to develop your applications.
The following example shows a simple “Hello World” application that contains just an
<mx:Application> tag and two child tags, the <mx:Panel> tag and the <mx:Label> tag. The
<mx:Application> tag is always the root tag of a Flex application. The <mx:Panel> tag
defines a Panel container that includes a title bar, a title, a status message, a border, and a
content area for its children. The
<mx:Label> tag represents a Label control, a very simple
user interface component that displays text.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Panel title="My Application" paddingTop="10" paddingBottom="10"
paddingLeft="10" paddingRight="10" >
<mx:Label text="Hello World!" fontWeight="bold" fontSize="24" />
</mx:Panel>
</mx:Application>
Save this code to a file named hello.mxml. MXML filenames must end in a lowercase .mxml
file extension. You can then compile and run the resultant SWF file.
The following figure shows the “Hello World” application rendered in a web browser
window:
Vista de página 85
1 2 ... 81 82 83 84 85 86 87 88 89 90 91 ... 255 256

Comentários a estes Manuais

Sem comentários