标签存档:Flex
仿苹果的Accordion实现
发表时间:30. Apr, 2010 作者:Freddie.
原文出自 doug 先生的博客
点我查看效果
这个效果很久以前就在doug的博客看到了,觉得很cool,昨天下源码下来研究,发现编译不了!到网上一搜,有很多人在问这个,可是没人提出解决的办法。 Fred只好自己再跑去看源码,发现在问题所在:原来是源码里的flexlib版本不对,换了个版本,ok,编译通过!:idea:
大致看了一下源码,比较简单,主要是就一个header renderer!
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
xmlns:code="http://code.google.com/p/flexlib/"
xmlns:local="*">
<mx:Style source="assets/style.css"/>
<mx:Panel title="Essentials">
<code:VAccordion id="accordion"
headerLocation="below"
[...]
详细内容
flex+BlazeDS与spring集成
发表时间:18. Dec, 2009 作者:Freddie.
本文基本上就是Christophe Coenraets 先生的 Using Flex with Spring 的翻译版本,加上了自己的注解便于理解
首先,你得有一个SpringFactory.java类。去网上找,没有的话留下邮箱我发给你们~
1.新建一个工程,服务器端选用j2ee,跟建立blazeDS一样~ 配置好路径,加入web容器支持和spring容器支持~(这一步比较简单,详细步骤就省了~)
2.现在我们来写hello world~ 首先在src下写一个HelloWorld.java,我的路径是com.tub.HelloWorld.java
public class HelloWorld {
public String message(String str){
return str;
}
}
3.然后是flex端~
<mx:RemoteObject id=”ro” destination=”MessageService”/>
<mx:TextInput id=”ta”/>
<mx:Button label=”Button” click=”ro.message(String(ta.text))”/>
<mx:Label text=”{ro.message.lastResult}”/>
注:ro当然就指的是HelloWorld了,destination指定的内容是我们需要在WEB-INF/flex/remoting-config.xml中配置的destination了,它会指定一个具体对应的类或者是spring工厂~(我们这里当然是交给spring工厂拉)
4.代码都写好了,我们现在要对spring进行配置了~~
把SpringFactory放在java目录下,我的路径是com.tub.spring
然后,我们需要在web.xml中加入
<context-param>
<param-name>spring</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
最后,我们还需要对flex的service-config.xml进行配置,加入
<factories>
<factory id=”spring” />
</factories>
好了,大功告成拉~ 赶快去deploy了运行看看吧~
详细内容
flex 3 全屏代码
发表时间:10. Dec, 2009 作者:Freddie.
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute”>
<mx:Script>
<![CDATA[
import flash.display.StageDisplayState;
private function fullScreen(event:MouseEvent):void{
if (stage.displayState == StageDisplayState.FULL_SCREEN)
{
mybtn.label = "全屏模式";
stage.displayState = StageDisplayState.NORMAL;
}
else
{
mybtn.label = "返回全屏";
stage.displayState = StageDisplayState.FULL_SCREEN;
}
}
]]>
</mx:Script>
<mx:Button x=”112″ y=”99″ label=”mybtn” id=”mybtn” click=”fullScreen(event)”/>
</mx:Application>
////////////////////////////////////////////////////////////////////////////
修改文件 html-template/index.template.html
<!– saved from url=(0014)about:internet –>
<html lang=”en”>
<!–
Smart developers always View Source.
This application was built using Adobe Flex, an open [...]

