this.creatTextField() help
- January 1, 2010
- 1 reply
- 649 views
Hello;
I am trying to create a tabular layout of textFields by running a function that takes a list
of strings and uses a for loop to create text fields. But as I have it it is not working.
Here is a snippet of code:
function buildPLayList(playListTitles:String):Void
{
var playList:Array = new Array()
playList = playListTitles.split('|');
trace(playList) // -> expected output
var strOut:String = '';
var origin_x:Number = 75;
var origin_y:Number = 64;
var baseWdth:Number = 25;
var baseHght:Number = 30;
var i:Number = 0;
for(i = 0; i < playList.length; i++)
{
playListInfo = new Object();
playListInfo.name = "INFO"+i;
// x, y, width, height
this.createTextField(playListInfo.name, this.getNextHighestDepth(), 0, 0, 0, 0) // <<--
playListInfo.name._x = origin_x // <<-- since --.name is a string, I don't think this is working
playListInfo.name._y = origin_y*(i+1)
playListInfo.name._width = baseWdth
playListInfo.name._height = baseHght
playListInfo.name.text = "Info";
playListInfo.name.setTextFormat(playListInfoForm);
playListInfo.name.onPress = function()
{
var target = playListPaths;
fscommand("alert", playList)
// call javascript alert(playList)
}
playListInfo.name.onRollOver = function()
{
// change text color
}
playListInfo.name.onRollOut = function()
{
// change text color to original
}
// similar code for two more textFields in each row
strOut += playListInfo.name.text+" : "+playListPlay.name.text+" : "+playListTitle.name.text+"\n"; // **
//strOut += playListInfo.name+" : "+playListPlay.name+" : "+playListTitle.name+"\n"; // trace produces expected output
}
trace(strOut) // ** -> undefined : undefined : undefined
}
Is there a way to do this? I can use html, and have done it successfully in a loop, but rollover effects seem to be a lot
more obscure using styleSheets.
Thank you for time and attention
Jk