I'm trying to embed an x number of symbols with this:
[Embed(source='graphics/backgrounds.swf', symbol='background01')]
private var Background01 : Class;
the problem is that i have like 100 background symbols and would like to embed them without writing every single one like the code below here:
[Embed(source='graphics/backgrounds.swf', symbol='background01')]
private var Background01 : Class;
[Embed(source='graphics/backgrounds.swf', symbol='background02')]
private var Background02 : Class;
[Embed(source='graphics/backgrounds.swf', symbol='background03')]
private var Background03 : Class;
instead i would like to use 2 loops like this:
for (var i = 0;i < 10;i++)
{
for (var j = 0;j < 10;j++)
{
[Embed(source='graphics/backgrounds.swf', symbol='background' + i + j )]
// code for adding this to an 2d-array or something
}
}
this wont work because it tells me that the meta data is wrong so my question is:
Is it possible to do this? or is there a similar way to do this?