A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: a reaction to a text box

  1. #1
    I need to make a movie clip go to a frame by what the value of the text box is.

    i want to:

    if (variable"text"="1") {
    }
    tellTarget ("mc") {
    gotoAndPlay (1);
    }
    what is the right way to right that?

    and help would be good
    thanks
    gadgets

  2. #2
    I'm a hero like Robert De Niro
    Join Date
    Mar 2000
    Location
    London
    Posts
    1,171

    Hello,

    The basic action is:

    with (_root.movieClip) {
    gotoAndPlay (text);
    }


    "with" is like tell target and is preferred.In the go to command you choose "go to an expression" and place the name of the variable.You can assign this action to a button or anything else.

    Good luck,

    McMurphy

  3. #3
    i dont under stand???

    i need the mc to go to frame 2 if the text box value is 2

    sorry!
    gadgets


  4. #4
    I'm a hero like Robert De Niro
    Join Date
    Mar 2000
    Location
    London
    Posts
    1,171
    This is what'll happen.Did you try it?

    If so plz paste here the code yuor using.

    McMurphy


  5. #5
    i dont see where you define the action?
    it doesnt tell it to do anything

    the textbox is not in a mc

    the whole thing is to change a background by what the textbox says

    so if the text reads

    "level 2"
    it will tell the background mc to go to frame 2

    tell me if you understand because i dont know if you do?
    sorry
    gadgets

  6. #6
    I'm a hero like Robert De Niro
    Join Date
    Mar 2000
    Location
    London
    Posts
    1,171
    The situation is very simple.You have a text box (lets call it text) and you have a movie clip with a number of frames.Once the user has entered the value you need a button to reset the movie clip and tell it where to go according the input inside the text box.And this is what this code that once you place it inside a button.

    McMurphy

  7. #7
    ok

    thats not working because the:

    with (_root.back){
    IS YELLOW (BACK IS THE INSTANCE NAME OF THE MC)

    gotoAndStop (level);
    }

    LEVEL IS RED (LEVEL IS THE NAME OF THE TEXTBOX)

    also its not going to be activated by a button it has to be automatic.

    sorry again
    gadgets

  8. #8
    I'm a hero like Robert De Niro
    Join Date
    Mar 2000
    Location
    London
    Posts
    1,171
    You have nothing to be sorry about

    What do you mean in red and yellow? you mean the action script it highlighted showing you of an error? if so what does it say?

    Did you choose "expression" in the go to command?

    And if you want it to be automatic you have to run the code in a loop.You can place it inside a movie clip.You simple drag a new empty movie clip on the stage and right click it.In the action you choose "on clip enter frame" and place the "with" command.

    Let me know how it goes.

    McMurphy

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