Thanks Pat,
Sorry I used a bad example earlier, yes I could do that with events but 
I meant like using it in other properties that
"event" is not available. .

Here's a better example situation where I'd wish for a shortcut "self" 
reference to each component.
For example if I wanted to assign the current component's height in a 
Binding expression for the current component's width property.

<mx:CheckBox width="{self.height}" />


-- Keith H --
www.keith-hair.net




Pat Buchanan wrote:
>
> Keith:
>
> Sorry, hit send to quick and forgot to mention that I you don't need 
> the binding brackets anyway, because a Click event is not bound but 
> called on each click.  See my first example.
>
>
> On Sat, Nov 15, 2008 at 5:41 PM, Pat Buchanan <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     Hello Keith!
>
>     Try this:
>
>     <mx:Button label="Hello" click="trace(event.target.label)"/>
>
>     so in your case, it might look something like this.  You might
>     need to cast.
>
>     <mx:CheckBox click="{someComponent.prop=event.target.selected}" />
>
>     event.target will point to the component that was clicked.
>
>     Thanks
>     -Pat
>     www.DataNotion.com <http://www.DataNotion.com>
>     Information By Design
>
>
>
>
>     On Sat, Nov 15, 2008 at 12:30 PM, Keith <[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
>
>         Is there a shortcut way to reference the current component
>         that you are
>         using Binding Brackets with in its tags without using "id" ?
>         Like using "this" but it would be for the current component
>         instead of
>         the class of the MXML file.
>
>         I just feel it's redundant and tiresome when I have to retype
>         the id of
>         the component.
>         This would help in situations where it's not necessary for me
>         to bother
>         giving the component an "id".
>
>         Currently I do:
>         <mx:CheckBox id="myCB"
>         click="{someComponent.prop=myCB.selected}" />
>
>         I don't want to use "this":
>         "this" is a reference to the class of the MXML.
>         <mx:CheckBox click="{someComponent.prop=this.selected}" />
>
>         -- Keith H --
>         www.keith-hair.net <http://www.keith-hair.net>
>
>
>
>  


Reply via email to