Archive for the ‘Flash’ Category

FLVPlayback: Handling “Error opening URL”, Connection errors

Thursday, October 16th, 2008

I always had a problem catching file not found errors with Flash. Mainly the FLVPlayback player trying to load a file that do not exists.

Here’s how you can handle it for FLVPlayback for AS2:

import mx.video.FLVPlayback;
myFLVPlayer.addEventListener("stateChange",this);
myFLVPlayer.load("youvideofile.flv");

function stateChange() :Void {
if(myFLVPlayer.state == FLVPlayback.CONNECTION_ERROR)
//show error message
}

FLVPlayback FLV Preloader

Tuesday, October 16th, 2007

Here’s a way to Preload flv files before you play them in FLVPlayback component.

import mx.video.*;

var listenerObject:Object = new Object();

my_FLVPlybk.progressInterval = 001;
my_FLVPlybk.autoPlay = false;

listenerObject.progress = function(eventObject:Object) :Void {

var perc = Math.floor(eventObject.bytesLoaded * 100 / eventObject.bytesTotal);
//implement you loading visual representation here

if(perc == 100)
my_FLVPlybk.play();

}

my_FLVPlybk.addEventListener("progress", listenerObject);
my_FLVPlybk.load("yourflv.flv");

You can hide the player while its getting downloaded and show it when its fully downloaded. Make sure to set the autoplay option to false.

Happy coding :)

Dynamic Text and Masking in Flash

Thursday, December 15th, 2005

Ever cracked your brains out wondering why your dynamic text field does not show the text when its masked??? I have been struggling with this problem from some time now.

All you need to do is embed characters. Select character sets that you want to embed from the embed option in the text field properties. Characters that you have embeded will be shown … none others!!

Flash at snail’s pace on Firefox

Tuesday, September 20th, 2005

Yes, I am also one of those troubled souls when it comes to getting your project work cross-browser. It drives me crazy getting things to work in the exact same way on IE and Firefox.

Problem 1:
One of the flash intro’s I made ran very slowly on Firefox. It worked just perfect on IE. The intro was jerky and gave a feeling that something heavy was getting downloaded in the background.

Fix:
Remove “Transparent Windowless” option (if you have selected it) when exporting your flash movie and it will work like a charm on Firefox. Worked for me, should work for you too :)

Problem 2:
I exported a flash movie as 100% to fit perfectly to the browser and resize as and when the browser was resized. It worked just perfect on IE. In firefox the movie got loaded as a small box. It was not even the actual movie size.

Fix:
Remove the < !DOCTYPE> tag from the page where you are showing the flash movie. The movie will now fill the browser and resize as you resize your browser.