Changed Files In Subversion Repo

We have a client here who manages there own web server and website deployment, but they rely on us to develop and update their site as needed. For this reason, they prefer to receive updates to their site in patch-like zip files. On our end we mange this project with a combination of Unfuddle, SVN and a staging server that mimics their server environment. When it comes time to release code it can be a bit confusing for us which files the client will need for a particular update. We rely on SVN to help.

First, we determine at which revision in the repository the updates began. We do this by referencing associated changesets inside Unfuddle (Side note; Unfuddle is a fantastic project management and source control tool that we recommend checking out.) Then, it’s just a matter of grabbing a diff from this changeset to the HEAD. From the command line, do (Where “XX” is, of course, the revision our changes start at. In doubt, we err on the side of more files than necessary.):

$> svn diff -r XX:HEAD --summarize>~/Desktop/diff.txt

This dumps a summary of the affected files into a text file on the desktop. From there we go down the list and compile our patch for the client. Easy.

Actionscript in IE getBytesTotal( ) gotcha

With a recent update either in IE8 or within the Flash Player, I noticed a lot of our AS2 Flash sites that load external assets were failing; either the asset wouldn’t load or it wouldn’t properly report its EVENT_LOADED event. It was happening sporadically, and usually when a lot of external assets were being loaded at the same time.

When I looked into this further I found this line of code within the “run” function that executes on an interval:

if (mc_clip.getBytesTotal( ) < 0)
{
        // failed to load
        bool_isLoaded = false;
        clearInterval( int_interval );
        dispatchEvent( new Event( this, EVENT_FAILED ) );
}

To fix it, I simply added a counter. It now checks to see if getBytesTotal( ) returns negative 10 times before finally reporting EVENT_FAILED.

However, in IE, mc_clip.getBytesTotal( ) is returning a negative number - even though the clip exists and is still loading!

Updating this code to include a wait counter to make sure this the number is still negative after 10 tries seems to have fixed it.

if (mc_clip.getBytesTotal( ) < 0)
{
    if (int_wait > 10)
    {
        // failed to load
        bool_isLoaded = false;
        clearInterval( int_interval );
        dispatchEvent( new Event( this, EVENT_FAILED ) );
    }
    int_wait++;
}