I'm trying to create an MXML component that is a subclass of <mx:Canvas>. I would like to provide my own implementation of mx.core.UIComponent's init() method so that I can set some default values for my custom component properties. However, when I try this (as illustrated below) I get the following odd error:
 
 
   line 52     The member name, init, may not be repeated more than once.
   line 85     The member name, init, may not be repeated more than once.
 
 
My code looks like this...
 
 
51  public function init() :Void
52  {
53      super.init();
54      // Use default property values if necessary.
55      if (selected == undefined)
56      {
57          selected = false;
58      }
59  }
 
 
Note, this code is all inline in my MXML file. My <mx:Script> block ends at line 62. Line 85 is in the middle of my MXML tags!
 
What is really causing this error? How do I resolve it? Is overriding the init() method not the best approach for setting default property values?
 
 
Kris
 
--
 
Kristopher Schultz
Developer
 
Resource Interactive
p: 614.410.2123
 


Yahoo! Groups Links

Reply via email to