1、打开eclipse,新建一个FlashBuilder项目如下图:
2、操作如下图
上面的“Main application file”中的值应用helloworld.mxml,此处的名称新建项目时,默认与项目名称一致。
3、项目创建完成后,项目目录结构如下图:
4、打开helloworld.mxml文件
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:Application>
5、输入以下代码:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
initialize="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
//导入包
import mx.controls.Alert;
//创建方法,当所有子组件生成完成后触发,在这个时间点还没有组件被渲染出来.
protected function init():void
{
Alert.show("Hello World");//相当于javascript中的alert("hello world");
}
]]>
</fx:Script>
</s:Application>
如下图:
运行项目:
8、得到如下效果:
相关推荐
flex-messaging-core jar包
1 3 跟我StepByStep学FLEX教程------Hello World(原创) 1 4 跟我StepByStep学FLEX教程------可视化页面组件(原创) 1 5 跟我StepByStep学FLEX教程------ActionScript3(原创) 1 6 跟我StepByStep学FLEX教程--...
flex-messaging-4.7.3最新版本的jar
flex-messaging-proxy.jarflex-messaging-proxy.jarflex-messaging-proxy.jarflex-messaging-proxy.jar
flex-messaging-common
flex-iframe-1.4.6.rar (code google)
flex-messaging-core-amf1.7
flex-messaging-remoting.jarflex-messaging-remoting.jarflex-messaging-remoting.jarflex-messaging-remoting.jar
flex-messaging-core.jar
flex-messaging-common.jarflex-messaging-common.jarflex-messaging-common.jarflex-messaging-common.jar
flex-messaging-opt.jarflex-messaging-opt.jarflex-messaging-opt.jarflex-messaging-opt.jar
flex-messaging-core-4.7.3.jar 最新版,下载了好长时间才下载下来,亲测可用!
flex-messaging-common-1.0.jar 资源共享,有需要其他jar包的可以在评论留言,看到后我会陆续上传。
flex-messaging-opt-1.0.jar 资源共享,有需要其他jar包的可以在评论留言,看到后我会陆续上传。
Flex SVN--1.5.5版本Flex SVN--1.5.5版本Flex SVN--1.5.5版本Flex SVN--1.5.5版本Flex SVN--1.5.5版本Flex SVN--1.5.5版本Flex SVN--1.5.5版本
FLEX开发工具。Flex Builder 4-7 win64 安装文件,第三卷。