LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 701 users online 211194 members 1436 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Sheebobee
Interests: Photography, music, guitar, making ...
Mood: Lonely
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
7 online / 34 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 )


Connoisseur

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: 149
Join to learn more about Randomaster Australia | Lesbian Male | Posts: 4,303 | Points: 7,765
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 )


Connoisseur

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: 149
Join to learn more about Randomaster Australia | Lesbian Male | Posts: 4,303 | Points: 7,765
Post from this position was omitted due to content violations
TBMP


Visionary

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


9:44 pm on Jan. 5, 2009 | Joined: Sep. 2008 | Days Active: 169
Join to learn more about TBMP California, United States | Bisexual Male | Posts: 5,243 | Points: 8,349
4est


Rockin' the Suburbs

Patron
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.

-------
Ask me no questions, I'll tell you no lies.

9:45 pm on Jan. 5, 2009 | Joined: July 2005 | Days Active: 906
Join to learn more about 4est British Columbia, Canada | Metrosexual Male | Posts: 18,406 | Points: 30,910
ObviousObscurity


Dairy Product Addict
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: 81
Join to learn more about ObviousObscurity New Jersey, United States | Asexual Male | Posts: 559 | Points: 1,640
( Randomaster )


Connoisseur

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: 149
Join to learn more about Randomaster Australia | Lesbian Male | Posts: 4,303 | Points: 7,765
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