» in my experience...

» home | about | contact | résumé
» archives | donate | rss syndication

»
»
Potomac river rock outcropping.


Communiblog Communiblog expressed as RSS 2.0
Here at IMX
Memes R' Us
freetheaudio2.jpg
SuperNova 1987A from 1994 to 2003
GarageBand

Media bias. « prev
Migration. » next
My flash app: Part 1
[ Posted by Dan on November 14, 2003 | 3 Comments ]

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;
	}
	menuXml.load("spoon_river_anthology.xml");
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>
	
	<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>
	
	<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.
	</poem>
	
	
	</etext>
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.

 

I'd be interested to know if you've found any good pages/books/articles on overcoming the cumbersome timeline-oriented view in Flash that you've mentioned. I have Flash on my box here (mainly so I can edit Flash stuff if the regular Flash people are not available), but I haven't had the time or inclination to wrap my head around how purely interactive apps are actually build.

-Posted by Eric on November 14, 2003 11:34 AM

The timeline model is troublesome for progamming. That is one of the reasons why the newest version of the Flash tools can be purchased in a programmer version which demotes the timeline model in favor of a more familiar event model.

Dan, you should really look at Flash Remoting. While Flash can walk an XML tree it's a real pain in the butt. Remoting almost completely eliminates that hassle. I hated working with Flash application interfaces until Remoting.

-Posted by kevin white on November 14, 2003 03:35 PM

Will do Kevin, thanks for the tip. I still need to get over the hump on the AS idiosyncracies and the syntax diffs. I plan on getting Moock's AS book this weekend.

As of this moment, I'm waiting for my companies' software aquisition people to get me my copy of MX 2004. It's been two weeks since I made the request, so I'm using the demo right now. :^(

-Posted by Dan on November 14, 2003 03:39 PM




Comment posting has been turned off because I don't have enough time and will to deal with the constant comment spamming. I'm very sorry and will fix this sometime soon (soon = before 2004 ends).

MovableType AmphetaDesk
NetNewsWire BlogTree Subscribe with Bloglines RSS Feed
Copyright © 2001 - 2003 by Daniel Kapusta