MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Bedienungsanleitung Seite 34

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 124
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 33
TUTORIALS POINT
Simply Easy Learning Page 29
1
Create a project with a name HelloWorld under a package com.tutorialspoint.client as explained in
the Flex - Create Application chapter.
2
Modify HelloWorld.mxml as explained below. Keep rest of the files unchanged.
3
Compile and run the application to make sure business logic is working as per the requirements.
Following is the content of the modified mxml file src/com.tutorialspoint/HelloWorld.mxml.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%" height="100%" minWidth="500" minHeight="500"
initialize="reportEvent(event)"
preinitialize="reportEvent(event)"
creationComplete="reportEvent(event)"
applicationComplete="reportEvent(event)">
<fx:Style source="/com/tutorialspoint/client/Style.css"/>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
[Bindable]
private var report:String = "";
private function reportEvent(event:FlexEvent):void{
report += "\n" + (event.type + " event occured at: "
+ getTimer() + " ms" + "\n");
}
]]>
</fx:Script>
<s:BorderContainer width="500" height="500" id="mainContainer"
styleName="container">
<s:VGroup width="100%" height="100%" gap="50"
horizontalAlign="center" verticalAlign="middle">
<s:Label textAlign="center" width="100%" id="lblHeader"
fontSize="40" color="0x777777" styleName="heading"
text="Life Cycle Events Demonstration"/>
<s:TextArea id="reportText" text="{report}" editable="false"
width="300" height="200">
</s:TextArea>
</s:VGroup>
</s:BorderContainer>
</s:Application>
Once you are ready with all the changes done, let us compile and run the application in normal mode as we did
in Flex - Create Application chapter. If everything is fine with your application, this will produce following result:
[ Try it online ]
Seitenansicht 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 ... 123 124

Kommentare zu diesen Handbüchern

Keine Kommentare