Categories

Archives

Jun01

FLVPlayback Not Playing

I just ran across an interesting bug within the FLVPlayback component in CS4.  About half the time the component wouldn't play a video I told it to play (I think its related to a combination of other classes imported in my FLA).  I tried setting just about every property I could to no avail.  I manage to track down the problem to the event model.  The video progress event would say that the entire video was downloaded, but the video complete event woudn't fire.  The workaround I came up with was to check if the video was downloaded in the progress event then fire the play command.  Its seems to have fixed my problem for now.  Hopefully you won't have to waste a few hours of troubleshooting like me.

Read More | 0 comments
May07

Orphans and Widows

If I've only learned one thing from designers, its that they hate orphans/widows.  As a flash developer I often have to work with external text and there is a good chance you'll end up with an orphan.  But I was playing with a few new AS3 TextField methods and was able to come up with a nice function to help minimize orphans.  This is far from perfect, but it should at least provide a good starting point for a more robust function.

function fixOrphan( tf:TextField ):void {
if( tf.numLines > 1 ) {
var s:String = tf.getLineText( tf.numLines-1 );

// Orphan is present, let's adopt this sucker
if( s.indexOf(" ") < 0 ) {
var tempString:String = tf.text.substring( 0, tf.text.lastIndexOf(" ") );
var firstPart:String = tempString.substring( 0, tempString.lastIndexOf(" ") );
var lastPart:String = tf.text.substring( tempString.lastIndexOf(" ")+1 )

tf.text = firstPart + "\n" + lastPart;
}
}
}
Read More | 0 comments
May02

Initial Impressions of Firefox 3.5

I've been trying Firefox 3.5 Beta 4 for about a week now and it is awesome.  It feels faster than the previous version and more stable.  Great job guys!

Read More | 0 comments
Apr30

On to Round 2

Congratulations Washington Capitals.  Its been over tens years since the Caps have advanced to the second round of the Stanley Cup playoffs and you had to comeback from a 3-1 series deficit to do it.  That just doesn't happen that often.

Read More | 0 comments