List Info

Thread: MC Subclass--one last question




MC Subclass--one last question
country flaguser name
United States
2007-07-28 23:23:39
This one may truly be for FlashCoders, but there are some
pretty sharp
programmers here, so I'll ask.

Can I have a private static var in a movie clip subclass?
e.g.

class Navigator extends MovieClip
{
   private static var pages:Array = [1, 2, 3, 4, 5, 6];

I'm pretty sure I can, but how do I refer to it?
Navigator.pages ? And can I
access it in the init() function? It's showing up as
undefined, no matter
how I try to access it.

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

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

RE: MC Subclass--one last question
country flaguser name
United States
2007-07-28 23:55:13
I wrote:

> This one may truly be for FlashCoders, but there are
some pretty sharp
> programmers here, so I'll ask.
> 
> Can I have a private static var in a movie clip
subclass? e.g.
> 
> class Navigator extends MovieClip
> {
>    private static var pages:Array = [1, 2, 3, 4, 5,
6];
> 
> I'm pretty sure I can, but how do I refer to it?
Navigator.pages ? And can
I
> access it in the init() function? It's showing up as
undefined, no matter
> how I try to access it.

I don't usually answer my own posts, but I wanted to clarify
that I
understand a private static variable is accessible only
within the class or
its subclasses. I am trying to access it from the init()
function within my
Navigator class.

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

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

Re: MC Subclass--one last question
user name
2007-07-29 08:32:27
On 7/29/07, Kerry Thompson <alphacyberiantiger.biz>
wrote:
> I don't usually answer my own posts, but I wanted to
clarify that I
> understand a private static variable is accessible only
within the class or
> its subclasses. I am trying to access it from the
init() function within my
> Navigator class.

It /should/ work when you use Navigator.pages to access it.
However,
I've had a similar problem two years ago (and submitted a
bug report
-- disassembly showed it was a compiler bug).

Symptoms:

trace( Navigator.pages[ 0 ] ); // undefined
trace( (Navigator.pages)[ 0 ] ); // 1

HTH,
Mark
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

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

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )