Groups | Blog | Home
all groups > flash (macromedia) > march 2005 >

flash (macromedia) : array.length doesn't work


Flash Gordon
3/3/2005 6:30:50 PM
You haven't told it to make the array yet! Just add a line at the beginning:

myarr = new Array();
myarr[0]='test';
myarr[1]='test2';
trace(myarr.length);

Should do it.

- Jeremy

[quoted text, click to view]

meltedown
3/3/2005 10:37:50 PM
myarr[0]='test';
myarr[1]='test2';
trace(myarr.length);

This is the only code in a movie.
the result is "undefined"

meltedown
3/3/2005 11:38:50 PM
[quoted text, click to view]

OK , yes, thanks.
It looked like the code I copied didn't have an initializer either, but
it turns out this creates an array:
_root.arrFilenames =
mvcFileData.objFileData.strFilenames.split(mvcFileData.objFileData.strDelimChar);
AddThis Social Bookmark Button