[vet-mm] actionscript prob

Michelle Dennis mdennis at mentonegirls.vic.edu.au
Thu Sep 11 19:46:39 EST 2008


Hi,
 
There's nothing wrong with the code - it's an easy fix!
 
Just untick autokern on both of your input boxes.
 
Michelle Dennis

________________________________

From: vet-mm-bounces at edulists.com.au on behalf of Glenn Drew
Sent: Thu 11/09/2008 6:24 PM
To: VET Multimedia Teachers' Mailing List
Subject: [vet-mm] actionscript prob


Speaking of scripting - I have an odd issue with Flash CS3 (AS 2.0) and a simple piece of scripting I have used many times before.
 
 
A simple and crude calculator
Create 2 input text boxes with variable names, 'num1' and 'num 2' respectively.
Create a dynamic text box with the variable name 'answer'.
A button with the following script
 
on (press) {
 answer = Number(num1) + Number(num2); //Adds 2 numbers entered into num1 and num2, converting num1 & 2 from strings to numbers
}
 
It produces the correct output on a teachers PC eg 2 + 3 =5, but not on the students or my laptop where it produces NaN (Not a number).
A check of the datatypes using 'trace(typeof(num1)); etc, shows that num1 and num2 remain as strings.
 
A trace(answer) command shows a lot of html code?!?!?
It appears different machines compile them differently, is there a setting or formatting I am not finding??
 
Any clues, anyone?
Glenn Drew
 
_______________________________________________ 
http://www.edulists.com.au <http://www.edulists.com.au/> - FAQ, resources, subscribe, unsubscribe 
VET Multimedia Mailing List kindly supported by 
http://www.vcaa.vic.edu.au/vet/programs/multimedia/multimedia.html - Victorian Curriculum and Assessment Authority and 
http://www.pixeled.org.au <http://www.pixeled.org.au/> - PixelEd Multimedia Teachers Association 

IMPORTANT - This email and any files transmitted with it are solely intended for the use of the addressee(s) and may contain information that is confidential and privileged.
If you receive this email in error, please advise us by return email immediately. Please also disregard the contents of the email, delete it and destroy any copies immediately. Mentone Girls Grammar does not accept liability for the consequences of any computer viruses that may be transmitted with this email.


Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 5371 bytes
Desc: not available
Url : http://www.edulists.com.au/pipermail/vet-mm/attachments/20080911/62ced83c/attachment.bin


More information about the vet-mm mailing list