Author Topic: [Release] MegaZine3 Version 2.0.11 RC1  (Read 1694 times)

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
[Release] MegaZine3 Version 2.0.11 RC1
« on: December 24, 2010, 05:03:15 pm »
Version 2.0.11 RC1 is now available.

As a little Christmas present, here is the release candidate of the upcoming version 2.0.11 ;)

Aside from the many small fixes and additions, here are the two major newcomers:
  • ASUL scripting
    It is now possible to determine GUI behavior in ASUL directly, without the need for writing
    a plugin or using JavaScript, and interact with the engine (a simple case: goto a page,
    but essentially the full AS3 API can be used!)
    That's right, you can now embed scripts directly into ASUL files to adjust the behavior
    of plugins, put small scripted elements in the fore- or background tags, and so on. This is
    realized using the D.eval library by the generous people at RiaOne, who distribute it
    for free.
    If the only thing on your mind after reading this is a big ?, let me give you an example:
    1. <script><![CDATA[
    2. function myhandler(event) {
    3.  var t = event.currentTarget;
    4.  var x = int(Math.random() * (t.parent.width - t.width));
    5.  var y = int(Math.random() * (t.parent.height - t.height));
    6.  t.x = x;
    7.  t.y = y;
    8. }
    9. ]]></script>
    10.  
    11. <button width="25" height="25" background="color(#3333AA)" onmouseover="myhandler(event)"/>


    The awesome part is, that all the functionality is defined in the ASUL description,
    meaning user-scripting has just gotten a lot easier, as you don't need to compile
    SWFs anymore.

    The second positive aspect of this is, that you will normally not need to go the
    detour of using JavaScript as before, e.g.
    <button url="javascript:MegaZine.gotoPage(10)" target="_self"/>
    will now simply become
    <button onclick="megazine.gotoPage(10)"/>
    Which means these modifications also work in the standalone player, not only
    in the browser!

    Obviously, this increases file size quite a bit (it's a full fledged AS3 parser, after all),
    but we feel it's well worth it. Also, for more complex operations it's still recommended
    to write it in the plugin class and compile it to a SWF, as that will run faster.

  • ResourceProvider
    This will be interesting to developers. For everyone else this part will be too technical,
    so you can skip it ;) Just take this with you: this basically allows to pack complete books,
    including page content, into one, big SWF or projector, which can make (especially offline)
    distribution a lot easier.
    The new version introduces an additional abstraction layer to the resource management
    and file loading. This means it is now (relatively) simple to use other data sources than the
    filesystem. A second such "resource bundle" (aside from the filesystem, which is used as
    final fallback) has already been implemented, to be used with embedded data (i.e. Flex's
    [Embed] tag, or library elements).
    Note that including and making available the embedded resources still requires
    some manual labor (the actual embedding and then telling the EmbeddedBundle under
    which name / path to find the resource).
    A great user contribution for this could be a script that parses a directory with
    data and generates an AS3 class from it which embeds and adds all the assets
    to the EmbeddedBundle. Similar to the python script used to generate the
    Assets class which does just that for the engine assets to build the fat client :)
    (see tools folder in SVN)
    I'll probably do this sometime myself, but one can dream ;)

    The possibilities don't end there, however. One could also define a resource
    bundle which is backed by a database, for example. Or just a proxy, which
    transforms URLs.

Especially the change to resource handling inspired our desire to give you the
chance to have a look over it before the release, because such changes also bear
the danger of new memory leaks.

Please give the new version a go and tell us what you think!

A merry Christmas, and a happy new year,
Florian and Hans

See the version history in the wiki for more information.

Download here (zip).
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.