A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: [MX04] Who wants to be a millionaire

  1. #1
    Member
    Join Date
    Mar 2007
    Posts
    43

    [MX04] Who wants to be a millionaire

    Hello,
    My name is Chinmaya and this is my first post.I am currently making a who wants to be millionaire game with lifelines.I have got everything I need except the correct code for lifelines.The problem I am having is that when a person plays the game,once the lifeline is used and the answer is correct,the lifeline gets renewed on the next question.For example-
    If a person is answering the first question and uses 50-50 lifeline,two answers of the total four get removed.If the person answers right then,when he reaches the next question the lifeline can be used again.
    THANK YOU IF YOU CAN HELP ME.PLEASE HeLP ME!!

  2. #2
    Senior Member
    Join Date
    May 2004
    Location
    East Yorkshire, England
    Posts
    423
    When you start the game set variables like:

    fiftyfifty=true;
    askaudience=true;
    phonefriend=true;

    As each one gets used, check whether they are "true" then set them to "false" after the player has used them.
    Feeling chatty?
    http://www.mitsuku.com

  3. #3
    Member
    Join Date
    Mar 2007
    Posts
    43

    Thank You A Lot!!!!!

    Thank you very much.You are the first person wh ohas ever replied to my posts on this site or any other.Once again THANK YOU!!!!!!!

  4. #4
    Senior Member
    Join Date
    May 2004
    Location
    East Yorkshire, England
    Posts
    423
    Hehe! no problem my friend.
    Feeling chatty?
    http://www.mitsuku.com

  5. #5
    Member
    Join Date
    Mar 2007
    Posts
    43

    A little problem!

    I wrote and tried a code but I think I have made a mistake in writing it.Can you check it.

    On first frame-
    stop();
    var fiftyfifty=true;

    On button(fifty fifty) on the frame frame-
    on(press){
    var fiftyfifty=false
    }
    Some other also effects like remove these particular choices

    On second frame(A frame with a new question)-
    if(fiftyfifty=false){
    var fiftyfifty=false}

    This was my code,but still the fifty-fifty works in the second frame even after being used in first frame.(please dont make fun of my mistakes if I have made a very silly one).
    IF THIS CODING IS TOTALLY WRONG,PLEasE Can YOU SEND ME ANOTHER CODE.

  6. #6
    ...dishing dimes on an .fla! pointguard's Avatar
    Join Date
    Dec 2001
    Location
    Cambridgeshire, England
    Posts
    1,017
    As Steve said, set up the variables at the beginning of your code...
    code:

    var fiftyfifty:Boolean=true;
    var askaudience:Boolean=true;
    var phonefriend:Boolean=true;


    you don't want the 'stop();' action before these variables either...

    Then, on your buttons...
    code:

    on(press){
    _root.fiftyfifty=false;
    }



    On your second frame with your next question, why not try removing the buttons?...or going to a different instance of the fiftyfifty mc / button?...I don't know how your .fla is set out, but add this to your fiftyfifty mc if you have one...
    (eg)
    code:

    if(_root.fiftyfifty==false){
    this.removeMovieClip();
    }


    Or, you can change the 'this.removeMovieClip();' line to 'this.goToAndStop(2);'. Whereby, frame 2 could for example be a copy of the fiftyfifty logo / image but in b&w to sybolise you can't use that option anymore....??? (Just an idea)

    edit :: forgot to say you need the extra '=' in the '==false' bit to check for equality.

  7. #7
    Member
    Join Date
    Mar 2007
    Posts
    43

    I Get It!

    OK!Now I understand.I'll try this and get back to you.Thanks!

  8. #8
    Member
    Join Date
    Mar 2007
    Posts
    43
    I tried it and it doesn't work.Maybe i'm making a mistake again.I'll tell you an exact copy of what i was doing.
    I MADE 2 FRAMES.ON FRAME 1- I wrote 1 with the pencil.
    ON fRAME 2- I wrote 2 with the pencil.(did this just to diffrentiate between the frames.
    On Frame 1-I made 2 buttons(1 fiftyfifty and one button for frame change(from frame 1- frame 2)
    On Frame 2-I made 1 button which was the exact replica of the fiftyfifty in frame 1.
    On frame 1,I put the code-
    var fiftyfifty:Boolean=true;
    stop();//need it for stopping the current frame

    On button fiftyfifty on frame 1.I put the code-
    on(press){
    _root.fiftyfifty=false
    }

    On next button in frame 1 I put the code-
    on(press){
    gotoAndStop(2)
    }

    On frame 2 in the button fiftyfifty,I put the code-
    on (press) {
    if (_root.fiftyfifty == false) {
    this.removeMovieClip();
    }


    NOW I CLICK ON FIFTY FIfTY IN FRAME ONE,THEN I REACH FRAME 2 BY CLICKING on THE BUTTON.but NOW WHEN I CLICK ON THE FIFTY FIFTY ON FRAME TWO,IT DOES NOT GET REMOVED.

    HeLP!!!!!!!!!!!!!!!!!!!!!!!!
    IT TOOK ME A WHILE TO WRITE THIS MESSAGE.

  9. #9
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    You cant use removeMovieClip() to remove movie clips placed on stage manually, it works for stuff added dynamically with attachMovie or duplicateMovie.

    You could just hide the mc:

    Instead of
    this.removeMovieClip();

    try
    this._visible=false;

  10. #10
    Member
    Join Date
    Mar 2007
    Posts
    43

    I Cant Believe It!!!!!!!!!!!!!!!

    WOW!IT WORKS!THE ONLY PROBLEM I HAD WAS THE REMOVEMOVIECLIP PROBLEM.THANK YOU A LOT TO ALL THOSE WHO HELPED ME!finally,everything is in order,sounds check,movie clips check,questions check,SCRIPTING CHECK.I WILL HAVE THIS DONE IN NO TIME.THANK YOU ALL.This is the code that WORKED-

    //FRAME1
    var fiftyfifty:Boolean = true;
    stop();

    //FIFTYFIFTY
    on (press) {
    _root.fiftyfifty = false;
    }

    //FRAME2 FIFTYFIFTY
    on (press) {
    if (_root.fiftyfifty == false) {
    this._visible = false;
    }

  11. #11
    ...dishing dimes on an .fla! pointguard's Avatar
    Join Date
    Dec 2001
    Location
    Cambridgeshire, England
    Posts
    1,017
    Cool...let us all see this when you have it published...
    Interesting to see how it turns out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center