myeclipse106+flashbuilder46配置教程.docx

上传人:b****6 文档编号:7257358 上传时间:2023-01-22 格式:DOCX 页数:14 大小:502.72KB
下载 相关 举报
myeclipse106+flashbuilder46配置教程.docx_第1页
第1页 / 共14页
myeclipse106+flashbuilder46配置教程.docx_第2页
第2页 / 共14页
myeclipse106+flashbuilder46配置教程.docx_第3页
第3页 / 共14页
myeclipse106+flashbuilder46配置教程.docx_第4页
第4页 / 共14页
myeclipse106+flashbuilder46配置教程.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

myeclipse106+flashbuilder46配置教程.docx

《myeclipse106+flashbuilder46配置教程.docx》由会员分享,可在线阅读,更多相关《myeclipse106+flashbuilder46配置教程.docx(14页珍藏版)》请在冰豆网上搜索。

myeclipse106+flashbuilder46配置教程.docx

myeclipse106+flashbuilder46配置教程

Myeclipse10.6+FlashBuilder4.6安装配置

所需软件列表:

Myeclipse10.6(或eclipse3.6+);

FlashBuilder4.6;(以下简称FB)

Tomcat6.0+;

JDK1.6;

blazeds-turnkey-4.0.0.14931;

安装以上程序.(下载地址,破解等等,都能XX到….)

安装FB的eclipse插件

找到FB安装目录:

D:

\ProgramFiles\Adobe\AdobeFlashBuilder4.6\utilities\AdobeFlashBuilder4.6Plug-inUtility.exe

双击安装.(不安装FB直接安装这个插件是不可以的)

安装时要选择myeclipse的目录,选到:

D:

\ProgramFiles\MyEclipse\MyEclipse10即可.

安装完flashbuilder插件的myeclipse再打开时变成了中文的界面,看个人喜好了,本人用惯了原版界面,就改回去了.方法如下:

找到myEclipse安装目录下的configuration文件下找到config.ini在最后添加osgi.nl=en_US来解决此问题

打开后如下图:

blazeDS的设置

将blazeds-turnkey-4.0.0.14931目录下的三个war包拷贝到tomcat/webapps下(并把blazeds.war解压,后面用到)

至此所有的安装工作完毕.接下来就是如何新建并运行一个javaflexweb项目了.

新建一个web项目:

flexweb

右击WebRoot选择import—>GeneralFilesystem,展开发现在WEB-INF目录下面多了flex文件夹,这个很重要主要是通信的4个配置文件.

“Fromdirectory”选到tomcat/webapps下的blazeds目录.

单击Finish然后选择”Ysetoall”

导入成功

部署到tomcat

给web项目加入flex项目属性

在flexweb项目上右键,选择”Add/ChangeProjectType”:

本人的项目已经加过了,所以是灰色的啦.

默认,”next”:

其中的几个目录,参照上图设置即可.记得先”ValidateConfiguration”一下再完成.

OK,完成后解决错误的方法:

重新创建html模板就哦了.

下面是解决src目录冲突的问题:

src是java的源文件夹存java源代码地方,但是现在被flex给占用了.

在flexweb项目上右键-属性,打开后找到”FlexBuildPath”(Flex构建路径):

把Mainsoucefolder直接改为:

flex_src

然后把src文件夹里面的flexweb.xml移动到flex_src文件夹里面,最终目录如下:

做个helloworld实现flex与java通信

这里都是参考网上已有的教程.

切换到myeclipse视图,暂时忽略一切可能出现的红色叉号.

在src/test目录下新建类:

Accptech.java

packagetest;

publicclassAccptech{

publicStringhelloWorld(Stringname){

returnname+"你好,欢迎来到fb世界!

";

}

}

配置Webroot/WEB-INF/flex/remoting-config.xml:

xmlversion="1.0"encoding="UTF-8"?

>

class="flex.messaging.services.RemotingService">

test.Accptech

修改flex_src/flexweb.mxml文件:

xmlversion="1.0"encoding="utf-8"?

>

Applicationxmlns:

fx="

xmlns:

s="library:

//

xmlns:

mx="library:

//minWidth="955"minHeight="600">

Script>

[CDATA[

importmx.controls.Alert;

importmx.rpc.events.FaultEvent;

importmx.rpc.events.ResultEvent;

protectedfunctionmyFlex_resultHandler(event:

ResultEvent):

void

{

varname:

String=event.resultasString;

Alert.show(name);

}

protectedfunctionbtnSend_clickHandler(event:

MouseEvent):

void

{

myFlex.helloWorld(txtName.text);

}

]]>

Script>

Declarations>

--Placenon-visualelements(e.g.,services,valueobjects)here-->

RemoteObjectid="myFlex"destination="mytest"result="myFlex_resultHandler(event)"/>

Declarations>

Panelx="87"y="20"width="250"height="200"title="1stflex4">

TextInputx="16"y="37"id="txtName"/>

Buttonx="168"y="38"label="发送"id="btnSend"click="btnSend_clickHandler(event)"/>

Panel>

Application>

解释:

这个配置就是调用java端的一个远程对象,destination="mytest"就是我们刚才配置的remoting-config.xml文件中的ID名称,result="myFlex_resultHandler(event)"就是如果服务器成功就执行result里面的方法。

 

Declarations>

  

--Placenon-visualelements(e.g.,services,valueobjects)here-->

  

RemoteObjectid="myFlex"destination="mytest"result="myFlex_resultHandler(event)"/>

 

Declarations>

然后点发送按钮时发送远程对象的helloWorld方法,执行click="btnSend_clickHandler(event)"

接下来,启动Tomcat服务,然后运行项目即可.

启动服务

运行.

恭喜!

蛇年快乐!

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 表格模板 > 合同协议

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1