Adding scroll bar to dynamic text field

I am using some code I found in the forum to create my custom text fields and am having trouble getting a scroll bar to show up.

MovieClip.prototype.$createTextField = MovieClip.prototype.createTextField;
MovieClip.prototype.createTextField = function(instanceName, depth, x, y, width, height) {
if (arguments.length<6) {
return undefined;
}

    this.$createTextField(instanceName, depth, x, y, width, height);
    this[instanceName].defaultTextFormat();
    return this[instanceName];

};
ASSetPropFlags(MovieClip.prototype, null, 1, 0);
TextField.prototype.defaultTextFormat = function() {
// add TextField properties here

	this.multiline = true;
	this.wordWrap = true;
	this.scroll = true;
	this.border = true;

	this.text = "hello world hello world hello world";


    var myTextFormat = new TextFormat();
    // add TextFormat properties here
	myTextFormat.font = "Tahoma";
	myTextFormat.color = 0x000000;
	myTextFormat.size = 10;
    this.setNewTextFormat(myTextFormat);
    this.setTextFormat(myTextFormat);

};
ASSetPropFlags(TextField.prototype, null, 1, 0);

createTextField(“webMain”, 2, 200, 200, 20, 188);

so… if i give the text portion more than the box can show there is still no scroll bar in sight. Any ideas?

Thanks.

I don’t think I understand the problem… could you attach your FLA? :-\

I dont understand it either… as far as i know, theres no way to dinamically add a scrollbar for your textfield, unless you attach it from the library. :-\

Kax,
Problem is there is no scroll bar as you will see. Here is the .fla, thanks a lot.

Potamus

Do you think that setting the scroll property to true, the scrollbar will show up? Well, the answer is no. The scroll property sets the vertical position of the text in the TextField.

This is what I think you want to do, see attachment. :wink:

Once again you have answered my question perfectly kax, thanks a lot.

potamus

You’re welcome, potamus. =)