I've been declaring classes extending MovieClip as dynamic. Using this to
get the child seems to work.

this.fullScreen;

And to get the object to cast to the proper type, I've had to have it in the
code.

FullScreen;
trace(this.fullScreen); //should trace [object FullScreen]

FYI, I've been using swc's to load MovieClips from Flash CS3. Things may
behave differently when working entirely in Flash CS3.

Also, I get namespace issues when I declare empty variables with movieclips
that already have instances of those objects. I mean essentially declaring
MovieClip extensions the old school way doesn't appear to work.

H

On 7/12/07, Sunil Jolly <[EMAIL PROTECTED]> wrote:

Does that work? I'm getting a namespace conflict.

Sunil

-----Original Message-----

Thanks all, I ended up with something like this...

package com.foo.view.playerSkins {

    import flash.display.MovieClip;
    import com.sky.view.playerSkins.*;

    public class SkinInventory extends MovieClip{

        private var fullscreen:MovieClip;

        public function SkinInventory()
        {
            _init();
        }

        private function _init():void
        {
            fullscreen = getChild(this, "fullScreen");
            fullscreen = (fullscreen as FullScreen);
        }

        public function getChild(stage, _name:String):MovieClip
        {
            return stage.getChildByName(_name);
        }
    }
}

On 7/12/07, Sunil Jolly <[EMAIL PROTECTED]> wrote:
>
> Hi Matt,
>
> AS3 is slightly different.
>
> You need to say:
> private var fullScreen_mc:MovieClip = getChildByName("fullscreen");
>
> Note that the reference (fullscreen_mc) can't be the same as the name
on
> the stage ("fullscreen"). Also in AS3 you can actually set instance
> variables outside of functions.
>
> I'm quite new to AS3 so I'd be interested if there's another way to do
> this. I haven't really worked out a good naming convention for this
yet
> either - anyone have any ideas?
>
> Sunil
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to