Question

I was trying to access the layers by their names dynamically via AS3. But then I just found out there's nothing on layers in AS3 API (or I didn't search enough).

If that's true, naming layers at IDE is totally meaningless to the code?

What happens? Do they get converted to a pile of indexed DisplayObjects at runtime?

Do I always have to reference a child's index position to stack (urgh) a new child in between?

Without those named layers it all seems disorganized to me... I just hope I'm equivocated. :s

Was it helpful?

Solution

The simple answer is, yes, layer information is lost once the FLA is compiled. There is absolutely no way to get any information about them at runtime. In that regard, there's not much you can do.

Your best bet might be placing groups of objects which were once on layers into container MovieClips. You can then give those MovieClips instance names, which could easily correspond to the layer names.

Otherwise, I'm not sure there's much you can do. Unfortunately, layers are a wholly Flash IDE-specific concept, and are essentially destroyed at compile-time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top