Smooth scrolling TextField in ActionScript 3.0 with TweenMax from Greensock

Flash My Mind has a tutorial on how to make a blurred scrollbox in Flash with little help from Greensock/TweenMax. It can be used to scroll TextFields and other content. The tutorial can be found here.

In case your content doesn’t scroll all the way back up, I found that this piece of code helps to work things out:

var target:Number = ((myContent.height * 1.2 - myMask.height) * percentage) - myMask.y;

So, multiply your content’s height with 20 % or something like that. It gives you a little bit of margin so you might experiment with this number. Then, instead of adding the y position of the mask to the target number, subtract it.

This did the trick for me!

Adobe Flash CS5 font issues with Mac

I look forward to the day Adobe fixes the font issues in Adobe Flash CS5. When working across platforms (PC/Mac) the font issue causes problems in layouting, which is very annoying as you  either have to see a faulty layout or mess up the fonts on the other platform when changing your own. Also, copying text fields makes them behave weirdly, even when on the same machine and the same file. This does not seem to get better if using TLF text fields either. I was hoping an update to the program would address this issue but alas, it did not. I think this issue arises when using custom embedded fonts.

However, this makes work much harder! I would really appreciate a solution to this problem!

Customizing the seek bar for an FLVPlayback component

The documentation is very vague on how to customize the seekbar/progress indicator for the FLVPlayback component and Google searches return few hits on how to actually do it with the provided component. There’s a good blog post about it here, that actually explains the procedure. In case it ever disappears, here’s my own note on the subject.

Step 1: Start by creating a new layer between the assets and progress layers, and call it something, i.e. “play progress”.

Step 2: Create a new MovieClip that is as long as you want it to be when the video has completed, and name that MovieClip fullness_mc.

Step 3: Remove or hide (by making the layer a guide) the progress indicator MovieClip.

If you’re creating a custom FLV player, assign the seek bar to the playback component with this line of code:

player.seekBar = mySeekBar;

player being the playback instance and mySeekBar being the seek bar instance. And make sure not to add the code line twice, which made it not work for me.

And this is the final result:

Additional step: To make navigation quicker and to allow for the user to click on the seek bar to fast forward the video (instead of trying to hit the blue handle below the seek bar), create a new layer called hit area and add a MovieClip with the instance name hit_mc so that it covers the fullness_mc MovieClip. Set the alpha of the hit area to zero, and then the user can click to go forward and backward. In case you want a hand/button indicator, add this.buttonMode = true to the scripts layer.