A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Application Scripting Help

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    21

    Application Scripting Help

    Greetings!

    Here is what I want to do:

    I want to develop an interactive activity that allows the user to select a variety of items in an effort to make a working combination.

    For example:

    When they select the correct combination of items, a certain movie clip animation will play...rewarding them for their correct answer. On the other hand, if they select the wrong combination of items, then another animation plays as well as some text feedback showing the user the error of their ways.

    I already have the movie clip animations developed, but need a bit of actionscripting guidance to get me rolling in the right direction.

    How would you go about developing something like this?

    Thanks for any insight you can provide!!

    - - Nursedad

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Location
    I guess that depends upon where I am when you read this...
    Posts
    13
    Here is what I would do:

    Each time that an item is selected (either clicked or rolled over) set a variable. In order for the interaction to be correct, you need certain variables to be set. Then you can have a "submit" or "check my answers" button that checks to see if all of the necessary variables have been set.

    For example, say you have items A, B, C, and 1. The interaction is correct when the user clicks on items A, B, and C.

    When the user clicks on A set a variable of A to "clicked".
    When the user clicks on B set a variable of B to "clicked".
    When the user clicks on C set a variable of C to "clicked".
    When the user clicks on 1 set a variable of 1 to "clicked".

    For instance, put this code on object (button) A:

    on (release) {
    A = "clicked";
    }

    Then do the same for the other objects being sure to change the variable name.

    Now just set up a "judge" button that says if A="clicked" AND B="clicked" AND C="clicked" then play the correct animation, otherwise play the incorrect animation, like this:

    on (release) {
    if (A=="clicked" && B=="clicked" && C=="clicked") {
    gotoAndPlay (scene number of correct animation);
    } else {
    gotoAndPlay (scene number of incorrect animation);
    }
    }


    Something like that should work.

    Adam

  3. #3
    Junior Member
    Join Date
    Jun 2002
    Posts
    21
    Thank you!

    That sounds good to me. That's kind of what I was thinking, but wanted to make sure I was going in the right direction. BTW...thanks for the action script info too. I'm a "relative" newbie and all the help in that area is well appreciated.

    I'll update the thread once I've got it up and running.

    Thanks again and wish me luck...

    - - Nursedad

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