白手起家学习使用flex (3) 使用Flash Builder5 完成第一个AIR项目

按照前文 [url]http://sg552.iteye.com/blog/1277793[/url] ,我们安装好了Flash Builder 5, 下面开始第一个项目吧~!~~

( 根据 [url]http://www.adobe.com/devnet/air/articles/getting_started_air_as.html[/url]
Follow these steps to start building your first ActionScript application on Adobe AIR:

Download the Adobe AIR runtime. You need the runtime to launch AIR applications.
Download and install your preferred development environment:
Adobe Flash Builder 4.5 (formerly Flex Builder)
Flex 4.5 SDK
Adobe Flash CS5.5 Professional )
按照官方文档所说,要进行项目,需要:
1. Flash Professional CS5
2. Flash Builder
3. Flex SDK

所以,我们先下载着 Professional CS5 ,同时进行这篇文章的操作。 (这个东东是必须要用下载器下载的,速度很慢。我找不到连接)
如图:
[img]http://dl.iteye.com/upload/attachment/594924/646218d0-012a-3b4f-b1ee-05cb3adc2d17.png[/img]


然后,我们根据这个文档:
[url]http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118676a28bd-8000.html[/url] 使用 Flash Builder建立第一个FLEX/AIR 项目。


过程非常简单:
[list]
[*]Open Flash Builder.
[*]Select File > New > Flex Project.
[*]Enter the project name as AIRHelloWorld.
[*]In Flex, AIR applications are considered an application type. You have two type options:
a web application that runs in Adobe® Flash® Player
a desktop application that runs in Adobe AIR
Select Desktop as the application type.
[*]Click Finish to create the project.
[/list]

建立好项目之后,是这样的:
[img]http://dl.iteye.com/upload/attachment/594927/616f9f9a-1aea-3275-9c0b-f4b14f49c31e.png[/img]

修改第一个文件(flash_test2.mxml),内容是::


<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
title="hihihihihi">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
s|WindowedApplication
{

skinClass:ClassReference("spark.skins.spark.SparkChromeWindowedApplicationSkin");
background-color:#999999;
background-alpha:"0.9";
}
</fx:Style>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Label text="Hello AIR1!!!!!! by siwei" horizontalCenter="10" verticalCenter="30"/>
</s:WindowedApplication>


第二个文件( flash_test2-app.xml)修改2处就好了:

<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
<systemChrome>none</systemChrome>

<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
<transparent>true</transparent>


然后,运行第二个文件( F11 或者 Run -> Debug. )就可以看到效果。 很简单。不截图了。

最后,导出!看看可以发布的AIR到底是啥东东。。。(第一篇日志中,使用命令行模式的 FLEX SDK 4.5 导出,失败。。。)

点击: project -> export release build..., signed AIR package
[img]http://dl.iteye.com/upload/attachment/594953/c434c082-e6d1-3164-98ac-b0c3482d9db2.png[/img]

第一次导出的时候,需要提供一个认证文件(certificates file),没关系,按照说明一点点的创建它就好。

[img]http://dl.iteye.com/upload/attachment/594957/d8399670-82cf-3e27-97c0-627c6c00785d.png[/img]

然后机会发现,项目文件夹下多了一个文件: flash_test2.air
双击它,就会安装。。。。

最后,它生成了2个文件: exe 文件和 swf 文件。前者双击就可以在 windows 下运行~~~
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值