News > Announcements

[Release] MegaZine3 Version 2.0.11 RC1

(1/1)

Florian Nücke:
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:
<script><![CDATA[function myhandler(event) {  var t = event.currentTarget;  var x = int(Math.random() * (t.parent.width - t.width));  var y = int(Math.random() * (t.parent.height - t.height));  t.x = x;  t.y = y;}]]></script> <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).

Navigation

[0] Message Index

Go to full version