<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http:
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";
this.addChild(photo);
}
private function createPhotographer():void {
var photographer:Label = new Label();
photographer.text = "Photography";
this.addChild(photographer);
}
]]>
</mx:Script>
</mx:Application>
Rendered Samples
Both applications render the same even though one adds components using MXML and the other using ActionScript 3.0 code.
MXML
ActionScript 3.0
No comments:
Post a Comment