Re: [flexcoders] Re: Binding using as3

2013-01-31 Thread Alex Harui
It will be faster if you just hand-code the equivalent of:
[Bindable] private var _y:int
as:
private var __y;
private function get _y():int
{
return __y;
}
private function set _y(value:int):void
{
if (value != __y)
{
__y = value;
dispatchEvent(new Event(“_yChanged”));
}
}

Then whocares() can be coded like this:

  private function whocares():void
{
var vtiA:MyTextInput = new MyTextInput;
   addEventListener(“_yChanged”, function(e:Event) {vtiA.x = 
event.target[“_y”]);
vtiA.x = _y
}

On 1/31/13 7:29 AM, "Paul A."  wrote:






On 31/01/2013 15:13, aceoohay wrote:
> Paul,
>
> BTW I did try BindingUtils.bindProperty(vtiA,"x",this,"_y"); and it did not 
> seem to work for me. It recognized _y as it required that I change it to a 
> public variable.

I was suprised that you were binding a private variable - that only
makes sense if your code is sitting inside that class.

I don't know the context of this, but if you had a setter, you might be
able to do the same as when binding.

I have to say that _y is a bit confusing since y is the natural public
accessor for a private variable _y and y is the actual position of an
element and _y seems to be something else!

>
> --- In flexcoders@yahoogroups.com  , 
> "Paul A."  wrote:
>> On 30/01/2013 23:17, aceoohay wrote:
>>> I have customized textinput control with a property of x. In my program I 
>>> instntiate the control as vtiA. My program has a bindable variable called 
>>> _y.
>>>
>>> I would like everytime that _y is changed by my program that the property x 
>>> of the control vtiA reflects the new values.
>>>
>>> What I have done that does not work is
>>>
>>> [Bindable] private var _y;
>>>
>>> private function whocares():void
>>> {
>>>   var vtiA:MyTextInput = new MyTextInput;
>>>   vtiA.x = _y
>>> }
>>>
>>> If this were mxml I would just say
>>>
>>>
>>>
>>> What is the equivalent in as3?
>> This might point you in the right direction:
>>
>> http://stackoverflow.com/questions/966047/flex-3-dynamic-creation-and-binding-of-textinput
>>
>>
>>> Paul
>>>
>>>
>>>
>>> 
>>>
>>> --
>>> Flexcoders Mailing List
>>> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>>> Alternative FAQ location: 
>>> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
>>> Search Archives: 
>>> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>>>
>>>
>>>
>>>
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>






--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] Re: Binding using as3

2013-01-31 Thread Paul A.
On 31/01/2013 15:13, aceoohay wrote:
> Paul,
>
> BTW I did try BindingUtils.bindProperty(vtiA,"x",this,"_y"); and it did not 
> seem to work for me. It recognized _y as it required that I change it to a 
> public variable.

I was suprised that you were binding a private variable - that only 
makes sense if your code is sitting inside that class.

I don't know the context of this, but if you had a setter, you might be 
able to do the same as when binding.

I have to say that _y is a bit confusing since y is the natural public 
accessor for a private variable _y and y is the actual position of an 
element and _y seems to be something else!

>
> --- In flexcoders@yahoogroups.com, "Paul A."  wrote:
>> On 30/01/2013 23:17, aceoohay wrote:
>>> I have customized textinput control with a property of x. In my program I 
>>> instntiate the control as vtiA. My program has a bindable variable called 
>>> _y.
>>>
>>> I would like everytime that _y is changed by my program that the property x 
>>> of the control vtiA reflects the new values.
>>>
>>> What I have done that does not work is
>>>
>>> [Bindable] private var _y;
>>>
>>> private function whocares():void
>>> {
>>>   var vtiA:MyTextInput = new MyTextInput;
>>>   vtiA.x = _y
>>> }
>>>
>>> If this were mxml I would just say
>>>
>>>
>>>
>>> What is the equivalent in as3?
>> This might point you in the right direction:
>>
>> http://stackoverflow.com/questions/966047/flex-3-dynamic-creation-and-binding-of-textinput
>>
>>
>>> Paul
>>>
>>>
>>>
>>> 
>>>
>>> --
>>> Flexcoders Mailing List
>>> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>>> Alternative FAQ location: 
>>> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
>>> Search Archives: 
>>> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>>>
>>>
>>>
>>>
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>



[flexcoders] Re: Binding using as3

2013-01-31 Thread aceoohay
Paul,

BTW I did try BindingUtils.bindProperty(vtiA,"x",this,"_y"); and it did not 
seem to work for me. It recognized _y as it required that I change it to a 
public variable.

--- In flexcoders@yahoogroups.com, "Paul A."  wrote:
>
> On 30/01/2013 23:17, aceoohay wrote:
> > I have customized textinput control with a property of x. In my program I 
> > instntiate the control as vtiA. My program has a bindable variable called 
> > _y.
> >
> > I would like everytime that _y is changed by my program that the property x 
> > of the control vtiA reflects the new values.
> >
> > What I have done that does not work is
> >
> > [Bindable] private var _y;
> >
> > private function whocares():void
> > {
> >  var vtiA:MyTextInput = new MyTextInput;
> >  vtiA.x = _y
> > }
> >
> > If this were mxml I would just say
> >
> > 
> >
> > What is the equivalent in as3?
> 
> This might point you in the right direction:
> 
> http://stackoverflow.com/questions/966047/flex-3-dynamic-creation-and-binding-of-textinput
> 
> 
> >
> > Paul
> >
> >
> >
> > 
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Alternative FAQ location: 
> > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> > Search Archives: 
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
> >
> >
> >
> >
>




[flexcoders] Re: Binding using as3

2013-01-31 Thread aceoohay
Paul, 

Thanks for the links. I looked at them, and followed their links, but 
everything seemed to point to two complex objects. What I have is a simple 
object, a string, that when it is updated, I need the new value to be "pushed" 
to the property of a complex object, a custom textinput component, so that the 
next time a method of that object is fired, it will know of the changed value.

Paul

--- In flexcoders@yahoogroups.com, "Paul A."  wrote:
>
> On 30/01/2013 23:17, aceoohay wrote:
> > I have customized textinput control with a property of x. In my program I 
> > instntiate the control as vtiA. My program has a bindable variable called 
> > _y.
> >
> > I would like everytime that _y is changed by my program that the property x 
> > of the control vtiA reflects the new values.
> >
> > What I have done that does not work is
> >
> > [Bindable] private var _y;
> >
> > private function whocares():void
> > {
> >  var vtiA:MyTextInput = new MyTextInput;
> >  vtiA.x = _y
> > }
> >
> > If this were mxml I would just say
> >
> > 
> >
> > What is the equivalent in as3?
> 
> This might point you in the right direction:
> 
> http://stackoverflow.com/questions/966047/flex-3-dynamic-creation-and-binding-of-textinput
> 
> 
> >
> > Paul
> >
> >
> >
> > 
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Alternative FAQ location: 
> > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> > Search Archives: 
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
> >
> >
> >
> >
>