|
I never figured that out. What I do is use
the contructor in my init, so:
function initYourCanvas()
{
}
And then, in your Canvas' attributes,
do:
initialize="initYourCanvas();"
----- Original Message -----
From: Kristopher
Schultz
Sent: Monday, May 23, 2005 5:36 PM
Subject: [flexcoders] implementing init() in subclass 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?
Yahoo! Groups Links
|
- [flexcoders] implementing init() in subclass Kristopher Schultz
- Re: [flexcoders] implementing init() in subclass JesterXL
- RE: [flexcoders] implementing init() in subclass Abdul Qabiz
- RE: [flexcoders] implementing init() in subclass Matt Chotin

