FDT Flex [Frame(factoryClass increase your SWF size ?

Using the example of my previous post AS3 Only Preloaders, noticed that for strange reasons the size of the resulting swf grows as 130kb ..

For that reason it is, therefore, when you insert the Flex tag Frame it includes some SWC you do not really need.

1
[Frame(factoryClass="preloader.as")]

To fix this, from FDT remove the swc’s you are not referencing.

And with this our SWF’s will return to their original weight.

Eclipse FDT. Automatically embed a build control STRING.

On many occasions, it would have an interesting way to know if we have updated our flash projects, if are cached, etc …

A simple way of doing it is as follows:

We generate a file that contains our version number with a Ant build as follows:

1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0" encoding="UTF-8"?>
<project name="xxxx BUILDER" default="buildVersion" basedir="..">

    <!-- DEFAULT TARGET -->
    <target name="buildVersion" >

        <!-- include a valid filePath -->
        <buildnumber file="yourpath/buildVersion.txt"/>
    </target>

</project>

Perfect, as we build our file with a nice number that is updated every time you execute it.

Now test it, the resulting file likes that:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#Build Number for ANT. Do not edit!
#Sat Nov 29 00:00:34 CET 2008
build.number=4
[cc lang="actionscript3"]
package
{
    import flash.utils.ByteArray;

    /**
     * @author xperiments
     */

    [Embed(source="pathToYour/buildVersion.txt",mimeType="application/octet-stream")]
    public class EmbeddedVersion extends ByteArray
    {
        private var _revision : String;

        public function EmbeddedVersion()
        {
            var txtFile:String = this.toString( );
            var lines:Array = txtFile.split("\n");

            //asignamos el valor de revision
            _revision = String( lines[ 2 ].split('=')[ 1 ] );
        }

        public function getRevision( ):String
        {
            return _revision;
        }
    }
}

Now for accessing to the actual revision value.

var embedInstance:EmbeddedVersion = new EmbeddedVersion( );
var revision:String = embedInstance.getRevision( );
trace( "Revision:" + revision );

We also have to modify the compilation settings in Ant tab Options (next to the tab Compiler Arguments) to include the previous buildVersion.xml file in the “ant prebuilt file.” parameter.

Nice coding…

Firefox 3. Eliminando el borde punteado.

Para eliminar el borde punteado que aparece al clickar en enlaces y objetos flash utilizaremos el siguiente CSS:

Para los links:

1
a{ outline: none; }

Para los objetos Flash:

1
object { outline: none; }