Multiplying variables...

This is a discussion on "Multiplying variables..." within the Flash & Multimedia Forum section. This forum, and the thread "Multiplying variables... are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 27th, 2008, 20:30
New Member
Join Date: Jan 2008
Location: Canada
Age: 67
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Multiplying variables...

Hi there!

Here is the whole script of a test document which doesn't work...
Excuse me but I never used multiplication of variables and I confess how shameful I feel.
I absolutely don't understand the explanations the Flash Help contains...

Document contains three Input Fields, a Dynamic Field and a Button.
Clicking the Button returns NaN !!!

I thank you in advance for any help.

Best regards from Old Gerry


Code: Select all
var a:Number = new Number(field1.text);
var b:Number = new Number(field2.text);
var c:Number = new Number(field3.text);
operationFct = function () {
	var res:Number = new Number();
	res = (a * b) + c;
	resultFld.text = res;
};
myButton.onRelease = function() {
	operationFct();
};
stop();
Reply With Quote

  #2 (permalink)  
Old Feb 27th, 2008, 22:41
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 409
Blog Entries: 2
Thanks: 3
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: Multiplying variables...

Please attach your .fla file
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #3 (permalink)  
Old Feb 27th, 2008, 23:26
New Member
Join Date: Jan 2008
Location: Canada
Age: 67
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Multiplying variables...

Quote:
Originally Posted by marSoul View Post
Please attach your .fla file
Thanks for replying, very kind from you but no need to attach my .fla
Solution is to include the variables in the function...

Best regards,
Gerry


Code: Select all
operationFct = function () {
        var a:Number = Number(field1.text);
        var b:Number = Number(field2.text);
        var c:Number = Number(field3.text);
	var res:Number = new Number();
	res = (a * b) + c;
	resultFld.text = res;
};
myButton.onRelease = function() {
	operationFct();
};
stop();
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form - variables not going through comaiwat JavaScript Forum 3 Oct 24th, 2007 13:53
question on Variables saltedm8 PHP Forum 12 Oct 12th, 2007 00:16
PhP variables added to XML mavedog21 PHP Forum 0 Nov 28th, 2006 16:09
Variables!! bionics PHP Forum 6 Apr 25th, 2006 15:39
Get URL and use variables JamieH PHP Forum 2 Jan 1st, 2006 03:13


All times are GMT. The time now is 22:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43