Spring ActionScript
- 授权协议: Apache
- 开发语言: ActionScript
- 操作系统: 跨平台
- 软件首页: http://www.springactionscript.org/
- 软件文档: http://www.springactionscript.org/docs/reference/html/springactionscript.html
软件介绍
Spring ActionScript 是 ActionScript 编程语言的一个 IoC 、MVC 编程框架,主要用于 Flash、Flex 和 AIR 平台的应用开发。
当前版本的Spring ActionScript已经实现了IOC,反射编程框架,集成了Cairngorm和PureMVC框架。接下来会开发一个MVCS( Model-View-Controller-Service)的架构,并且加入AOP(Aspect Oriented Programming)面向切面编程。
使用pranaframework框架的一个例子(与使用Spring ActionScript类似,只是包名改了):
1.定义XML配置文件.
prana_config.xml
<?xml version="1.0" encoding="utf-8"?>
<objects>
<object id="sound" class="flash.media.Sound"/>
<object id="request" class="flash.net.URLRequest">
<constructor-arg type="String" value="testSound.mp3"/>
</object>
</objects>
2.加载配置文件,生成对象.
ActionScript时间轴代码
import org.pranaframework.context.support.XMLApplicationContext;
var context:XMLApplicationContext=new XMLApplicationContext("prana_config.xml");
context.addEventListener("complete",onContextComplete);
context.load();
function onContextComplete(e:Event):void{
var sound=context.getObject("sound")
sound.load(context.getObject("request"))
sound.play()
}
