But that's just casting - I can't think that would have a huge problem
where it wouldn't work.
I'm just not sure if a) I want to use some sort of Model or b) the
binding utils
On Apr 20, 2008, at 10:29 PM, Josh McDonald wrote:
I think you want:
"{ rep.currentItem.x }"
rather than
"{ Number(rep.currentItem.x) }"
-J
On Mon, Apr 21, 2008 at 12:18 PM, grimmwerks <[EMAIL PROTECTED]>
wrote:
Could someone PLEASE point out what I'm doing wrong in the
following? I want to bind a numeric stepper to a certain size and
have it changed live; I'm trying to change the scale of these
buttons to the numeric steppers; here's a test:
-------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%" height="100%" horizontalScrollPolicy="off"
verticalScrollPolicy="off" >
<mx:Repeater id="rep" dataProvider="{objs}">
<mx:Button x="{Number(rep.currentItem.x)}"
y="{Number(rep.currentItem.y)}"
width="{(Number(rep.currentItem.percent)*defaultSize)}"
height="{(Number(rep.currentItem.percent)*defaultSize)}"
styleName="{String(rep.currentItem.type)}"
label="{String(rep.currentItem.type).toUpperCase()}"
toolTip="{'At the moment '+ String(rep.currentItem.type)+' is
'+rep.currentItem.percent+'% of my life at the moment'}" />
</mx:Repeater >
<mx:NumericStepper id="tmp"
change="{objs.getItemAt(0).percent=tmp.value}"
value="{objs[0].percent}" maximum="100" />
<mx:Script>
<![CDATA[
import mx.controls.Button;
import mx.core.BitmapAsset;
import mx.managers.DragManager;
import mx.core.DragSource;
import mx.events.DragEvent;
import flash.events.MouseEvent;
import mx.effects.easing.*;
import mx.binding.utils.BindingUtils;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.utils.ObjectUtil;
import mx.core.Application;
private var offX:Number;
private var offY:Number;
[Bindable]
public var objs:Array = new Array({x:30, y:22, percent:20,
type:"community"},{x:90, y:22, percent:25, type:"work"},{x:110, y:
72, percent:45, type:"self"},{x:70, y:120, percent:15, type:"faily"});
[Bindable]
private var defaultSize:Number = new Number(6);
]]>
</mx:Script>
</mx:Application>
--
"Therefore, send not to know For whom the bell tolls. It tolls for
thee."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]