Gaia, is a framework for creating Flash pages, which is open source and we can adapt to our needs.
Greatly facilitates the development of flash pages, and significantly reduces the time of development. It also has very good documentation which is very easy to start using it. It provides a panel (for the Adobe Flash) that is installed through an extension of the Adobe Extension Manager application. In version 3.1.9, has introduced the option of creating a draft FlashDevelop or Flex Builder. Once created you can import into Flex and everything working.
You can also import the project in Flex Builder Eclipse with FDT, which is our case.
Normally we create the project from the panel gives us the extent of Gaia, and compile the files. Fla, the aim of this paper is to compile the project without the need for a Flash application itself, so that only necessary for the creation the project.
Gaia Project
A Gaia project consists of the following directories:
src: source code files. as, here are the main application and the various pages
lib: file. fla to compile in Flash environment.
templates: Templates.
To compile a project Gaia, you have to compile the classes Main.as, Preload.as and all pages in the project are named * Page.as.
If you download this file build.zip really there in the build.xml file that contains the targets required to compile the project, there is a build directory that contains libraries necessary to use some task, such as xmltask we will read the file site.xml there within bin/xml (directory created by Gaia).
Main.
Main.as The file is loaded first and is that going to take to load the various pages of the project. How to compile a file is detailed in the article
Ant Developer flash – Task macrodef (part 4) so that to compile this class using the target compile-main the build.
<target name="compile-main">
<echo message="compile-main"/>
<compile source="${src}/Main.as" target="${bin}/Main" debug="false"/>
<exec executable="${flashplayer}">
<arg line="${bin}/Main.swf" />
</exec>
</target>
Preload.
Before compiling the preload is necessary to make some modifications as this if you need objects found in the library file preload.fla. If we want to avoid having to open Flash you have two options, not compile with ANT preload and do only with Flash, or create a preload in actionscript. In this example we will leave blank to preload the entire project to compile and then create a preload in Flash. To do this modify the file src/pages/Preload.as and leave as follows:
package pages
{
import com.gaiaframework.templates.AbstractPreloader;
import com.gaiaframework.events.AssetEvent;
public class Preloader extends AbstractPreloader
{
//public var scaffold:PreloaderScaffold;
public function Preloader()
{
super();
//scaffold = new PreloaderScaffold();
}
override public function transitionIn():void
{
//scaffold.transitionIn();
transitionInComplete();
}
override public function transitionOut():void
{
//scaffold.transitionOut();
transitionOutComplete();
}
override public function onProgress(event:AssetEvent):void
{
//scaffold.onProgress(event);
}
}
}
This way we avoid the use PreloaderScaffold class is a class file linked to preload.fla.
Create the target to compile the preload:
<target name="compile-preloader">
<echo message="compile-preloader"/>
<compile source="${pages}/Preloader.as" target="${bin}/preload" debug="false"/>
</target>
</pre>
Pages.
The kinds of pages in a project gaia, are in the same place as the preload within the pages package, this might be different if when we created the project we have specified a different path.
The classes have the suffix Page, and in the site.xml file, are defined by the label page, so we have to walk the site.xml file, find the labels page, and compile the relevant class for this we use the following target:
<target name="compile-pages">
<echo message="compile-pages"/>
<xmltask source="${sitexml}">
<call path="//page">
<param name="id" path="@id" default="NO ID"/>
<param name="dest" path="@src" default="NO ID"/>
<actions>
<var name="fuppercase" unset="true"></var>
<first-uppercase property="fuppercase" input="@{id}"/>
<compile source="${pages}/${fuppercase}Page.as"
target="${bin}/@{id}"
debug="false"/>
</actions>
</call>
</xmltask>
</target>
and we conclude with the target main:
<target name="main" depends="compile-pages, compile-preloader, compile-main"> <echo message="main"/> </target>





Pingback: Gaia Framework - Creación y compilacion de un proyecto sin Flash | Desarrollo Flash
Excelente guia , me has ahorrado muchos quebraderos de cabeza
.
El problema que tengo es que dentro de un fla tengo objetos en la libreria y ant me da un error de llamada a un metodo no definido
¿Como se puede solucionar esto? Supongo que habra alguna manera de compilar con ant y poder usar objetos de la libreria.
Gracias por todas tus guias, muy utiles.
Excelente guia , me has ahorrado muchos quebraderos de cabeza
.
El problema que tengo es que dentro de un fla tengo objetos en la libreria y ant me da un error de llamada a un metodo no definido
¿Como se puede solucionar esto? Supongo que habra alguna manera de compilar con ant y poder usar objetos de la libreria.
Gracias por todas tus guias, muy utiles.
mail correcto: pepe.carnicero@gmail (el formulario no acepta ‘.’ en el campo mail)
Hasta donde yo se no se pueden abrir ficheros flash a no ser que tengas la herramienta de Adobe, creo que la solución pasaria por meter esos objetos en una libreria swc y compilarlo despues con ant.