I was wondering i can call an as3 function defined in script from mxml code just like this:
<mx:Line x="translateX(xmin);" .. >
<mx:Script>
<![CDATA[
// do some basic math
private function translate ...
If not possible do i have to convert everything to as3 ?
Thanks
Best Answer
You can but a straight-up function call like that needs to go into an event attribute in MXML, i.e. "when this event is dispatched, invoke this function." The classic example being:
You can use a function as you have illustrated above provided that it's in a binding expression and the arguments passed to the function are bindable: