Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1261317
  • 博文数量: 315
  • 博客积分: 10397
  • 博客等级: 上将
  • 技术积分: 3731
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 21:21
文章分类

全部博文(315)

文章存档

2015年(10)

2014年(3)

2013年(2)

2012年(8)

2011年(8)

2010年(29)

2009年(59)

2008年(77)

2007年(119)

分类:

2008-04-02 13:54:22

转自:

嵌入图像(多个实例)

xmlns:mx=””
layout=”horizontal” width=”350″ height=”250″>


[Embed(source=”assets/logo.png”)]
[Bindable]

public var Logo:Class;

]]>

嵌入一个图像(单个实例)

xmlns:mx=””
width=”200″ height=”240″>

嵌入使用 scale-9 缩放的图像


xmlns:mx=””
layout=”vertical” width=”400″ height=”480″>


[Embed(
source=”assets/fancy_border.png”,
scaleGridTop=”55″, scaleGridBottom=”137″,
scaleGridLeft=”57″, scaleGridRight=”266″

)]

[Bindable]
public var FancyBorderImage:Class;
]]>


使用 CSS 为皮肤嵌入图像


xmlns:mx=””
layout=”horizontal” width=”270″ height=”100″
horizontalAlign=”center” verticalAlign=”middle” >


Button
{
upSkin: Embed(”assets/box_closed.png”);

overSkin: Embed(”assets/box.png”);
downSkin: Embed(”assets/box_new.png”);

}

嵌入 SWF 文件


xmlns:mx=””
layout=”horizontal” width=”290″ height=”290″
horizontalAlign=”center” verticalAlign=”middle”>


[Embed(source=”assets/hourglass.swf”)]

[Bindable]
public var Hourglass:Class;
]]>


嵌入 SWF 库资源


xmlns:mx=””
viewSourceURL=”src/EmbeddingSwfLibraryAssets/index.html”
layout=”horizontal” width=”450″ height=”240″
horizontalAlign=”center” verticalAlign=”bottom”     >


[Embed(source=”assets/library.swf”, symbol=”BadApple”)]

[Bindable]
public var BadApple:Class;
[Embed(source=”assets/library.swf”, symbol=”Pumpkin”)]

[Bindable]
public var Pumpkin:Class;

]]>

height=”151.8″/>

嵌入声音文件


layout=”vertical” horizontalAlign=”center” verticalAlign=”center” >


import mx.core.SoundAsset;
import flash.media.*;

[Embed(source=”assets/pie-yan-knee.mp3″)]

[Bindable]
public var Song:Class;

public var mySong:SoundAsset = new Song() as SoundAsset;
public var channel:SoundChannel;

public function playSound():void
{

// Make sure we don’t get multiple songs playing at the same
time
stopSound();

// Play the song on the channel
channel = mySong.play();
}

public function stopSound():void
{

// Stop the channel, but only if it exists
if ( channel != null ) channel.stop();
}

]]>




嵌入字体


xmlns:mx=””
layout=”horizontal”
horizontalAlign=”center”
verticalAlign=”center”   >


@font-face
{
font-family: Copacetix;

src: url(”assets/copacetix.ttf”);
unicode-range:
U+0020-U+0040, /* Punctuation, Numbers */

U+0041-U+005A, /* Upper-Case A-Z */
U+005B-U+0060, /* Punctuation and Symbols */
U+0061-U+007A, /* Lower-Case a-z */
U+007B-U+007E; /* Punctuation and Symbols */

}
.MyTextStyle
{
font-family: Copacetix;
font-size: 24pt;
}

width=”100%”/>

阅读(880) | 评论(0) | 转发(0) |
0

上一篇:AMF 简介

下一篇:Flex中处理事件

给主人留下些什么吧!~~