Yeah, you could do arrays, something like this:

[Embed('myimage1.png')]
private var myimage1:Class;

[Embed('myimage2.png')]
private var myimage2:Class;

public var myimages:Array = [myimage1, myimage2];

In fact, I wrote a PHP script to generate just this kind of stuff once.
You'd point the PHP script at a folder and it would create an SWF that
contained all of the assets in that folder embedded and retrievable by
filename. The PHP script just automated the process above, with the addition
of some API that used a dictionary to associate filenames with the asset
classes.

I discuss it in more detail on my blog, http://troygilbert.com/.

Troy.


On Jan 29, 2008 12:00 PM, lytvynyuk <[EMAIL PROTECTED]> wrote:

>   Thank you Troy for answer, what about arrays of embedded images, It
> will be nice to refer via index, what do you think, is it possible?
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, "Troy
> Gilbert" <[EMAIL PROTECTED]>
> wrote:
> >
> > That piece of code should be giving you a warning... I don't think
> you can
> > bind to static instances because the binding mechanism uses an object as
> > it's root, and in the case of a static there is no object.
> >
> > This is one situation where a Singleton is a "good thing" and is the
> reason
> > (I believe) why Cairngorm and other similar MVC architectures use a
> > singleton for their ModelLocator instead of statics.
> >
> > I got bit with exactly the same issue. Just make your class a
> singleton and
> > it'll all work out.
> >
> > Troy.
>
>  
>

Reply via email to