dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: A couple questions.

  1. #1
    Robert (www.oldmanmovies.com)
    Join Date
    Jan 2006
    Location
    Washtington State
    Posts
    13

    Lightbulb A couple questions.

    Okay I have 3 questions, the first one is, when I make a if else, I want to make it so the user can type something and have something happen depending on what they type, kinda like a command line. For example, if the user types "restart" then the movie goes back to frame 1 on the first scene. So I have an input box and a button with an if else statement but when i make an if else statement that looks like..

    if (command == "restart") {
    gotoAndPlay(1);
    }else if (command == "gotoend") {
    gotoAndPlay(783);
    }

    the problem is when I have two equals signs the actionscript does not work but if there is only one equals sign the first command works, but nothing else will. What am I doing wrong? (Also sorry if there are minor errors in the script I typed above, I just typed it on the fly and I am currently kinda drunk, but when I wrote the script (while sober) flash told me there were no errors).

    The 2nd question is, is there a way to automatically make a dynamic text box with a scroll bar, scroll to the bottom?

    And the 3rd question is, in my current flash file when I make a dynamic text box and try to add the scroll bar from the components box the scroll bar dose not attach to the text field and resize it's self and it does not work when I test the movie, I have tired it multiable times and the scroll bar is connected to the right instance name. I have tried this on multiable computers.

    Thanks for the help.
    Robert Pallister

  2. #2
    Senior Member
    Join Date
    Oct 2008
    Posts
    227
    Hi!
    If you have only one equal sign, the if statement wont understand it, and will just go with whatever the first line is. (This won't output an error as you said). Try using 'command.text' instead of just 'command' and it should work.

    For the second question: Yes, but I dont have that in my head right now.

    Third: Try not attaching the component to any instance name at all, and it should automaticly connect to whatever textfield is closest to it.

Tags for this Thread

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