首先建一个netbeans的java web项目
然后从网上吧blazeds.war 下载下来用rar 解压 把web-inf 替换掉在netbeans\web 下面的web-inf中的全部文件
然后 部署下
在打开flex builder 新建一个flex project 写上名字和项目路径
在Application server type 选中j2ee
点击 下一步
然后 Root folder选中netbeans 建的项目 下的web路径 例如E:\学习\WebDemo\web {我的项目交WebDemo}
Root Url 写上你的服务器url路径 例如:http://localhost:8080/WebDemo
Context root 还是/WebDemo
在output folder 这里注意一下 比如我的项目是E:\学习\WebDemo\ 这个路径下 那么写E:\学习\WebDemo\web 这样的话flex builfer就会把生成的文件都放在web下面了
然后下一步 ok 现在项目算是搭建完事了
现在修改配置文件netbeans 下面的web\web-inf\flex\remoting-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.ada ......
官网信息:(API:http://flexlib.googlecode.com/svn/trunk/docs/index.html)
HowToContribute
How you can contribute code to FlexLib
IntroductionLicenseBefore you submit codeFlexBuilderProject page to learn how to check out the project into Flex Builder. Read HowToBuild to learn how to compile the source files.
Everyone is encouraged to contribute Flex components they have developed. The FlexLib project is meant to be an inclusive community project. That said, we want to make sure that the components included in the FlexLib library are high quality and follow good coding practices.
All code submitted to FlexLib must be released under the MIT license. All code must have the standard version of the FlexLib MIT license block added to each source file (see any of the current source files in the SVN repository). Any original classes from Adobe or Macromedia should retain the original licensing block contained in those files.
Here's the license block:
/*
Copyright (c) 200 ......
源贴地址 http://www.riachina.com/showtopic.aspx?topicid=8556#
由于Localconncetion的某些限制(一台客户只可以使用特定名字的一个连接,这样的程序如果开两个窗口就会发生异常),今天闲着没事做了一个这样的试验。让Flash CS3和Flex的代码可以相互调用,为了显示效果,在双方的界面分别放置了一个文本输入框和一个按钮。
这是Flex端的代码:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
//把当前的application引用告诉swf
private function onSwfLoaded(event:Event):void{
Object(myloader.content).setApp(this);
}
//准备给swf调用的方法
public function appshowtext(str:String):void{
textinput.text=str;
}
]]>
</mx:Script>
<mx:SWFLoader id="myloader" source="local.swf" creationComplete="onSwfLoaded(event)"/>
<mx:TextInput id="textinput"/>
<mx:Button label="send to local.swf" click="Object(myloader.content).swfshowtext(textinput ......
只是简单实现了一下计算。主要是练下手。
实现了鼠标跟键盘的事件响应。
-----------------------------
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
width="198" height="224" fontSize="12" themeColor="#4D8853" borderColor="#B1C2CE" backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#DFDCDC, #196722]"
applicationComplete="initApp();"
>
<mx:Script>
<!--[CDATA[
var one:int = 0; //第一个数
var two:int = 0; //第二个数
var jg:int = 0; //结果
var other = 0; //操作符0,没.1,+,2-,3*,4/
var sate:int = 1; //1是输入第一个数,2是第二个
//临时存储文本框中的数字
internal function but_1():void
{
sum.text += 1;
}
internal function but_2():void
{
sum.text += 2;
}
internal function but_3():void
{
sum.text += 3;
}
internal function but_4():void
{
sum.text += 4;
}
internal function but_5():void
{
sum.text += 5;
}
......
<mx:TextInput id="userName" maxChars="4" restrict="a-zA-Z" />
restrict属性确实可以输入正则表达式,进行输入的验证。
但是在程序执行的时候如果为userName.text = "999"还是可以成功的。
待续。。。。学习中。。。 ......
上次听朋友提起现在再用Flex做项目,闲暇之余在自己的电脑上配置了Flex + myeclipse的开发环境。虽然开发环境搭建花了不少的时间,也遇到了不少问题。再解决这些问题的时候,也找了不少的资料,学到了不少东西。呵呵
继续研究学习................... ......