微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Spring ActionScript

程序名称:Spring ActionScript

授权协议: Apache

操作系统: 跨平台

开发语言: ActionScript

Spring ActionScript 介绍

Spring ActionScript 是 ActionScript 编程语言的一个 IoC 、MVC 编程框架,主要用于 Flash、Flex 和 AIR
平台的应用开发。

当前版本的Spring
ActionScript已经实现了IOC,反射编程框架,集成了CairngormPureMVC框架。接下来会开发一个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()  
}

Spring ActionScript 官网

http://www.springactionscript.org/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐