views:

152

answers:

1

I've embedded a MovieClip symbol with the [Embed] syntax into my AS3 project, which I'm compiling with the Flex 3 SDK. That MovieClip has instances of other clips within it that are placed on stage with instance names. I can't just access them by instance name like I would if I were compiling with the Flash IDE.

How can I reference them?

A: 

you need to both give them instance names in the IDE and declare them in the class you've embedded them on.

So say that you have instances of baz and frr on your embedded class InfoPopup, you need to declare them like this:

package foo {

    import flash.display.Sprite;    

    [Embed(source='../../../../../../assets/Assets.swf', symbol='InfoPopup')]
    public class InfoPopup extends Sprite {

        public var baz:Sprite;
        public var baz:MovieClip;

        public function InfoPopup(){
                trace("constructor!");
        }

    }

}

When added like this they have to be public properties or else the compiler will complain.

grapefrukt