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に参考できますが、何と無くわかり辛いようですね。

  1. <?xml version="1.0"?>
  2. <!DOCTYPE beans SYSTEM "http://lowra.googlecode.com/svn/trunk/tools/assembler.dtd">
  3.  
  4. <beans>
  5.  
  6.         <!--    You can insert here all the compiled classes you need
  7.                         to make your application working. -->
  8.  
  9.         <dll url="dll/FakePluginListenerDLL2.swf"/>    
  10.        
  11.    
  12.     <!--        You can insert here all the resources files you need
  13.                         to make your application working. -->
  14.  
  15.     <rsc id="info" url="resource/readme.txt" />
  16.     <rsc id="css" url="resource/style.css" deserializer-class="com.bourre.encoding.CSSDesrializer" />  
  17.  
  18.  
  19.         <!-- That's your application loader config (if you need one) -->
  20.  
  21.         <!--<application-loader url="swf/loader.swf"
  22.                                                 progress-callback="onProgress"
  23.                                                 complete-callback="onBuild"/>-->
  24.  
  25.  
  26.  
  27.         <!--    That's the visual tree of your application.
  28.                         If you need a graphical structure, root node is mandatory. -->
  29.  
  30.         <root>
  31.  
  32.                 <container id="container">
  33.                        
  34.                         <property name="x" type="int" value="50"/>
  35.                         <property name="y" type="int" value="50"/>
  36.  
  37.                         <swf id="background" url="swf/background.swf" visible="false"/>
  38.  
  39.                         <swf id="coffee" url="swf/coffee.jpg">
  40.                                 <property name="x" type="int" value="100"/>
  41.                                 <property name="y" type="int" value="100"/>
  42.                                 <property name="alpha" type="Number" value="0.1"/>
  43.                         </swf>
  44.                        
  45.                         <txt id="txt" type="flash.text.TextField">
  46.                                 <property name="text" value="Hello world!"/>
  47.                                 <property name="y" type="int" value="250"/>
  48.                                 <property name="autoSize" value="center"/>
  49.                                
  50.                                 <method-call name="setTextFormat">
  51.                                         <argument ref="tf"/>
  52.                                 </method-call>
  53.                         </txt>
  54.                        
  55.                         <square id="square" type="com.prizee.ui.Square">
  56.                                 <property name="alpha" type="Number" value="0.5"/>
  57.                                 <property name="x" type="int" value="150"/>
  58.                         </square>
  59.  
  60.                 </container>
  61.  
  62.         </root>
  63.  
  64.  
  65.  
  66.         <!--    Objects instanciation begins here.
  67.                         Methods call happen when all objects have been built. -->
  68.  
  69.         <tf id="tf" type="flash.text.TextFormat">
  70.                 <argument type="" value="Arial"/>
  71.                 <argument type="Number" value="30"/>
  72.                 <argument type="Number" value="0XFF"/>
  73.         </tf>
  74.  
  75.  
  76.  
  77.         <array id="collection" type="Array">
  78.                 <argument ref="dimensionClass"/>
  79.                 <argument method="range1.clone"/>
  80.                 <argument ref="obj"/>
  81.                 <argument ref="config"/>
  82.                 <argument ref="coffee"/>
  83.         </array>
  84.  
  85.  
  86.  
  87.         <dll url="dll/RangeDLL.swf"/>
  88.  
  89.         <range id="range1" type="com.bourre.structures.Range">
  90.                 <argument ref="min"/>
  91.                 <argument type="Number" value="5"/>
  92.         </range>
  93.  
  94.         <range id="range2" type="com.bourre.structures.Range">
  95.                 <argument type="Number" value="5"/>
  96.                 <argument ref="max"/>
  97.         </range>
  98.  
  99.  
  100.  
  101.         <dll url="dll/DimensionDLL.swf"/>
  102.  
  103.         <dimension id="dimension1" type="com.bourre.structures.Dimension">
  104.                 <argument type="Number" value="800"/>
  105.                 <argument type="Number" value="600"/>
  106.         </dimension>
  107.  
  108.         <dimension id="dimension2" type="com.bourre.structures.Dimension">
  109.                 <argument type="Number" value="1024"/>
  110.                 <argument type="Number" value="768"/>
  111.                
  112.                 <method-call name="setSize">
  113.                         <argument ref="dimension1"/>
  114.                 </method-call>
  115.         </dimension>
  116.  
  117.  
  118.  
  119.         <dll url="dll/FakePluginDLL.swf"/>
  120.  
  121.         <fake id="fake" type="FakePlugin">
  122.                 <argument value="Hello world!"/>
  123.                 <argument ref="background"/>
  124.                
  125.                 <method-call name="testPlugin"/>
  126.         </fake>
  127.  
  128.  
  129.  
  130.         <min id="min" type="Number" value="1"/>
  131.         <max id="max" type="Number" value="10"/>
  132.  
  133.  
  134.  
  135.         <dll url="dll/FakePluginListenerDLL.swf"/>
  136.  
  137.         <fake id="fakeListener" type="com.prizee.plugin.FakePluginListener">
  138.                 <argument ref="dimension1"/>
  139.  
  140.                 <listen ref="fake" />
  141.         </fake>
  142.  
  143.  
  144.  
  145.         <dictionary id="dictionary" type="Dictionary">
  146.                 <item> <key ref="dimension2"/> <value ref="dimension1"/> </item>
  147.                 <item> <key ref="dimension1"/> <value ref="dimension2"/> </item>
  148.                 <item> <key type="Number" value="13"/> <value type="Class" value="com.bourre.structures.Dimension"/> </item>
  149.         </dictionary>
  150.  
  151.  
  152.  
  153.         <class id="dimensionClass" type="Class">
  154.                 <argument value="com.bourre.structures.Dimension"/>
  155.         </class>
  156.  
  157.  
  158.  
  159.         <dll url="dll/UIDLL.swf"/>
  160.  
  161.         <dictionary id="displayObjectDictionary" type="Dictionary">
  162.                 <item> <key value="com.prizee.ui.Square"/> <value type="Class" value="com.prizee.ui.Square"/> </item>
  163.         </dictionary>
  164.  
  165.  
  166.  
  167.         <dictionary id="dico" type="Dictionary">
  168.                 <item> <key value="o"/> <value ref="obj"/> </item>
  169.         </dictionary>
  170.  
  171.  
  172.  
  173.         <dll url="dll/TypedFactoryLocatorDLL.swf"/>
  174.  
  175.         <factory id="displayOjectFactory" type="com.bourre.core.TypedFactoryLocator">
  176.                 <argument type="Class" value="flash.display.MovieClip"/>
  177.                 <method-call name="add"><argument ref="displayObjectDictionary"/></method-call>
  178.         </factory>
  179.  
  180.  
  181.  
  182.         <dll url="dll/XMLToObjectDeserializerDLL.swf"/>
  183.  
  184.         <xml id="config" type="XML" deserializer-class="com.bourre.encoding.XMLToObjectDeserializer">
  185.                 <root>
  186.                         <node>1</node>
  187.                         <node>2</node>
  188.                         <node>
  189.                                 <childNode>childNodeValue</childNode>
  190.                         </node>
  191.                         <node>4</node>
  192.                 </root>
  193.         </xml>
  194.  
  195.  
  196.  
  197.         <object id="obj" type="Object">
  198.                 <property name="p1" value="hello1"/>
  199.                 <property name="p2" value="hello2"/>
  200.         </object>
  201. </beans>

公式サイト: http://code.google.com/p/lowra/

参考URL: http://lowra.customactions.net/doc/howto/reference-assembler.html

メインコンテンツEND ■
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Posted on Tuesday, 26th May 2009 by admin

Tags: , , ,
Posted in ActionScript, Flash Project | Comments (0) | 1,563 views

Related Posts

Leave a Reply