adding examples for mxml vs as3
This commit is contained in:
parent
1d6cb95022
commit
a28d77bfd7
32
03c7-mxml-vs-as3/WithAs3.mxml
Normal file
32
03c7-mxml-vs-as3/WithAs3.mxml
Normal file
@ -0,0 +1,32 @@
|
||||
<?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";
|
||||
this.addChild(photo);
|
||||
}
|
||||
|
||||
private function createPhotographer():void {
|
||||
var photographer:Label = new Label();
|
||||
photographer.text = "Photographed by Elsie Weil";
|
||||
this.addChild(photographer);
|
||||
}
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
|
||||
</mx:Application>
|
10
03c7-mxml-vs-as3/WithMxml.mxml
Normal file
10
03c7-mxml-vs-as3/WithMxml.mxml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
backgroundColor="#FFFFFF"
|
||||
backgroundAlpha="0">
|
||||
|
||||
<mx:Image source="assets/animals03.jpg" />
|
||||
|
||||
<mx:Label text="Photographed by Elsie Weil" />
|
||||
|
||||
</mx:Application>
|
1
03c7-mxml-vs-as3/assets
Symbolic link
1
03c7-mxml-vs-as3/assets
Symbolic link
@ -0,0 +1 @@
|
||||
../_assets
|
Loading…
Reference in New Issue
Block a user