Skip navigation

S.O.S.

Jul 20, 2012 6:13 AM

Tags: #help #scoring #actionscript_2 #score_issue #quiz_results #urgenthelp #click_counter #quiz_score
  Latest reply: kglad, Sep 2, 2012 9:42 AM
Replies 1 2 3 Previous Next
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 4, 2012 9:32 AM   in reply to CRAAZYGENIUS

    use the trace function to see if that code is executing.  if it's not, check your button names.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 18, 2012 10:39 AM   in reply to CRAAZYGENIUS

    add:

     

    this._parent.completeF(1)

     

    to the last frame of a question swf when answered correctly and

     

    this._parent.completeF(0)

     

    to the last frame of a question swf when answered incorrectly.

     

    and, to your main swf, add:

     

    var scoreVar:Number=0;

    completeF(scoreVar);

    // create a score dynamic textfield (say score_tf) to display your score.

     

    function completeF(n:Number):Void{

    scoreVar+=n;

    score_tf.text=scoreVar;

    }

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 19, 2012 5:56 PM   in reply to CRAAZYGENIUS

    no.

     

    depending on the quiz taker's response, you know whether that response is correct or incorrect.  use that to determine which value to pass to this._parent.completeF().

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 20, 2012 6:52 AM   in reply to CRAAZYGENIUS

    explain the setup of a typical question swf.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 20, 2012 9:24 AM   in reply to CRAAZYGENIUS

    will the wrong animation be the same for every question?

    will the correct animation be the same for every question?

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 21, 2012 7:00 AM   in reply to CRAAZYGENIUS

    then create a wrong.swf and a correct.swf.  your scoreF can load the appropriate swf.

     

    you alread have created the question swf's, true?

     

    if yes, do you have something in each swf that determines what is the correct option that a user should click?

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 21, 2012 11:14 AM   in reply to CRAAZYGENIUS

    for question1, how does flash know B is the correct choice?

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 22, 2012 6:16 AM   in reply to CRAAZYGENIUS

    is there anything in question swfs that make each different other than the question, the choices and the answer?  ie,are there graphics in that differ in the different question swfs?

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 22, 2012 8:59 AM   in reply to CRAAZYGENIUS

    then you'll need to hardcode the correct answer into each question swf.

     

    if your buttons are named, A,B,C,D, you can use:

     

    for question1 swf:

     

     

    var correctAns:Button = B;

     

    A.onRelease=checkAnsF;

    B.onRelease=checkAnsF;

    C.onRelease=checkAnsF;

    D.onRelease=checkAnsF;

     

    function checkAnsF():void{

    if(this==correctAns){

    this._parent.completeF(1);

    // use attachMovie to display "correct.swf"

    } else {

    this._parent.completeF(0);

    // use attachMovie to display "wrong.swf"

    }

    }

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 22, 2012 10:19 AM   in reply to CRAAZYGENIUS

    attached to the first frame where those buttons exist.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 22, 2012 9:55 PM   in reply to CRAAZYGENIUS

    void should be Void

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 23, 2012 6:54 AM   in reply to CRAAZYGENIUS

    what's the trace function show:

     

    var correctAns:Button = B;

     

    A.onRelease=checkAnsF;

    B.onRelease=checkAnsF;

    C.onRelease=checkAnsF;

    D.onRelease=checkAnsF;

     

    function checkAnsF():Void{

    trace(this+" "+correctAns+" "+this._parent);

    if(this==correctAns){

    this._parent.completeF(1);

    // use attachMovie to display "correct.swf"

    } else {

    this._parent.completeF(0);

    // use attachMovie to display "wrong.swf"

    }

    }

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 23, 2012 10:36 AM   in reply to CRAAZYGENIUS

    var correctAns:Button = B;

     

    A.onRelease=checkAnsF;

    B.onRelease=checkAnsF;

    C.onRelease=checkAnsF;

    D.onRelease=checkAnsF;

     

    function checkAnsF():Void{

    trace(this+" "+correctAns+" "+this._parent);

    if(this==correctAns){

    this._parent.completeF(1);

    // use attachMovie to display "correct.swf"

    } else {

    this._parent.completeF(0);

    // use attachMovie to display "wrong.swf"

    }

    }

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 23, 2012 11:53 AM   in reply to CRAAZYGENIUS

    put that code in your first question swf attached to the first frame where those buttons exist.

     

    then click one of your buttons in the test environment.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 23, 2012 5:41 PM   in reply to CRAAZYGENIUS

    what's this show:

     

    trace("test");

    var correctAns:Button = B;

     

    A.onRelease=checkAnsF;

    B.onRelease=checkAnsF;

    C.onRelease=checkAnsF;

    D.onRelease=checkAnsF;

     

    function checkAnsF():Void{

    trace(this+" "+correctAns+" "+this._parent);

    if(this==correctAns){

    this._parent.completeF(1);

    // use attachMovie to display "correct.swf"

    } else {

    this._parent.completeF(0);

    // use attachMovie to display "wrong.swf"

    }

    }

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 25, 2012 7:06 AM   in reply to CRAAZYGENIUS

    again

     

    put that code in your first question swf attached to the first frame where those buttons exist.

     

    then click one of your buttons in the test environment.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 26, 2012 10:18 PM   in reply to CRAAZYGENIUS

    then that code is not executing.  ie, you're not testing the file with that code or you have not added that code to a frame that plays.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 27, 2012 6:58 AM   in reply to CRAAZYGENIUS

    at this point it doesn't matter whether they are external swfs. 

     

    that code needs to be in the same swf as the one that contains your answer buttons.  if it were and you were testing correctly you would see trace output.

     
    |
    Mark as:
  • kglad
    72,340 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 28, 2012 9:59 PM   in reply to CRAAZYGENIUS

    then if that frame played, you would see trace output.

     
    |
    Mark as:
Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points