you need to use the id
of the object, or pass the object reference instead of just its id
to the event handler. In the example you have given the id
is anything
. Make sure this is unique for each object instance in the MXML.
One option is to directly refer to the stage instance. The code will be like this
protected function click_Handler(s:String){
anything.width ="xx" ;
}
The other option is to pass either the event object (which is a good practice) or at least the target object to event handler, and use that. The code will be like this:
<s:Button x="240" id="anything" y="80" label="User 4" click="click_Handler(event)" />
protected function click_Handler(e:Event){
((DisplayObject)(e.currentTarget)).width = "xx"
}