all groups > flash actionscript > april 2004 >
You're in the

flash actionscript

group:

Simple DataSet...



Simple DataSet... ShimiGates
4/16/2004 10:54:58 PM
flash actionscript: whats wrong ewith this simple code?

var myDS = new DataSet();
myDS.addItem({FirstName:"Mike",LastName:"John"});
trace(myDS.length)

im getting "undefined"...
Re: Simple DataSet... Pea
4/17/2004 4:42:59 AM
Hi

It totally depends on what your 'DataSet' object is. It doesnt look like a
predefined flash class, so must be your own custome class?

If so, please note that the .length property only returns the length of a
string or an array.

Inside your dataSet object you must be storing the items in an array? Say
this array was called 'items', then the correct code would be:

myDS.items.length

Hope it helps,
Pea
Re: Simple DataSet... Pea
4/17/2004 4:44:43 AM
Another thought...

Or if 'length' is a custom method of your DataSet class, then you must use brackets:
myDS.length();

Cheers,
Re: Simple DataSet... ShimiGates
4/17/2004 9:22:40 AM
AddThis Social Bookmark Button