cod*_*rex 1 apache-flex flash actionscript flex3 actionscript-3
我发现
<rs:Page>
<mx:Image source="@Embed('image1.jpg')" />
<mx:Label x="400" y="40" fontFamily="Verdana" fontSize="9" color="#cccccc" text="butn" />
<mx:Label left="100" right="120" y="90" color="#Ffccdd" textAlign="left" text="Label Text" />
</rs:Page>
Run Code Online (Sandbox Code Playgroud)
在mxml文件中.这意味着什么?
编辑:1
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:filters="flash.filters.*"
xmlns:rs="com.mybooks.book.*"
layout="absolute"
backgroundColor="#333333"
creationComplete="onCreationComplete()"
viewSourceURL="source/index.html" width="600" height="330">
Run Code Online (Sandbox Code Playgroud)
这意味着定义了带前缀的自定义命名空间rs.在mxml文件的开头查找这样的定义:
<?xml version="1.0"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:rs="example.package.name.*"
>
Run Code Online (Sandbox Code Playgroud)
请参阅使用XML命名空间
Page是在rs命名空间中定义的自定义组件.
在简单的ActionScript中,你会写这样的东西:
import com.mybooks.book.Page;
private function createPage(): void
{
var page: Page = new Page();
this.addChild(page);
var image: Image = new Image();
// TODO: set image properties
page.addChild(image);
var labelA: Label = new Label();
// TODO: set labelA properties
page.addChild(labelA);
var labelB: Label = new Label();
// TODO: set labelB properties
page.addChild(labelB);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
173 次 |
| 最近记录: |