Archive

Archive for August, 2003

Array.getIndex

August 25th, 2003 Comments off

This is a method extension of the Array ActionScript object for getting the index of a given string or value.

Array.prototype.getIndex = function (myValue){
for (var i=0; i < this.length; i++){
if (this[i] == myValue){
return i;
}
}
return 0;
}
Categories: Uncategorized Tags:

Flash & Mozilla

August 14th, 2003 Comments off

I made a Flash application that gets xml data from a “DocStorage” .NET web service. When the app first loads, it attempts to load an xml file by calling the “get” .Net web service associated with the DocStorage application. The app was developed on Win XP using IE6 and performs well. On MacIE5 the app functions correctly. Using Flash Player 6,0,79,0 in Mozilla on Windows, however, the browser pops up a request for name and password. Using my microsoft windows credentials gets me past this. It otherwise works as designed. This is very strange.

Categories: Uncategorized Tags:

XML preloading?

August 14th, 2003 Comments off

From what I can find out, there is no way to show progressivly how much an XML file has loaded into Flash. It seems that the Flash player freezes while the loading is taking place and the percentage jumps from 0 to 100. This is unfortunate.

Categories: Uncategorized Tags:

Image validation

August 14th, 2003 Comments off

I recently stumbled across a “feature” of the getBytesLoaded() function. If you load a jpeg or swf into a movieclip and the URL is bad, the output window will display an error. However, the user viewing the swf outside of Flash (in the browser) does not see the error report. The movie will continue, but the getBytesLoaded() call on that movieclip will return -1. This is useful I think if you are loading images dynamically and want some sort of error handling mechanism in the case that a bad URL was used.

Categories: Uncategorized Tags:

FlashVars

August 13th, 2003 Comments off

The best method I have found for passing external variables to a Flash object on startup is FlashVars (see link to technote below). For example, I built a graphing application that takes it’s data as xml input from a .NET web service. I made the URL of the web service a variable that is passed into Flash when it is loaded. That way I can reuse the graphing application for different data sets. This also opens the door for dynamically delivering graphs since the HTML page can be built on-the-fly.

http://www.macromedia.com/support/flash/ts/documents/flashvars.htm

Categories: Uncategorized Tags: