Wrox Home  
Search P2P Archive for: Go

  Return to Index  

flash_programming thread: variable typing in Flash 5


Message #1 by Russell Peto <russell.peto@i...> on Tue, 5 Feb 2002 13:43:45 -0000
Thanks Pallav, that worked brilliantly!

-----Original Message-----
From: Pallav Nadhani [mailto:pallav@n...]
Sent: 05 February 2002 14:57
To: Flash Programming
Subject: [flash_programming] Re: variable typing in Flash 5


Hia,

There's a function called Number() in Flash which helps one to convert 
caharcter values to numeric values. So, in order to get the sum of the 
variables variable1 and variable2, you need to do the following:

variable3 = Number(variable1) + Number(variable2);

I hope this solves your problem.

Rgds
Pallav Nadhani

> Hi all,
> 
> I have a flash movie which is drawing several variables from a text file 
in
> the form of
> 
variable1=variable1value&variable2=variable2value&variable3=variable3value
> etc.. The problem is that some of the variables are numeric yet when I 
try
> to add a numeric variable to them inside ActionScript it concatenates the
> values rather than adding them. E.G.
> 	variable1 = 500
> 	variable2 = 223
> and when I add them ( variable1 = variable1 + variable2; ) the result is
> 500223 rather than 723.
> Has anyone come across this before, and if so can they tell me how to fix
> it?
> 
> Thanks in advance
> 
> Russell Peto
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.320 / Virus Database: 179 - Release Date: 30/01/2002
>  

$subst('Email.Unsub').

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.320 / Virus Database: 179 - Release Date: 30/01/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.320 / Virus Database: 179 - Release Date: 30/01/2002
 

  Return to Index