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

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hans
Wichman
Sent: 12 July 2007 15:34
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Accessing MovieClips on a timeline from an
AS3 class

Hi,
reserver keyword maybe?
greetz
JC


On 7/12/07, Matt Muller <[EMAIL PROTECTED]> wrote:
>
> I feel like a bit of an idiot asking this, but I keep getting errors.
I'm
> creating some custom player skin templates and have some ui elements
which
> are MovieClips on the stage.
> Bearing in mind, this will be a swf loaded into another swf all I'm
trying
> to do is create class definitions and its throwing errors.
>
> in as2, it would normally be something like name your instance on
stage
> 'btn_fullScreen' and then in the class just type it to have access to
it.
> private var btn_fullScreen:MovieClip;
>
> So in the document class I have something like this (as3) with a
MovieClip
> with a matching instance name "fullScreen"  thats on the
stage/timeleine
> but
> its clashing when I try and access it from the class.
>
> and I get this error when I try to trace it.
>
> 1151: A conflict exists with definition fullScreen in namespace
internal.
>
> package com.foo.view.playerSkins {
>
>    import flash.display.MovieClip;
>
>    public class SkinInventory extends MovieClip{
>
>        private var fullScreen:MovieClip;
>
>        public function SkinInventory()
>        {
>            trace(fullScreen)
>        }
>    }
> }
>
> Any ideas??
>
> thanks
>
> matt
> 
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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