First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Tiran Dagan | Website: http://www.TiranDagan.com

The synopsis of ths FLA file attached to this tutorial is as follows:

1. Frame one -  we load the XML file, and read the various tags supporting the desired structure of the table.

2. Frame two - Position the single column and last column objects outside the work area. Duplicate the column objects for each column specified in the XML file. Position labels at the top of the column, and presto!

Here's the code for frame one (reading the XML file): 

var ColumnDefs = new Array();
var numColumns;

tableXML=new XML();
// read the XML file. This can be replaced with a url to an ASP which generates the
// XML file based on a SQL database query, for example:
// tableXML.load ("/tablestruct.asp?getrecs=5")
tableXML.onLoad = loadedXML;
stop ();

function loadedXML()
	var columnProperties = new Array();

	allText = tableXML.firstChild;
	for (i=0;i<numcolumns;i++) {

	// iterate between the  tags
		if (columndef.nodeName <> "columndef") {
			trace ("Error!: Was expecting a 'columndef' field, but not found");
			trace ("Element name: " + columndef.nodeName);
		} else {
			// Each element of ColumnDefs is an array of the
			// XML tags defining the column properties.
			// We are creating an associative array which allows 
			// us to address the title of column 3 of the table as:
			// ColumnDefs[2]["title"]
			ColumnDefs.push ();
			ColumnDefs[i]=new Array();
			for (j=0;j<columndef.childNodes.length;j++) {
				eval("node_" + attr)=columndef.childNodes[j].firstChild;

» Level Advanced

Added: 2001-10-01
Rating: 7 Votes: 38
(10 being the highest)
» Author
No details available.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.