I try to use some of the OOP.
function Tag(name, value, x, y){
this.name = name;
this.value = value;
this.x = x;
this.y = y; }
var star = new Tag( 'sun', 29, 10, 10);
var cube = new Tag('cube', 101, 10, 20);
var circle = new Tag('red ball', 50, 10, 20);
now how would i create a loop that will scan all the objects that created and do sotmthing like that:
for (obj in object.Tag)
{
alert (obj.name);
}
thank you
MOD EDIT: When posting code...USE CODE TAGS!!!
This post has been edited by JackOfAllTrades: 14 October 2010 - 03:31 PM

New Topic/Question
Reply



MultiQuote




|