Imx Fix in my experience
« prev next »

November 14, 2003 10:44 AM

Flash MX Icon Philter's Flash/XML Tutorial was instrumental in getting me past the first bump in the ActionScript/XML learning curve. It's really not that hard at all, but the weirdo ways of dealing with things like symbol identifiers and addressing them has been a stumbling block. Getting past that and into the same-but-differently-named event handlers is going to be fun.

Right now, my current function for exporting and manipulating the XML doc looks like this...

	menuXml = new XML();
	menuXml.ignoreWhite = true;
	menuXml.onLoad = function() {
		menuItem = this.firstChild.childNodes;
		for (var i=0; i<menuItem.length; i++) {
			item = _root.attachMovie("itemClip", "itemClip" + i, i);
			item._x = 0;
			item._y = 21*i;
			item.itemLabel.text = menuItem[i].attributes.title;
		item2 = _root.attachMovie("poemDisplay", "poemDisplayInstance", 10);
		item2._x = 125;
		item2._y = 0;
		item2.poem.text = menuItem[0].firstChild;
I know, it's not very abstract. Also, I need to work on changing the content of the poem field based on which poen title has been clicked (which means I'll be using the onRelease() handler (instead of onmouseup() from my familiar worl of JavaScript). After that, the XML will get more attention because I have to add in the poem references (as I meantioned the other day, many poems in my selected body of work reference each other and better inform the user on the relatinships involved). That will manifest as another menu of sorts, and I'll need to use a Flash component to do that (another good lesson). Also, the poem field needs to be scrollable and that's another good lesson.

Here's a snippet of the (non DTD nor schema based) XML doc I've created so far for the project...

	<?xml version="1.0"?>
	<etext title="Spoon Riven Anthology" author="Edgar Lee Masters" 
			  published="1916" isbn="1-58734-032-1">
	<poem title="The Hill">
	Where are Elmer, Herman, Bert, Tom and Charley,
	The weak of will, the strong of arm, the clown, the boozer, the fighter?
	All, all are sleeping on the hill.
	One passed in a fever,
	One was burned in a mine,
	One was killed in a brawl,
	One died in a jail,
	One fell from a bridge toiling for children and wife-
	All, all are sleeping, sleeping, sleeping on the hill.
	Where are Ella, Kate, Mag, Lizzie and Edith,
	The tender heart, the simple soul, the loud, the proud, the happy one?--
	All, all are sleeping on the hill.
	One died in shameful child-birth,
	One of a thwarted love,
	One at the hands of a brute in a brothel,
	One of a broken pride, in the search for heart's desire;
	One after life in far-away London and Paris
	Was brought to her little space by Ella and Kate and Mag--
	All, all are sleeping, sleeping, sleeping on the hill.
	Where are Uncle Isaac and Aunt Emily,
	And old Towny Kincaid and Sevigne Houghton,
	And Major Walker who had talked
	With venerable men of the revolution?--
	All, all are sleeping on the hill.
	They brought them dead sons from the war,
	And daughters whom life had crushed,
	And their children fatherless, crying--
	All, all are sleeping, sleeping, sleeping on the hill.
	Where is Old Fiddler Jones
	Who played with life all his ninety years,
	Braving the sleet with bared breast,
	Drinking, rioting, thinking neither of wife nor kin,
	Nor gold, nor love, nor heaven?
	Lo! he babbles of the fish-frys of long ago,
	Of the horse-races of long ago at Clary's Grove,
	Of what Abe Lincoln said
	One time at Springfield.
	<poem title="Hod Putt">
	HERE I lie close to the grave
	Of Old Bill Piersol,
	Who grew rich trading with the Indians, and who
	Afterwards took the Bankrupt Law
	And emerged from it richer than ever
	Myself grown tired of toil and poverty
	And beholding how Old Bill and other grew in wealth
	Robbed a traveler one Night near Proctor's Grove,
	Killing him unwittingly while doing so,
	For which I was tried and hanged.
	That was my way of going into bankruptcy.
	Now we who took the bankrupt law in our respective ways
	Sleep peacefully side by side.
	<poem title="Ollie McGee">
	Have you seen walking through the village
	A Man with downcast eyes and haggard face?
	That is my husband who, by secret cruelty
	Never to be told, robbed me of my youth and my beauty;
	Till at last, wrinkled and with yellow teeth,
	And with broken pride and shameful humility,
	I sank into the grave.
	But what think you gnaws at my husband's heart?
	The face of what I was, the face of what he made me!
	These are driving him to the place where I lie.
	In death, therefore, I am avenged.
I don't even want to think about the actual UI of this thing yet. I should work on something consitent with the theme of the poems, but I'm probably going to be lazy and use Macromedia's "Halo" look n' feel.