  | |  | AS2 private methods/properties in extended classes | AS2 private methods/properties in extended classes
2004-02-17 - By Keith Peters
Back AS 2.0 compiles down to AS 1.0.
In AS 1.0, there is no such thing as public/private.
All that is really happening is that the compiler is doing its best to
enforce it during compilation.
But there are ways around it, and once you start doing things
dynamically at run time, private doesn 't exist.
kp
> -- --Original Message-- --
> From: arzach [mailto:list@(protected)]
> Sent: Tuesday, February 17, 2004 10:08 AM
> To: flashcoders@(protected)
> Subject: Re: [Flashcoders] AS2 private methods/properties in
> extended classes
>
>
> right now i 'm getting a bit confused with the usage of private. i 'm
> building a component like a window, and i can pass values to private
> vars using an object during the attachMovie. So, private var
> seems to be
> Private just if you try to reach them in an instance of the class. So
> private doesn 't means that you can 't read or change them at all.
>
>
>
> Emile Swain wrote:
>
> >Class mysuper extends MovieClip
> >{
> > private var member:String = "test "
> >}
> >
> >Class mybase extends mysuper
> >{
> >
> > function mybase (Void)
> > {
> > trace( "my member is " + member)
> > }
> >
> >}
> >
> >
> >in my example(note I just typed this quickly so ignore errors) a
> >private variable member is accessible by mybase (which extends
> >mysuper). Now is this as it should be? I thought that private was
> >supposed to keep properties/methods internal to the class
> rather than
> >public? Or is this a special case for when your extending classes.
> >
> >
>
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
> -- ------
> Supported by Fig Leaf Software
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
> -- ------
> Be sure to check the archives and the wiki:
> http://chattyfig.figleaf.com/
>
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
> -- ------
> http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104454
> =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
> -- ------
> To unsubscribe send a blank e-mail to:
> Normal Mode: flashcoders-unsubscribe@(protected)
> Digest Mode: flashcoders-digest-unsubscrive@(protected)
>
>
>
>
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:104497
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|
 |