General

Flex: Custom HTML Wrappers In Ant

Building Flex using ant build files is generally straightforward. Unfortunately, this is not so with using custom HTML wrappers. You cannot use the html-wrapper task since this only uses the standard templates in Flex’s html-template folder. If you want to use your own index.template.html in your own html-template folder, you will need to use a workaround:

<macrodef name=”generateHtmlWrapper” description=”Generates HTML Wrapper using custom template”>
<attribute name=”file”/>
<attribute name=”title”/>
<attribute name=”application”/>
<attribute name=”swf”/>
<attribute name=”width”/>
<attribute name=”height”/>
<attribute name=”bgcolor”/>
<attribute name=”version-major”/>
<attribute name=”version-minor”/>
<attribute name=”version-revision”/><attribute name=”template”/> <attribute name=”output”/>

<sequential>
<copy todir=”@{output}/history”>
<fileset dir=”html-template/history”/>
</copy>             
<copy file=”html-template/AC_OETags.js” todir=”@{output}”/>
<copy file=”html-template/playerProductInstall.swf” todir=”@{output}” />
<copy file=”html-template/index.template.html” tofile=”@{output}/@{file}” />

<replace file=”@{output}/@{file}” token=”$${title}” value=”@{title}”/>
<replace file=”@{output}/@{file}” token=”$${swf}” value=”@{swf}”/>
<replace file=”@{output}/@{file}” token=”$${width}” value=”@{width}”/>
<replace file=”@{output}/@{file}” token=”$${height}” value=”@{height}”/>
<replace file=”@{output}/@{file}” token=”$${bgcolor}” value=”@{bgcolor}”/>
<replace file=”@{output}/@{file}” token=”$${application}” value=”@{application}”/>
<replace file=”@{output}/@{file}” token=”$${version_major}” value=”@{version-major}”/>
<replace file=”@{output}/@{file}” token=”$${version_minor}” value=”@{version-minor}”/>
<replace file=”@{output}/@{file}” token=”$${version_revision}” value=”@{version-revision}”/>
</sequential>
</macrodef>

Thanks to Renaun Erickson for the solution!

Flex: Unable To Open Locale

When you’re working with locales in Flex, you would put in the following code in you ant build file:

<mxmlc>
<locale>it_IT</locale>
<source-path path-element=”locale/it_IT”/>
<include-resource-bundles>formlabels</include-resource-bundles> <source-path path-element=”${FLEX_HOME}/frameworks”/> <output>bin/formlabels_it_IT.swf</output>
</mxmlc>

Then when you get a puzzling error:

[mxmlc] C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\frameworks\flex-config.xml(75): Error: unable to open ‘locale/it_IT’

But don’t you have that exact directory? Well, apparently Flex is actually looking for the it_IT folder in its locale folder. The solutions is to just create an empty it_IT folder:

<macrodef name=”compileLocale” description=”Compiles the Resource package for the given locale”>
<attribute name=”locale” default=”en_US”/>
<attribute name=”outputdir” default=”bin-debug”/>
<sequential>
<!– Create the Flex Home directory for the language in question. This is necessary to compensate for a bug in pre-3.2 releases of mxmlc. –>
<mkdir dir=”${FLEX_HOME}/frameworks/locale/@{locale}”/>

<!– Invoke MXMLC –> <mxmlc> <locale>@{locale}</locale> <source-path path-element=”locale/{locale}”/> <include-resource-bundles>formlabels</include-resource-bundles> <source-path path-element=”${FLEX_HOME}/frameworks”/> <output>@{outputdir}/formlabels_@{locale}.swf</output>
</mxmlc>
</sequential>
</macrodef>

Thanks to Adobe Cookbooks for the solution!

 

Assassin’s Creed II

Assassin’s Creed II is the sequel to the love-it-or-hate-it Assassin’s Creed. I myself haven’t played the first game but from what I see one group loved it because of the huge, detailed, and history-based game world and storyline. While the other group hated it because of the dreary repetitive missions and bland cutscenes.

Read More

Certified True Copy vs Certified Xerox Copy

Here’s a puzzle. Michelle was following up with their HR regarding the requirements for claiming SSS maternity benefits and they responded with this one interesting item: Certified true copy of child’s birth certificate (Please take note: It should certified true copy and not certified xerox copy from the original).

So how do you make a true copy (by itself already an oxymoron) prior to it being certified? Apparently not by photocopying. But how else can you make a  copy? Laser printer? Doesn’t that use the same toner and drum technology? Offset printing? By hand? Really beats me. The sad thing is that this stupid bureaucratic mumbo jumbo probably have some twisted meaning somewhere.

Languages

I was cradling Jeanne when my dad, who was visiting us, suddenly started talking to her in Tagalog. I struck me how alien it sounded. It’s not that I don’t use Tagalog, it’s just that it was all Tagalog. I guess it really sounded alien to me considering that my first language is a mix of Cebuano and English (ceblish?) and my second is a mix of Tagalog and English (taglish). English, my third language, is always there in the mix. Looking back, it must have been really confusing growing up with so many languages. You get spoken to in Cebuano, English, and later Tagalog. And all the while your reading materials are all in English. Luckily, I turned out reasonably well (or did I? :P) And here I am still aspiring to learn yet another language (French).