Archive

for the Geek Category

Custom URLLoader with timeout.

I came across an issue yesterday loading ads from ad.doubleclick.net. For some reason, the crossdomain.xml file from ad.doubleclick.net was unavailable and the URLLoader class making the call eventually threw a Security Error, as the crossdomain policy is the first thing it looks for when making calls outside the SWF’s Security Domain.
This is easily handled [...]

Read on

What I learned today: setting up svn externals.

Pretty straightforward stuff. It’s a simple propedit call,
propedit svn:externals ., where ‘.‘ is the directory’s property you would like to edit.
I’ve been adding external library linkage to the top-level directory in the repository to keep everything in the same place, but it really doesn’t matter where you add your external links.
The link in [...]

Read on

Last resort.

Feeling disconnected from the rest of the Internet because of Twitter being down, I resorted to updating my Facebook status manually with a quick message about now being able to Tweet about Twitter being down, only to receive this error message:
Transport error (#1001) while retrieving data from endpoint `/ajax/updatestatus.php’: A network error occurred. Check [...]

Read on

ThunderBolt AS3 debugging.

I’ve been taking a look at a new (to me) debugging utility for AS3 called ThunderBolt. You can use the ThunderBolt library to send debugging info to the console in Firebug. Additionally, the ThunderBolt AS3 console is a standalone AIR app that displays all the same data without Firebug installed. At the [...]

Read on

Note to self (mxmlc compiler arguments).

Here they are. All the mxmlc compiler arguments.

table {
font-size: 9pt;
border-top:1px solid gray;
border-left:0px solid gray;
}
table td {
border-right:0px solid gray;
border-bottom:1px solid gray;
}

-benchmark
output performance benchmark

-compiler.accessible
alias -accessible
generate an accessible SWF

-compiler.actionscript-file-encoding <string>
alias -actionscript-file-encoding
specifies actionscript file encoding. If there is no BOM in the AS3
source files, the compiler will use this file encoding.

-compiler.allow-source-path-overlap
alias [...]

Read on

Standardizing runtime asset loads (incl. Runtime fonts!).

I’ve been looking for better ways to reduce the size of my main app swfs. Loading assets at runtime has proven to be a flexible solution that saves size in the initial load and throughout the use of the app, as only files essential to the current view can be loaded in. I [...]

Read on

A quick note on document.location.href

Added this to my NetUtil class for easy access to an embedded swf’s parent url.

public static function get parentUrl():String
{
if(ExternalInterface.available)
{
try
{
var parent:String = String( ExternalInterface.call(” function(){ return document.location.href.toString();}”));
return parent;
}
catch(error:Error){}
catch (error:SecurityError){}
}
return ”;
}

Just be sure you have AllowScriptAccess set to “always” in your embed params or else a Security Error will be thrown by the player.

Read on

Loading and using CSS in AS3.

I should make it a habit to post things I know I’m going to forget. For instance, here’s some info on using CSS in Flash:
Supported CSS properties

color | color
Only hexadecimal color values are supported. Named colors (such as blue) are not supported. Colors are written in the following format: #FF0000.

display | display
Supported values are [...]

Read on

Nerd humor.

Geeks,
I enjoyed reading through some of these comments. Hope you will to.
http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered-closed

Read on

Remote content loading in AS3. Phew!

I did a little research recently when trying to figure out the ins and outs of transferring content over to a CDN. Doing this should save both load time and money, but figuring out security issues with Flash content that loads from remote, sometimes unknown locations can be frustrating. Here’s what I’ve learned:
Several [...]

Read on