---
title: "myeclipst开发flex（前人总结）"
author: "akinlong"
date: "2011-08-09T21:35:15Z"
tags: []
categories: ["Web前端"]
slug: "myeclipst-flex"
draft: false
lastmod: "2011-08-09T21:35:15Z"
id: 1143922
url: "https://akinlong.iteye.com/blog/1143922"
---

第一步：新建一项目：new->flex project
弹出对话框如下：
 

 注意方框圈住部分，假如Application server type 项选为none，则是简单的生成swf的应用。不会有web项目的结合。而选为J2EE则是进行web项目的应用。
单击“next”
 
第二步：


1. target runtime项需要进行自己添加，基本不会出现问题。
2.content folder 是将来在tomcat生成内容的文件夹名称，由于我习惯了用webroot，所以把名字改了，好觉得比较熟悉一些。
3.flex WAR file 是把前面说的那个blazeds.war放到tomcat的webapps路径下，把路径拷过来即可。
【说明：如果在上一步，没有选择Use remote object access service 则可以跳过这条，但是在生成项目时，不会生成flex的配置文件】
4.output folder 是项目中flex主要内容的路径，最好设在content folder的路径下面，也就是我这里的 webroot\flex可以根据喜好进行命名。（此处默认的debug-bin，具体怎么回事我也不太清楚，）
单击“next”或“finish” ， 即完成项目创建！
 
项目形式如下图：（其中方框标记处就是我上面介绍的几点生成的效果）


 
 
第三步：在helloworld.mxml文件中输入
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:Script>
 <!]>
</mx:Script>
<mx:Label text="hello world"/> 
</mx:Application>
 
第四步：将flex项目改成web项目，以便能够在tomcat中进行部署、运行！
选中项目，右键，弹出如图显示


 单击“finish”即可。
 
第五步：部署到tomcat，并启动tomcat。
右键run as->run configurations对运行进行配置，
"http://localhost:8080/helloworld/flex/helloworld.html”
然后运行右键run as->flex application
即可浏览到做的结果。