LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 776 users online 221609 members 1561 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
bipolarmania
Peeves: Racism, Homophobia, Sexism, prejudice ...
Mood: Euphoric
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
6 online / 33 MPM
Fresh Topics
  LiveWire / Technical Forums / General Tech Discussion / Viewing Topic

AS 3.0 Problem
Replies: 10Last Post Jan. 5 9:50pm by Randomaster
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( Randomaster )


Soothsayer

Patron
Reply
I'm making a calculator in Flash CS3 using actionscript 3.0.

It has the Multiply, Divide, Plus & Minus buttons.
When i input the code for one button, that button works, but when i input the code for more than one, none of the buttons work.
What am I doing wrong?

Download Calculate.fla

Code:
MinusButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);

function doMyCalculation(e:MouseEvent):void
{
   var total : Number;

   // PROCESS
   total = Number(N1.text)-Number(N2.text);

   // OUTPUT
   total.text = String(myAnswer);
};

MultiplyButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);
{
   var total : Number;

   // PROCESS
   total = Number(N1.text)*Number(N2.text);

   // OUTPUT
   total.text = String(myAnswer);
};

DivideButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);
{
   var total : Number;

   // PROCESS
   total = Number(N1.text)/Number(N2.text);

   // OUTPUT
   total.text = String(myAnswer);
};

PlusButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);
{
   var total : Number;

   // PROCESS
   total = Number(N1.text)+Number(N2.text);

   // OUTPUT
   total.text = String(myAnswer);
}

Thanks guys  

-------
How's that goin' for ya?
http://myspace.com/luke_web
ғ»ѕ


9:42 pm on Jan. 5, 2009 | Joined: Nov. 2008 | Days Active: 240
Join to learn more about Randomaster Australia | Lesbian Male | Posts: 4,982 | Points: 11,139
LiveWire Humor
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
( Randomaster )


Soothsayer

Patron
Reply
Quote: from oridniv at 3:44 pm on Jan. 6, 2009

good for u...can you make a graphing one like the TI80s series
thanks for the help  

-------
How's that goin' for ya?
http://myspace.com/luke_web
ғ»ѕ

9:44 pm on Jan. 5, 2009 | Joined: Nov. 2008 | Days Active: 240
Join to learn more about Randomaster Australia | Lesbian Male | Posts: 4,982 | Points: 11,139
Post from this position was omitted due to content violations
TBMP


Soothsayer

Patron
Reply
i think it has to do with the placement of your //OUTPUT

i'm just an amateur at coding though

-------
www.myspace.com/theblindmotorprotocol
www.myspace.com/nuspeak
www.myspace.com/piffle4life


9:44 pm on Jan. 5, 2009 | Joined: Sep. 2008 | Days Active: 262
Join to learn more about TBMP California, United States | Bisexual Male | Posts: 7,108 | Points: 11,510
4est


Oh, Mr. Darcy!

Patron
Tech Support Leader
Reply
Are you sure that '*' is an acceptable character for use in flash? I'm no programming expert, but I know flash is very picky about things like that.

-------
In vain I have struggled. It will not do. My feelings will not be repressed.

You must allow me to tell you how ardently I admire and love you.

9:45 pm on Jan. 5, 2009 | Joined: July 2005 | Days Active: 964
Join to learn more about 4est South Africa | Label Free | Posts: 23,013 | Points: 35,765
ObviousObscurity


Professional

Ad Free
Reply
I don't do flash, but
[this got a little tangled in my head, to be honest..]


why'd you copy and paste the code again? It looks like it should just be
MultiplyButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);
DivideButton_btn.addEventListener(MouseEvent.CLICK, doMyCalculation);

etc? That's my closest guess. the documentation seems to show that function being used that way.

Post edited at 9:53 pm on Jan. 5, 2009 by ObviousObscurity

-------
no there's no light
in the darkest of your furthest reaches


9:47 pm on Jan. 5, 2009 | Joined: Dec. 2008 | Days Active: 89
Join to learn more about ObviousObscurity New Jersey, United States | Asexual Male | Posts: 589 | Points: 2,132
( Randomaster )


Soothsayer

Patron
Reply
Quote: from 4est at 3:45 pm on Jan. 6, 2009

Are you sure that '*' is an acceptable character for use in flash? I'm no programming expert, but I know flash is very picky about things like that.
Yes, "*" is the universal symbol for multiplication in computing.

-------
How's that goin' for ya?
http://myspace.com/luke_web
ғ»ѕ

9:50 pm on Jan. 5, 2009 | Joined: Nov. 2008 | Days Active: 240
Join to learn more about Randomaster Australia | Lesbian Male | Posts: 4,982 | Points: 11,139
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / General Tech Discussion / Viewing Topic