[Project_owners] Re: methods and fields in XBL bindings

Michael Vincent van Rantwijk some at universum.org
Mon May 2 18:07:06 EDT 2005


Philip Chee wrote:
> Flashbock uses userContent.css to bind flash objects to our XBL.
> We are trying to refactor the XBL but are running into several errors.
> However the errors don't ALWAYS occur, only about 50% of the time.
> 
> In our test XBL we have the following:
> 
> <binding id="flash">
>   <implementation>
>     <field name="test">
>       "test"
>     </field>
>     <method name="block">
>       <parameter name="type" />
>       <body>
>         <![CDATA[
> //...some code to do our bit.
>         ]]>
>       </body>
>     </method>
> 
>     <constructor>
>         this.block("flash");
>     </constructor>
>   </implementation>
> </binding>
> 
> The JS error we get is "this.block is not a function", however putting some
> alert boxes I find that SOMETIMES it's undefined, sometimes it works as
> expected.  Similarly the "test" field is sometimes undefined and sometimes
> returns the expected value.  What am I doing wrong?
> 
> Phil

Did you check 'this' as in this.localName to see what it is?


More information about the Project_owners mailing list