Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 3 of 3

Thread: Score function

  1. #1

    Default Score function

    Hi there,

    I want to create a score function. When user clicks to buttons after choosing same color it shoul show a movie clip animation that the person got a bonus and add the bonus numbers in score. Like that for 3-4 option I want to show the bonus button and at some time it may subtract the points. How can I do that? Any help will be appreciated.

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2

    Default

    Id probably attack this problem in the following way.
    Give each button an extra property describing its color,now when the user clicks the two buttons push them into an array maybe

    Code:
    btn1_btn.colored=blue;
    btn1_btn.onRelease=function(){
    myArray.push(this.colored);
    }
    and check to see if they are the same:
    Code:
    if (myArray[0]==myArray[1]){
    //add to score
    score ++;
    trace("colours were equal");
    
    //play mC animation
    }else{
    delete the array entries and start from scratch
    myArray.length=0;
    trace("Idiot, those dont match!");
    }


    This code would not work as it stands, it is just to help you get an idea. For instance you would need to define your array at the beginning etc etc.

    GL,
    Taff

  4. #3

    Default

    Thanks Taff, I will try it and let you know if I face any difficulties

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Animated Graphic Score (Need Help)!
    By Dr_Spankenstein in forum Sound and Music
    Replies: 1
    Last Post: 04-02-2006, 04:26 AM
  2. function issues
    By pixelz in forum Flash Scripting
    Replies: 4
    Last Post: 12-01-2005, 09:02 AM
  3. exiting a function
    By yardgnome in forum Newbies
    Replies: 2
    Last Post: 07-17-2005, 02:43 AM
  4. Tracking user score in a game....
    By ifty40 in forum Flash Scripting
    Replies: 9
    Last Post: 05-02-2005, 04:19 AM
  5. flash high score board (perl)
    By dave-j in forum Advanced Flash
    Replies: 1
    Last Post: 09-29-2003, 11:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial