A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help! - Dynamicly create textfields and the scrollpane

  1. #1
    Junior Member
    Join Date
    Mar 2002
    Posts
    5
    I have a problem with the scrollpane when I create textfields dynamicly in a new movieclip and then link it to the scrollpane with setScrollContent the movieclip is controled by the scrollpane but it displays outside the area of the scrollpane as well as inside it. Here is the code I am using

    <hr>
    <blockquote>
    root.textFieldRef = new Array();

    _root.createEmptyMovieClip("textMovie",1);
    scrollPane.setScrollContent(_root.textMovie);

    _root.creatTextFields = function ( num ) {
    // create movieclip holder for text fields
    var mc = _root.textMovie;

    // create
    for ( var i = 0; i < num; i++ ) {
    // create text fields inside mc and space y
    mc.createTextField ( "textField" + i, i,10,10 + (30 * i), 0, 0 );
    // store texfield instance names in _root array
    mc["textField" + i].autoSize = true;
    mc["textField" + i].text = "textField" + i;
    _root.textFieldRef.push(mc["textField" + i]);
    }
    return true;
    }

    function onClick(btn) {
    if (btn == pushBtn) {
    if (_root.creatTextFields(15)) {
    numText.text = textFieldRef.length;
    scrollPane.refreshPane();
    } else {
    trace("Did not work");
    }
    }
    }
    </blockquote>

  2. #2
    Senior Member
    Join Date
    Mar 2002
    Location
    The Netherlands
    Posts
    144
    Hi,

    I had the same problem....I embedded the dynamic textfields to solve the problem. Ok, your movie sizes increases a little, but it works. So perhaps you try it, just embed the font for your textfield.!!

    Good luck!

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