Pages: [1]
  Print  
Author Topic: Version 3.1.4 / 3.1.5  (Read 12001 times)
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3177


gaiaframework
WWW
« on: June 06, 2009, 03:06:01 PM »

Gaia Framework for Adobe Flash v3.1.5
Release Date: 06.10.2009

This version is no longer available.

3.1.5 Quick Fix
The optimized asset code had some minor issues in both AS2 and AS3 and I had to make some quick fixes to both.  I also (hopefully) fixed the issue where some donators were having trouble authenticating after upgrading.


3.1.4 Overview
Gaia 3.1.4 is an awesome update.  First and foremost, the Gaia Asset engine is now extensible for developers to create and contribute custom assets, allowing Gaia to be extended in completely customizable ways!  Additionally, the asset engine has been optimized in the process.  This version also fixes two longstanding issues with deeplinking and indexFirst, and one I found with NetStreamAsset in AS3.  There are some minor fixes to the panel thrown in, as well.

Note: Gaia 3.1.4 is backwards compatible with old projects, but because of the changes to the asset engine, you must update your project to 3.1.4 to use the Optimize Project option in the Scaffold panel.

Also, if you are using SoundClipAssets in AS2, you need to set the type="soundclip" in the site.xml instead of just "sound".


Extensible Custom Assets
You can now extend Gaia with your own custom assets. Examples and documentation will be coming soon.  In the meantime, here's an overview of how it works.

The Gaia API now has a new function, addCustomAsset().  This function allows you to pass your own custom Asset class into Gaia, and associate it with a type that you can set in the site.xml.

Code:
AS3: Gaia.api.addCustomAsset(assetClass:Class, type:String):void;

AS2: Gaia.api.addCustomAsset(assetClass:Function, type:String):void;

Custom classes MUST extend AbstractAsset (or any other Gaia Asset class) to work.  In your custom asset class, you can override the function parseNode(page:IPageAsset).  This allows you to do custom xml parsing of your asset node.  This enables you to pass non-Gaia attributes, as well as child nodes inside the asset node.

Just as an example, if you wanted to create an image gallery asset and pass it some xml, you could do this:
Code:
<asset id="myAsset" src="gallery.swf" type="imagegallery">
    <data src="images.xml"/>
</asset>

You might have your ImageGalleryAsset extend MovieClipAsset, and in its parse node function, grab that xml path for loading it later.

Code:
override public function parseNode(page:IPageAsset):void
{
    super.parseNode(page);
    var imageXMLPath:String = _node.data[0].@src;
}

Or, maybe you would define the images themselves in the xml:

Code:
<asset id="myAsset" src="gallery.swf" type="imagegallery">
    <image src="1.jpg"/>
    <image src="2.jpg"/>
    <image src="3.jpg"/>
</asset>

And then parse those images out and pass them to your custom swf:

Code:
private var images:XMLList;

override public function parseNode(page:IPageAsset):void
{
    super.parseNode(page);
    images = _node.image;
}
override protected function onComplete(event:Event):void
{
    super.onComplete(event);
    MovieClip(_loader.content).images = images;
}

To add your asset to Gaia, during custom initalization in your Main class before the site.xml loads, you call addCustomAsset and pass your class (not an instance of your class, just the class itself) and the type you want to associate it with in the asset node type attribute.

Code:
override protected function loadSiteXML():void
{
    Gaia.api.addCustomAsset(ImageGalleryAsset, "imagegallery");
    super.loadSiteXML();
}

This will add your class to one of the recognized types and when Gaia parses the site.xml OR when you use addAssets() to add them dynamically at run-time, Gaia will be able to create an instance of your asset class when it sees the matching type.

The sky is really the limit with what you can do here.  Nemo is working on a TextFieldAsset right now, and I'll be working on some example custom assets over the next month.  This new feature gives you a ton of flexibility and power to customize Gaia to your specific needs, as well as create your own reusable libraries of Gaia assets (and share them with the community, hint! hint!).

What's even cooler is that this change actually made the asset package smaller and more efficient!  Gaia just got smaller and more powerful!


Deeplink and Current Branch Detection Fixed
A long standing issue with Gaia is that when the site first loads, getValue() was returning "/", getCurrentBranch() was returning "index" (when indexFirst="true") and getDeeplink() was returning "", even when there was a deeplink.  This has all been fixed in Gaia 3.1.4.

You can now use getCurrentBranch(), getValue(), and getDeeplink() in your pages when the site loads and you will get the expected actual values without any hacky workarounds or hijacking.  Gaia.api.getValue() should be used instead of SWFAddress.getValue().  Even if indexFirst="true" you will get the actual branch Gaia is loading after index loads, even in the Index page.


AS3 On-Demand NetStreamAssets Not Dispatching Progress Fixed
On-Demand NetStreamAssets were not dispatching progress when you used the load() command on them.  Now they are doing that properly.  This is useful if you are tracking the progress of NetStreamAssets in a scrub bar because you can now listen for the AssetEvent.PROGRESS.


Panel Fixes
AS2 projects were incorrectly including BitmapAssets as a type under Optimize.  

The panel was not including the proper namespace for sitemap.xml.

The panel was always opening main.fla to publish it, and now it works like the other files do.  If main.fla is open, it will test movie, otherwise, it will publish and then launch the main.swf as if it was unchecked.  This is great for users of CS4 on Windows.  Unfortunately, Mac users of CS4 will need to keep main.fla open and check the box to prevent main.swf from launching in a tab inside Flash due to the bug in the IDE with launching swfs in a tab not a window.
« Last Edit: September 03, 2009, 06:47:53 AM by steven » Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
steven
Gaia Author
Administrator
Gaia Evangelist
*****
Posts: 3177


gaiaframework
WWW
« Reply #1 on: June 10, 2009, 03:03:43 PM »

3.1.5 quick fix for asset issues with AS3 and AS2.
Logged

Steven Sacks | Gaia Author
Please support Gaia by donating to the project!  Smiley
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc