Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table in flash

Status
Not open for further replies.

stakadush

Programmer
Oct 1, 2001
195
IL
hey
i'm getting a list of events from the database (no prblem there), and i want to print it the following way:

Code:
Title    Description    Date    Flyer

here's my code:
Code:
sTextA = "loading...";
newTextA = "";
for (i = 0; i < numEvents; i++) {
	newTextA += this[&quot;eventTitle&quot;+i] + &quot;\t&quot;;
	newTextA += this[&quot;eventDesc&quot;+i] + &quot;\t&quot;;
	newTextA += this[&quot;eventDate&quot;+i] + &quot;\t&quot;;
	if (this[&quot;eventFlyer&quot;+i] != &quot;&quot;) {
		//if event has a flyer,print a link to it
		newTextA += &quot;<a href=\&quot;&quot;+ imagesDir +&quot;/&quot;+ this[&quot;eventFlyer&quot;+i] +&quot;\&quot;>flyer</a>&quot;;
	}
	newTextA += &quot;<br>&quot;;
}
sTextA = newTextA;
i populate newTextA and when that's ready i put it inside sTextA which is a dynamic text field.

everything works great but i don't want to use tabs because when a title is longer then the others the text isn't aligned correctly (like if i used a table in HTML for each column).
to make it clearer,if i could use html tables in flash the above code would've looked more or less like this:
Code:
newTextA = &quot;<table border=0 cellspacing=2 cellpadding=2>&quot;;
for (i = 0; i < numEvents; i++) {
	newTextA += &quot;<tr>&quot;;
	newTextA += &quot;<td>&quot;+ this[&quot;eventTitle&quot;+i] + &quot;</td>&quot;;
	newTextA += &quot;<td>&quot;+ this[&quot;eventDesc&quot;+i] + &quot;</td>&quot;;
	newTextA += &quot;<td>&quot;+ this[&quot;eventDate&quot;+i] + &quot;</td>&quot;;
	newTextA += &quot;<td>&quot;;
	if (this[&quot;eventFlyer&quot;+i] != &quot;&quot;) {
		//if event has a flyer,print a link to it
		newTextA += &quot;<a href=\&quot;&quot;+ imagesDir +&quot;/&quot;+ this[&quot;eventFlyer&quot;+i] +&quot;\&quot;>flyer</a>&quot;;
	} else {
		//no flyer
		newTextA += &quot;&nbsp;&quot;;
	}
	newTextA +=  &quot;</td></tr>&quot;;
}
newTextA += &quot;</table>&quot;;
this way i know the spacing will always be the same between the columns and i can allow for line breaks in the description.

so,the big question,how can i do this in flash? :)
thanks (-:
 
How about using 4 different fixed sized textfields? That way all elements would be left aligned, no matter how long any of the elements were!

Just a thought!

Regards,
wink4.gif
ldnewbie
 
can i create as many textfields, dynamically, as i want (cause i don't know how many results php is returning)?
cheers (-:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top