Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Poeben

macrumors 6502
Original poster
Jul 29, 2004
346
0
I'm having some trouble with this code here. A brief rundown of what I am trying to do:

1. An ASP page outputs a string containing the contents of a directory.
2. Flash imports the string to an array
3. Flash should create a textarea/link for each entry
4. This link will ultimately control the source path of movie files

So I seem to have everything working except for the textarea part. The trace functions output what I expect them to, but i can not get it to output text areas when using variables in my for.. loop. I tried using numbers instead of variables for things like position and z-order. Any ideas?


Code:
	url = new LoadVars();
	url.load("http://www.theaudiodepartment.com/demoFlash.asp");
	url.onLoad = function (success) 
	{ 
		if (success) 
		{ 
			_global.url = this.url.split("|");
			_global.url.splice(_global.url.length - 1, 1); 
		} 
		else 
		{ 
			trace("Problem loading the ASP file..."); 
		} 
	} 

for (var i:Number = 0; i < _global.url.length; i++) {
	var k:Number = (10 + i);
	var c:Number = (10 * i);
	var link = "link" + i;
	this.createTextField(link, k, c, c, 300, 30);	
	link.html = false;
	link.multiline = false;
	link.wordWrap = true;
	link.autoSize = "left";
	link.text = _global.url[i];
	trace (link);
	trace (_global.url[i]);
	trace ("layer = " + k + " coordinates = " + c);
}
 
Display List

Flash should create a textarea/link for each entry

you need to have a function to add the text area to the display list (AS3)

you do this by the addChild(); method. if you do a bit of research on that you should get it
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.