Sorry, I typed it kind of quickly: # private function stepperSumFun( val1:int, val2:int, val3:int, val4:int, val5:int):String { # return (val1+val2+val3+val4+val5).toString(); # }
Also, you need to pass Numbers not ints if the steppers will have decimals. Best Regards, ...aaron On 1/9/08, JRBower <[EMAIL PROTECTED]> wrote: > > > I'm getting an error: 1067: Implicit coercion of a type Number to an > unrelated type String. > > And if I change String to Number I get this warning and still no total: > Data > binding will not be able to detect assignments to "value". > > private function stepperSumFun( val1:int, val2:int, val3:int, val4:int, > val5:int):String > { > return (val1+val2+val3+val4+val5); > } > > <mx:Label text="Point Total {stepperSumFun( pt01.value, pt02.value, > pt03.value, pt04.value, pt05.value)}"/> > > Maybe I'm overlooking something? > > Thanks, > > James > > Aaron Miller-4 wrote: > > > > Just use binding. > > > > # private function stepperSumFun( val1:int, val2:int, etc.. ): String { > > # return (val1+val2+etc..); > > # } > > > > # <mx:Label text="{stepperSumFun(pt01.value, pt02.value, etc..)}" /> > > > > You could also do it without the function. > > > > Regards, > > ...aaron > > > > On 1/9/08, JRBower <[EMAIL PROTECTED] <jbower%40solazure.com>> wrote: > >> > >> > >> I have 5 numeric steppers that I'd like to add their values together > and > >> display the total in a label. > >> > >> for example: > >> > >> pt01 + pt02 + pt03 + pt04 + pt05 = pt06 (label) > >> > >> I'm not sure how to create the function. > >> > >> Thanks for your help, > >> > >> James > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/Adding-numeric-stepper-values-tp14727317p14727317.html > >> Sent from the FlexCoders mailing list archive at Nabble.com. > >> > >> > >> > > > > > > > > -- > > Aaron Miller > > Chief Technology Officer > > Splash Labs, LLC. > > [EMAIL PROTECTED] <amiller%40splashlabs.com> | 360-255-1145 > > http://www.splashlabs.com > > > > > > -- > View this message in context: > http://www.nabble.com/Adding-numeric-stepper-values-tp14727317p14728172.html > Sent from the FlexCoders mailing list archive at Nabble.com. > > > -- Aaron Miller Chief Technology Officer Splash Labs, LLC. [EMAIL PROTECTED] | 360-255-1145 http://www.splashlabs.com