Flex: Security Error Accessing URL Part 2

I previously encountered this error when I was working only within my own development box (laptop actually) and I basically worked around the error. But now, I need my Flex Web Service client separate from my Web Service. when you are in this situation, you need to have a crossdomain.xml file in your host’s root directory:

<cross-domain-policy>
<site-control permitted-cross-domain-policies=”master-only”/>
<allow-access-from domain=”yourdomain”/>
<allow-http-request-headers-from domain=”yourdomain” headers=”*”/>
</cross-domain-policy>

And if the host is a secure/HTTPS server, you just need to add the secure attribute:

<cross-domain-policy>
<site-control permitted-cross-domain-policies=”master-only”/>
<allow-access-from domain=”yourdomain” secure=”false”/>
<allow-http-request-headers-from domain=”yourdomain” headers=”*” secure=”false”/>
</cross-domain-policy>

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!

 

Buffalo LinkStation Live

I finally got my LinkStation back from the shop. Only, it’s now a Linkstation Live. Here’s how it happened: A few months ago my CD-R King HDD enclosure died when it suffered a workplace accident. To replace it, I bought a Buffalo LinkStation Pro. But after a only few months, it conked out (Lesson Learned: Do not store important data in these unreliable drives!).

Fortunately,  it was still under warranty so I asked James to return it to the shop for repairs. After a few weeks, the shop told us it can no longer be repaired and that they’re sourcing a replacement unit. After a few more weeks, they still couldn’t find a replacement unit. After repeated phone calls by James, they eventually decided to replace with the newer LinkStation Live.

Read More

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