RE: [Flashcoders] Automatically Declare Stage Instances andinheritance.

2008-05-12 Thread Cor
This will do the trick:

private var okButton:SimpleButton = getChildByName('okButton') as
SimpleButton;

 

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Meinte van't Kruis
Verzonden: zondag 11 mei 2008 12:54
Aan: Flash Coders List
Onderwerp: Re: [Flashcoders] Automatically Declare Stage Instances
andinheritance.

If you want to have the flexibility of not having to define it, you can
always make the class dynamic

On Sun, May 11, 2008 at 12:42 AM, Chris [EMAIL PROTECTED] wrote:

 Ok, so I've done a bit of googling and found nothing. And the mailing 
 lists search features are less than ideal (sorry). Apologies if this 
 has been gone over before:

 I have created an example problem here:
 http://ubergeek.tv/inheritance_declare_problem.zip

 The inheritanceDemo.fla shows that classes linked to symbols that 
 extend class with items on the timeline  causes a compiler error:

 1152: A conflict exists with inherited definition AlertBase.okButton 
 in namespace public. 

 While if I uncheck the 'Automatically Declare Stage Instances' 
 checkbox and declare my okButton manually everything works.

 This seems like a big deal to me. Since we re-use code as much as 
 possible, it seems like we either need to assume this box is checked 
 or not and base our code on this. Additionally we can assume 
 incompatibilities with 3rd party code based upon whether they checked 
 this box. It would seem that this checkbox shouldn't exist and that 
 all stage vars should be declared manually.

 I must be doing something wrong. What are the best practices here? 
 Besides unchecking that box, is there any way to get around these errors?

 Thanks
 Chris Hill

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
M.A. van't Kruis
http://www.malatze.nl/

No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 269.23.15/1426 - Release Date: 5/10/2008
11:12 AM

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Automatically Declare Stage Instances andinheritance.

2008-05-12 Thread Chris
Thanks for the tips.

I think unchecking that box is the best way to handle this, but the other
options presented are useful for working around these issues.

My main worry seems to be incompatibilities with people who may write code
using the box checked, which it is by default. It seems that this checkbox
forks all AS3 code into two exclusive camps. I hope I make the right choice.
:(

C



On Mon, May 12, 2008 at 3:58 AM, Cor [EMAIL PROTECTED] wrote:

 This will do the trick:

 private var okButton:SimpleButton = getChildByName('okButton') as
 SimpleButton;



 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Namens Meinte van't
 Kruis
 Verzonden: zondag 11 mei 2008 12:54
 Aan: Flash Coders List
 Onderwerp: Re: [Flashcoders] Automatically Declare Stage Instances
 andinheritance.

 If you want to have the flexibility of not having to define it, you can
 always make the class dynamic

 On Sun, May 11, 2008 at 12:42 AM, Chris [EMAIL PROTECTED] wrote:

  Ok, so I've done a bit of googling and found nothing. And the mailing
  lists search features are less than ideal (sorry). Apologies if this
  has been gone over before:
 
  I have created an example problem here:
  http://ubergeek.tv/inheritance_declare_problem.zip
 
  The inheritanceDemo.fla shows that classes linked to symbols that
  extend class with items on the timeline  causes a compiler error:
 
  1152: A conflict exists with inherited definition AlertBase.okButton
  in namespace public.
 
  While if I uncheck the 'Automatically Declare Stage Instances'
  checkbox and declare my okButton manually everything works.
 
  This seems like a big deal to me. Since we re-use code as much as
  possible, it seems like we either need to assume this box is checked
  or not and base our code on this. Additionally we can assume
  incompatibilities with 3rd party code based upon whether they checked
  this box. It would seem that this checkbox shouldn't exist and that
  all stage vars should be declared manually.
 
  I must be doing something wrong. What are the best practices here?
  Besides unchecking that box, is there any way to get around these
 errors?
 
  Thanks
  Chris Hill
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 


 --
 M.A. van't Kruis
 http://www.malatze.nl/

 No virus found in this incoming message.
 Checked by AVG.
 Version: 8.0.100 / Virus Database: 269.23.15/1426 - Release Date:
 5/10/2008
 11:12 AM

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders