Hi Ray,

Don't use isinited - it's an internal API and subject to change.  It looks like 
inited is set to true _after_ init() and oninit are sent.  Try listening for 
the oninited event, e.g.:

>     <handler name="oninited" args="v">
>       Debug.debug("isinited",this.isinited);
>       Debug.debug("inited",this.inited);
>     </handler>


On Oct 20, 2010, at 9:20 PM, [email protected] wrote:

> Hi, Max
>      Sometimes, I use isInited to decide whether or not the object has 
> finished initialization. But this is an internal attribute. So, I want to 
> switch to inited that is a opening attribute defined in node. But when I use 
> inited, inited is false, however, at the same time,isInited is true.
>      So, I write a tiny test case as below:
> 
> <canvas width="100%" height="100" bgcolor="green" debug="true">
>   <view name="test">
>     <handler name="oninit" args="v">
>       Debug.debug("isinited",this.isinited);
>       Debug.debug("inited",this.inited);
>     </handler>
>   </view>
> </canvas>
> 
> The result is isinited is true, inited is false.
> 
> Now, I am confused about these two attributes. Is this a bug? or what is the 
> correct usage?
> 
> Can you give me some guidance?
> 
> 
> Thanks
> 
> -Ray

Reply via email to