dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Input Text in a movieclip, doesn't work :(

  1. #1
    Senior Member
    Join Date
    Mar 2002
    Posts
    185

    Input Text in a movieclip, doesn't work :(

    hi
    I am having a trouble with Input Text.
    I put a text box in the first scene,first frame.I set it as InputText and Var. name is "Name".
    I have a mc in frame 88 and inside this mc there is another mc.In that last mc I put another text box,InputText and set Var. name as "Showname"

    I add this code into the first frame to a button;

    on (release, keyPress "<Enter>") {
    Showname = Name;
    gotoAndPlay(2);
    }

    I want the move go on from frame(2) to (88) and show the text in the mc.
    But it doesn't

    What do I do wrong?

    Thanks for your time

  2. #2
    general rule bender Gloomycus's Avatar
    Join Date
    Nov 2000
    Location
    ontario canada
    Posts
    1,538
    Code:
    on (release, keyPress "<Enter>") {
       Showname = _root.Name;
       gotoAndPlay(2);
    }

  3. #3
    Senior Member
    Join Date
    Mar 2002
    Posts
    185
    hi,

    Thanks but I am sorry that it doesn't help.

    "showname" input text is in a mc and I transform that mc, could it be the problem.I rotated it and it is also motion tweened.

    Any idea?

  4. #4
    Senior Member
    Join Date
    Mar 2002
    Posts
    185
    I have to solve this one, plz help me about it.
    Thanks,

  5. #5
    where is the button located?

  6. #6
    Senior Member
    Join Date
    Mar 2002
    Posts
    185
    hi,

    Button is on the first frame under the "name" nput text.

    Ok,once again;

    At the beginning of the movie,1st frame, I ask the user's name,they write it into a box(which contains Inputtext "name" ) and click the button "ok" The code is attached to that button.
    At the 88th frame there is a mc and inside that mc,there is another mc which contains another Input text "Showname" I want to see the users name in that box when we are watching 88th frame.That is all.

    But the last mc is transformed and motion tweened, maybe this is the problem.

    Plz help...

  7. #7
    ok i got it,
    couple of points to note:
    1. the scope of your variables are only specific to the timeline they reside on i.e. the 'name' variable was created on the root timeline, to access it from other timelines you have to specify the path to the variable such as _root.name
    2. You cannot assign a value to a textfield if doesnt exist yet(such as the input field on frame 88, it doesnt exist on frame 1)

    so u should do the following:
    for the button use this code-
    on (release, keyPress "<Enter>") {
    play();
    }

    add this code to the movieclip that the second input field resides on
    Showname = _root.name;

    that should do it, hope it helps

  8. #8
    Senior Member
    Join Date
    Mar 2002
    Posts
    185
    hi,

    Thanks lektran, still it doesn't work but I found the problem.

    When you rotate the inputtext box,it doesn't show the variable.I tried it on the main timeline,I put an Inputtext and tried the same codes and it works fine but when I rotate the Input Text ,it doesn't show the var.
    Motion Tweening doesn't cause a problem,it works fine but rotating...

    I am going to open a new thread about rotating input text,
    thanks again for your time.

  9. #9
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Send the .fla, to see if i can help =)

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