didis_be
06-28-2007, 03:17 PM
Hi all,
I'm trying since 2 days, to create a containter that will contain TextArea (created dynamically) .., and a way to scroll the container with these TextArea.
here is prototype :
var my_array:Array = Array();
my_array[0] = "January, c'est bien ........";
my_array[1] = "February, c'est mieux";
my_array[2] = "March, c'est loin";
my_array[3] = "April, et du fil";
my_array[4] = "February, c'est mieux";
my_array[5] = "March, c'est loin";
my_array[6] = "April, et du fil";
my_array[7] = "February, c'est mieux";
my_array[8] = "March, c'est loin";
my_array[9] = "April, et du fil";
my_array[10] = "February, c'est mieux";
my_array[11] = "March, c'est loin";
my_array[12] = "April, et du fil";
var my_txt:Array = Array();
var i:Number;
for(i=0 ; i < my_array.length ; i++)
{
my_txt[i] = blabla.createClassObject(mx.controls.TextArea,"my_txt"+i,i);
my_txt[i]._y = i * 30;
my_txt[i].text = my_array[i];
my_txt[i].editable = false;
//eval("button"+i).autoSize = "right";
my_txt[i].backgroundColor = 0xFFFFCC;
my_txt[i].color = 0xFF0000;
my_txt[i].setStyle("borderStyle", "none");
//eval("button"+i).setStyle("autoSize", "right");
//button2.setStyle("embedFonts", true);
my_txt[i].setStyle("fontFamily", "Verdana");//officina12");
my_txt[i].onRollOver= function () {
var obj:MovieClip = this;
var zz:Number = Number(obj._name.substr(6, obj._name.length));
trace (my_array[zz]);
my_txt[zz].setStyle("textDecoration", "underline");
trace ("onRollOver called");
};
my_txt[i].onRollOut= function () {
var obj:MovieClip = this;
var zz:Number = Number(obj._name.substr(6, obj._name.length));
my_txt[zz].setStyle("textDecoration", "none");
trace ("onRollOut called");
};
my_txt[i].onPress = function() {
trace ("press");
};
}
Did you know a easier way to have the same stuff ? scrolling ?
Thanks in advance.
I'm trying since 2 days, to create a containter that will contain TextArea (created dynamically) .., and a way to scroll the container with these TextArea.
here is prototype :
var my_array:Array = Array();
my_array[0] = "January, c'est bien ........";
my_array[1] = "February, c'est mieux";
my_array[2] = "March, c'est loin";
my_array[3] = "April, et du fil";
my_array[4] = "February, c'est mieux";
my_array[5] = "March, c'est loin";
my_array[6] = "April, et du fil";
my_array[7] = "February, c'est mieux";
my_array[8] = "March, c'est loin";
my_array[9] = "April, et du fil";
my_array[10] = "February, c'est mieux";
my_array[11] = "March, c'est loin";
my_array[12] = "April, et du fil";
var my_txt:Array = Array();
var i:Number;
for(i=0 ; i < my_array.length ; i++)
{
my_txt[i] = blabla.createClassObject(mx.controls.TextArea,"my_txt"+i,i);
my_txt[i]._y = i * 30;
my_txt[i].text = my_array[i];
my_txt[i].editable = false;
//eval("button"+i).autoSize = "right";
my_txt[i].backgroundColor = 0xFFFFCC;
my_txt[i].color = 0xFF0000;
my_txt[i].setStyle("borderStyle", "none");
//eval("button"+i).setStyle("autoSize", "right");
//button2.setStyle("embedFonts", true);
my_txt[i].setStyle("fontFamily", "Verdana");//officina12");
my_txt[i].onRollOver= function () {
var obj:MovieClip = this;
var zz:Number = Number(obj._name.substr(6, obj._name.length));
trace (my_array[zz]);
my_txt[zz].setStyle("textDecoration", "underline");
trace ("onRollOver called");
};
my_txt[i].onRollOut= function () {
var obj:MovieClip = this;
var zz:Number = Number(obj._name.substr(6, obj._name.length));
my_txt[zz].setStyle("textDecoration", "none");
trace ("onRollOut called");
};
my_txt[i].onPress = function() {
trace ("press");
};
}
Did you know a easier way to have the same stuff ? scrolling ?
Thanks in advance.