A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Simple Fill-in-Blank Code is evading me

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    2

    Simple Fill-in-Blank Code is evading me

    Hello and thanks to anyone who can help with this. Each question is on a separate frame because it is a color word spelling game, and the colors of the words provide a hint on the levels for the easier level. I have figured out the general navigating code for my buttons, but what is escaping me is the coding for the actual spelling part of the game.

    The input text boxes are in place, and the properties are set to single line and a limit of one character. Each text box on each frame is looking for a different letter. The input text box on the first is named BlueInput, if that is useful.

    I can't figure out how to code the if else statement that will direct the player to frame 60 if it is correct, and frame 70 if it is not correct. If someone can help with the general coding, I can fill in the names of things.

    Thanks!

  2. #2
    Junior Member
    Join Date
    Sep 2013
    Posts
    2
    The AS2 code is below. My questions are: Does all the AS3 code now go on the layer that holds the "check" button? Or does it go on the layer with the input text box?

    Here is the code that worked wonderfully in AS2: (the spacing here may not be perfect but it is right on my game)

    on(press){
    if (textbox.text.indexOf("l") l= -l{
    _root.gotAndStop ("VeryGood");
    {else {
    _root.gotoAndStop ("TryAgain");
    }
    }

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    Because actionscript is controlling the flash (it's not just a simple animation, it's a game), you shouldn't use scenes.

    Everything goes in one scene on the first frame. There can be as many layers as you like but all on the first frame. You can put your actionscript in a frame on a layer or use a "main" class (both of which there's lots of help/tutorials) but don't put it anywhere else - it all goes on the first frame (including .as files) or classes.

    This is the standard way to organize your flash. Your code will all be in one place. It will take some thinking at first but everything will get much easier once you get going.

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