Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 22nd, 2004, 03:07 PM
Lauri Lauri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: San Francisco
Posts: 272 Lauri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 53 sec
Reputation Power: 5
Send a message via ICQ to Lauri
Problem with variable percent in dynamic text box

I am working on something for beginning English students. The .swf is currently here in case my explanation is hard to understand.

I have a set of 12 buttons that each have a color name on them. Clicking the start button changes the color of a shirt, and when the student selects a color, there is a message saying whether the selection was correct, and adding to the "You have xxx number out of xxx number correct." This works okay.

I tried to put additional code on the last button, taking it from a tutorial, to add a message and a percentage. The code I have on the button is here:
Code:
	finalresult = int((nmbr/12)*100);
if (finalresult<60) {
        comment = "That's "+finalresult+"%"+".  Study and try again."
      } else if ((finalresult>60) && (finalresult<90)) {
        comment = "You got "+finalresult+"%"+". Not bad, but you can try again.";
} else if (finalresult>90) {
        comment = "That's "+finalresult+"%"+". Great job!";
    
}


Currently the only percent this works for is 100%. I am not as familiar with this more complicated code (I'm really just a beginner with action script) and I don't know how to troubleshoot it.

There are 12 different labels in the movie and 60 frames because I don't know how to do it all with ActionScript yet. The name of the textbox is "comment" and it only appears in the last label.

Can anyone see how I should change the code?

Thanks

Reply With Quote
  #2  
Old February 22nd, 2004, 04:15 PM
Lauri Lauri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: San Francisco
Posts: 272 Lauri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 53 sec
Reputation Power: 5
Send a message via ICQ to Lauri
Well, in the true Flash tradition, I fixed it myself. I took the "if" code off the button and put it on the next frame instead and it worked. I don't know why, but some day I will

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Problem with variable percent in dynamic text box


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway