LowRAとは、「Low-level Rework on Actionscript 3.0」の略、イベントハンドラ、ログ処理、メディア管理など機能がサポートされるActionScript3のオープンソースのフレームワークです。AS2バージョンの「Pixlib」もあります。
以下は公式サイトにLowRAが何かできる説明です。
It’s designed to support event handling, logging, data preloading, managing sound and video, making transitions, data holders and data structures, patterns implementations
「Mozilla Public License 1.1」でリリースされているので、商用アプリケーションでも構わないようです。
以下はLowRAアセンブラの例の一つです。タグなど説明は本文の最後の参考URLに参考できますが、何と無くわかり辛いようですね。
- <?xml version="1.0"?>
- <!DOCTYPE beans SYSTEM "http://lowra.googlecode.com/svn/trunk/tools/assembler.dtd">
- <beans>
- <!-- You can insert here all the compiled classes you need
- to make your application working. -->
- <dll url="dll/FakePluginListenerDLL2.swf"/>
- <!-- You can insert here all the resources files you need
- to make your application working. -->
- <rsc id="info" url="resource/readme.txt" />
- <rsc id="css" url="resource/style.css" deserializer-class="com.bourre.encoding.CSSDesrializer" />
- <!-- That's your application loader config (if you need one) -->
- <!--<application-loader url="swf/loader.swf"
- progress-callback="onProgress"
- complete-callback="onBuild"/>-->
- <!-- That's the visual tree of your application.
- If you need a graphical structure, root node is mandatory. -->
- <root>
- <container id="container">
- <property name="x" type="int" value="50"/>
- <property name="y" type="int" value="50"/>
- <swf id="background" url="swf/background.swf" visible="false"/>
- <swf id="coffee" url="swf/coffee.jpg">
- <property name="x" type="int" value="100"/>
- <property name="y" type="int" value="100"/>
- <property name="alpha" type="Number" value="0.1"/>
- </swf>
- <txt id="txt" type="flash.text.TextField">
- <property name="text" value="Hello world!"/>
- <property name="y" type="int" value="250"/>
- <property name="autoSize" value="center"/>
- <method-call name="setTextFormat">
- <argument ref="tf"/>
- </method-call>
- </txt>
- <square id="square" type="com.prizee.ui.Square">
- <property name="alpha" type="Number" value="0.5"/>
- <property name="x" type="int" value="150"/>
- </square>
- </container>
- </root>
- <!-- Objects instanciation begins here.
- Methods call happen when all objects have been built. -->
- <tf id="tf" type="flash.text.TextFormat">
- <argument type="" value="Arial"/>
- <argument type="Number" value="30"/>
- <argument type="Number" value="0XFF"/>
- </tf>
- <array id="collection" type="Array">
- <argument ref="dimensionClass"/>
- <argument method="range1.clone"/>
- <argument ref="obj"/>
- <argument ref="config"/>
- <argument ref="coffee"/>
- </array>
- <dll url="dll/RangeDLL.swf"/>
- <range id="range1" type="com.bourre.structures.Range">
- <argument ref="min"/>
- <argument type="Number" value="5"/>
- </range>
- <range id="range2" type="com.bourre.structures.Range">
- <argument type="Number" value="5"/>
- <argument ref="max"/>
- </range>
- <dll url="dll/DimensionDLL.swf"/>
- <dimension id="dimension1" type="com.bourre.structures.Dimension">
- <argument type="Number" value="800"/>
- <argument type="Number" value="600"/>
- </dimension>
- <dimension id="dimension2" type="com.bourre.structures.Dimension">
- <argument type="Number" value="1024"/>
- <argument type="Number" value="768"/>
- <method-call name="setSize">
- <argument ref="dimension1"/>
- </method-call>
- </dimension>
- <dll url="dll/FakePluginDLL.swf"/>
- <fake id="fake" type="FakePlugin">
- <argument value="Hello world!"/>
- <argument ref="background"/>
- <method-call name="testPlugin"/>
- </fake>
- <min id="min" type="Number" value="1"/>
- <max id="max" type="Number" value="10"/>
- <dll url="dll/FakePluginListenerDLL.swf"/>
- <fake id="fakeListener" type="com.prizee.plugin.FakePluginListener">
- <argument ref="dimension1"/>
- <listen ref="fake" />
- </fake>
- <dictionary id="dictionary" type="Dictionary">
- <item> <key ref="dimension2"/> <value ref="dimension1"/> </item>
- <item> <key ref="dimension1"/> <value ref="dimension2"/> </item>
- <item> <key type="Number" value="13"/> <value type="Class" value="com.bourre.structures.Dimension"/> </item>
- </dictionary>
- <class id="dimensionClass" type="Class">
- <argument value="com.bourre.structures.Dimension"/>
- </class>
- <dll url="dll/UIDLL.swf"/>
- <dictionary id="displayObjectDictionary" type="Dictionary">
- <item> <key value="com.prizee.ui.Square"/> <value type="Class" value="com.prizee.ui.Square"/> </item>
- </dictionary>
- <dictionary id="dico" type="Dictionary">
- <item> <key value="o"/> <value ref="obj"/> </item>
- </dictionary>
- <dll url="dll/TypedFactoryLocatorDLL.swf"/>
- <factory id="displayOjectFactory" type="com.bourre.core.TypedFactoryLocator">
- <argument type="Class" value="flash.display.MovieClip"/>
- <method-call name="add"><argument ref="displayObjectDictionary"/></method-call>
- </factory>
- <dll url="dll/XMLToObjectDeserializerDLL.swf"/>
- <xml id="config" type="XML" deserializer-class="com.bourre.encoding.XMLToObjectDeserializer">
- <root>
- <node>1</node>
- <node>2</node>
- <node>
- <childNode>childNodeValue</childNode>
- </node>
- <node>4</node>
- </root>
- </xml>
- <object id="obj" type="Object">
- <property name="p1" value="hello1"/>
- <property name="p2" value="hello2"/>
- </object>
- </beans>
公式サイト: http://code.google.com/p/lowra/
参考URL: http://lowra.customactions.net/doc/howto/reference-assembler.html
メインコンテンツEND ■
Posted on Tuesday, 26th May 2009 by admin
Tags: LowRA, Pixlib, オープンソース, フレームワーク
Posted in ActionScript, Flash Project | Comments (0) | 1,563 views
