box-o-sand/PracticingFlex/03c7-mxml-vs-as3/WithAs3.mxml

34 lines
956 B
Plaintext
Raw Normal View History

2010-02-19 01:54:12 +00:00
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundColor="#FFFFFF"
backgroundAlpha="0"
initialize="addControls()">
<mx:Script>
<![CDATA[
import mx.controls.Image;
import mx.controls.Label;
private function addControls():void {
createImage();
createPhotographer();
}
private function createImage():void {
var photo:Image = new Image();
photo.source = "assets/animals03.jpg";
boxetyBox.addChild(photo);
2010-02-19 01:54:12 +00:00
}
private function createPhotographer():void {
var photographer:Label = new Label();
photographer.text = "Photographed by Elsie Weil";
boxetyBox.addChild(photographer);
2010-02-19 01:54:12 +00:00
}
]]>
</mx:Script>
<mx:Box id="boxetyBox"/>
2010-02-19 01:54:12 +00:00
</mx:Application>