dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Textfield issues

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    113

    resolved [RESOLVED] Textfield issues

    I create a textfield in a MC....

    PHP Code:
    var feedback_txt:TextField= new TextField();
    feedback_txt.type=TextFieldType.DYNAMIC;
    feedback_txt.x=firstPart+5;
    feedback_txt.y=45;
    feedback_txt.selectable=false;
    feedback_txt.antiAliasType=AntiAliasType.ADVANCED;
    feedback_txt.width=secondPart;
    feedback_txt.height=25;
    if (
    makeTextFields=="true") {
        
    nextQuestion_mc.addChild(feedback_txt);
    }
    feedback_txt.setTextFormat(myFormatPurple); 
    I can see my text field and I can manipulate the mc with a tween and everything loads fine.

    I have a function triggered from a timer that changes the text in the field.

    PHP Code:
    trace(nextQuestion_mc.feedback_txt); 
    But the textfield comes up as undefined, even though I can see it and manipualte outside the function. The function is on the main timeline, and called from the main timeline. What am I doing wrong? Thanks.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Is that code in nextQuestion_mc? If not, then nextQuestion_mc does not have a feedback_txt property. Just adding a child does not create a property. If your trace code is in the same scope as the first code, you could just remove the "nextQuestion_mc." part, since the feedback_txt variable is defined in that scope. Your trace will result in "[Object TextField]".

  3. #3
    Senior Member
    Join Date
    Apr 2002
    Posts
    113
    That solved my problem. Such an easy fix! THANKS! You have helped me on several occasions and I can't thank you enough.

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