<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Sprockets</title>
	<atom:link href="http://ceriumsoftware.com/wp/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://ceriumsoftware.com/wp</link>
	<description>the gearhead who would be Spielberg</description>
	<pubDate>Thu, 23 Oct 2008 18:50:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>A Little Off</title>
		<link>http://ceriumsoftware.com/wp/?p=104</link>
		<comments>http://ceriumsoftware.com/wp/?p=104#comments</comments>
		<pubDate>Thu, 23 Oct 2008 18:47:06 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://ceriumsoftware.com/wp/?p=104</guid>
		<description><![CDATA[My Flash artist dabs and squints:  
Trial and error is right for an artist. Picture Renoir dabbing at his picture and stepping back to squint at it, over and over. 
Drawing  That worked for drawing and painting, for years.  
Scripts  That even worked for scripts, when those were ten-line scripts in [...]]]></description>
			<content:encoded><![CDATA[<p>My Flash artist dabs and squints:  </p>
<blockquote><p>Trial and error is right for an artist. Picture Renoir dabbing at his picture and stepping back to squint at it, over and over. </p></blockquote>
<p><strong>Drawing</strong>  That worked for drawing and painting, for years.  </p>
<p><strong>Scripts</strong>  That even worked for scripts, when those were ten-line scripts in ActionScript 2, and she could find an example to start from.</p>
<p><strong>XML</strong>  But now she buys components for the price of dinner and wine, and configures them with XML.  XML is unforgiving.  A little off, and you&#8217;re left with nothing, a wild nonsense.  Dab and squint rarely works.  </p>
<p>Yes, she could validate and test her work, step by step, as programmers do.  But that leaves behind the dab-and-squint she loves.  She makes a clockwork of colors that coil and cog and turn.  Could she work with angle brackets and descriptive words instead?  Sure.  Without joy, though, for her or us.</p>
]]></content:encoded>
			<wfw:commentRss>http://ceriumsoftware.com/wp/?feed=rss2&amp;p=104</wfw:commentRss>
		</item>
		<item>
		<title>Balsa</title>
		<link>http://ceriumsoftware.com/wp/?p=100</link>
		<comments>http://ceriumsoftware.com/wp/?p=100#comments</comments>
		<pubDate>Wed, 22 Oct 2008 13:09:34 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://ceriumsoftware.com/wp/?p=100</guid>
		<description><![CDATA[Working lately with a Flash artist on the far side of the earth, at twelve hours time difference.  We Skype to exchange files, chat, talk live.  
ActionScript 3 is traumatic to her.  Flash was whimsical until lately, and she would dash together her own ten-line script now and then, copying an example [...]]]></description>
			<content:encoded><![CDATA[<p>Working lately with a Flash artist on the far side of the earth, at twelve hours time difference.  We Skype to exchange files, chat, talk live.  </p>
<p>ActionScript 3 is traumatic to her.  Flash was whimsical until lately, and she would dash together her own ten-line script now and then, copying an example she found somewhere, and altering it by trial and error.  Trial and error is right for an artist.  Picture Renoir dabbing at his picture and stepping back to squint at it, over and over.  That worked for her ActionScript as well, until now.</p>
<p>Now she has hundreds and sometimes thousands of lines of ActionScript inside her pages, automating her effects so she can vary them faster.  </p>
<p>Vary more, not less?  Wouldn&#8217;t ActionScript and its components make her pages more uniform, more alike? </p>
<p>Not necessarily.   Much of her work has always been repetitious, a set up she does on every page before she calls in her artistry.  Now script does the tedious routine and she jumps directly to the artistry unique to each.  </p>
<p>She has mixed feelings.  I don&#8217;t recognize myself lately, she tells me.  I used to sing and dance while I worked.  </p>
<p>Right, we can&#8217;t lose that.  Only the artist knows (if anyone knows) what makes or breaks her kind of work.  </p>
<p>For example, she recently had three ambitious components on a single page, and somehow they were fighting one another.  I told her she would need two hats now.  In her artist hat, she wants to lay out everything at once, to see everything together.  In her scripting hat, she wants to add components one at a time, making sure of each combination before adding more.  </p>
<p>But some days she just wants to shut down the computer and doodle on the wall instead.  I know the feeling.  That&#8217;s when I stop help my fourth-grader build a balsa villa like the one Michelle Pfeiffer built in One Fine Day;  or she comes with me to trim tree branches around our Internet wires.</p>
]]></content:encoded>
			<wfw:commentRss>http://ceriumsoftware.com/wp/?feed=rss2&amp;p=100</wfw:commentRss>
		</item>
		<item>
		<title>You Knew This</title>
		<link>http://ceriumsoftware.com/wp/?p=95</link>
		<comments>http://ceriumsoftware.com/wp/?p=95#comments</comments>
		<pubDate>Tue, 21 Oct 2008 18:05:57 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[project management]]></category>

		<category><![CDATA[project manager]]></category>

		<guid isPermaLink="false">http://ceriumsoftware.com/wp/?p=95</guid>
		<description><![CDATA[You know this, but you&#8217;ve forgotten.  Or I had.
Two things I remembered this week, while the wife is away two weeks on a business trip, leaving Dad in charge of homework and eating and activities and injuries and whatever else might come up&#8230;  
I will remember this next time I pick a project [...]]]></description>
			<content:encoded><![CDATA[<p>You know this, but you&#8217;ve forgotten.  Or I had.</p>
<p>Two things I remembered this week, while the wife is away two weeks on a business trip, leaving Dad in charge of homework and eating and activities and injuries and whatever else might come up&#8230;  </p>
<p>I will remember this next time I pick a project manager.  First do the job you ask others to do, so you know what you&#8217;re asking of them, and how to measure their effort and result.  And how to help them do it.</p>
<p>Each kid brings home a planner now.  Each different.  Gotta size up the spec.  What did the teacher mean here?  You copied this from the board?  Your friend wrote this in your planner while you were in the bathroom?  The teacher didn&#8217;t write it, just said it?  What does he usually mean when he says that?</p>
<p>Like that project to automate the settlement of derivatives at JPMorgan.</p>
<p>Gotta plan the evening for the worst case.  What has to get done by bedtime?  What could wait till morning?  What could kill us Thursday night if not done same day, at the start of the week?</p>
<p>Your teacher could not have meant that, you say.  </p>
<p>No, no, that&#8217;s what she meant!  I&#8217;ll get in trouble!</p>
<p>Like writing that spec at Morgan.</p>
<p>Here&#8217;s a trick, you say, to make this faster for you.</p>
<p>Oh no!  We&#8217;re never gonna be done.  Can&#8217;t we just put the answer?</p>
<p>Like building from that spec at Morgan.</p>
<p>Or this, the worst.</p>
<p>No, Dad, this is easy, I have this trick.  Watch.  </p>
<p>Your eyes light up.  That&#8217;s the spirit!  That&#8217;s my girl!  No one said this had to be hard.</p>
<p>You watch.  Your heart sinks.  </p>
<p>No, not so fast, you say.  This problem is harder than it looks.  No way around that.</p>
<p>Her trick?  A trick on you.  Or is she honestly tricking herself?  (Honestly tricking?  What&#8217;s that?)  </p>
<p>She wants so badly to be done, can&#8217;t believe how much we have left, wants to find a magic wand, a trick, like the tricks you&#8217;ve been pushing all evening, but for once a trick that takes less time, not more.</p>
<p>Good job, you tell her at the end, past her bedtime, as you pack up papers and folders, getting everything in its place.  Good job when you quit crying.  Good job when you got off the floor and looked at me again.  Good job when you found all the papers you threw behind the table.</p>
<p>Like when we went for drinks after twelve hours at Morgan, and watched the clock again for the last train home&#8230;</p>
<p>The second thing?  That I knew but had forgotten?  </p>
<p>The people.  </p>
<p>However hard the trigonometry, however hard the long division or logarithms, however hard the DC circuit, however hard the derivative settlement, it&#8217;s nothing next to the people, and how hard the people are to figure out.  </p>
<p>Beginning with me, figuring out and catching all the ways I don&#8217;t want to see how long and hard this job will be, done right.  </p>
<p>Harder yet?  Remembering Yes, sometimes there actually is a trick, a shortcut you&#8217;re missing, an easy way.  Remembering as you cross the desert like Laurence of Arabia on his camel, thinking nothing can kill you, or stop you, or pull you off course&#8230;  Looking up from the sand and remembering Butch Cassidy and The Sundance Kid, leaping a cliff and riding a swift stream away from sure death, back to the joys of life.</p>
]]></content:encoded>
			<wfw:commentRss>http://ceriumsoftware.com/wp/?feed=rss2&amp;p=95</wfw:commentRss>
		</item>
		<item>
		<title>Where Worlds Collide, and Ewvils Swarm</title>
		<link>http://ceriumsoftware.com/wp/?p=60</link>
		<comments>http://ceriumsoftware.com/wp/?p=60#comments</comments>
		<pubDate>Wed, 20 Aug 2008 13:02:22 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Air]]></category>

		<category><![CDATA[CMS]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://ceriumsoftware.com/wp/?p=60</guid>
		<description><![CDATA[Worlds collide.  The component builder (me) and the artist (with paint-stained fingers) look eye-to-eye at this over one long night.  
Flash CMS.  How is it done?  How can it be done?  How make a Flash site that extends to more and more of the same over time?  As your [...]]]></description>
			<content:encoded><![CDATA[<p>Worlds collide.  The component builder (me) and the artist (with paint-stained fingers) look eye-to-eye at this over one long night.  </p>
<p><strong>Flash CMS</strong>.  How is it done?  How can it be done?  How make a Flash site that extends to more and more of the same over time?  As your client-list grows, say, and you have more of your best work to showcase, as does your client.  </p>
<p>My artist shows me a beautiful Flash website done in NYC.  She and I lived and worked in Manhattan for years, but she has gone to the far side of the International Dateline now, and I have gone to the baby farms outside the city for my young family.  </p>
<p>The stain may never leave those gnarled fingers:</p>
<p style="padding-left: 30px;">I am thinking of angels and aurochs, the secret of durable pigments, prophetic sonnets, the refuge of art&#8230;</p>
<p>Two decades of Smalltalk and Assembler and C++ have left no such trace on my fingers, unless maybe this tremor&#8230;.</p>
<p>Actually, I have never seen her fingers, not even by webcam.</p>
<p>Why can&#8217;t we do what they do, she asks.  With my work&#8230;</p>
<p>She sends me beautiful Flash sites of her own, each with a <strong>long dizzying timeline</strong> in two or three dozen layers (neatly grouped layers), a library of beautiful drawings, and a few dabbles of older ActionScript 2 scattered throughout it all.  </p>
<p>My first attempt sounds like e e cummings:</p>
<p style="padding-left: 30px;">
Suppose Flash is mostly menus&#8230;
</p>
<p style="padding-left: 30px;">
Even the Flash page that has its own menu&#8230;
</p>
<p style="padding-left: 30px;">
The page itself is a menu&#8230;
</p>
<p style="padding-left: 30px;">
A large beautiful menu&#8230;
</p>
<p style="padding-left: 30px;">
A menu does not carry your information, only points at it&#8230;
</p>
<p style="padding-left: 30px;">
As a menu does not contain <strong>Red Snapper Stew</strong>, but points at it&#8230;
</p>
<p style="padding-left: 30px;">
Suppose Flash does not carry your information, only points at it&#8230;
</p>
<p style="padding-left: 30px;">
How do you fit more Associates onto your Flash page, as <strong>they come and go over time</strong>&#8230;
</p>
<p style="padding-left: 30px;">
Or fit more press releases&#8230;
</p>
<p style="padding-left: 30px;">
Or fit more clients in your showcase&#8230;
</p>
<p style="padding-left: 30px;">
Or let your clients showcase more clients&#8230;
</p>
<p style="padding-left: 30px;">
Your Flash page can point to a limitless mix of items, because you only point to the limitless mix, you  don&#8217;t carry it&#8230;
</p>
<p style="padding-left: 30px;">
Videos, PDFs, other pages, other sites, Red Snapper Stew&#8230;
</p>
<p>To a component guy, this is an old and comfortable and well-worn distinction, and a life-saver.  You script something called <strong>&#8220;myAge&#8221;</strong> and it contains a two-digit number.   You script something called <strong>&#8220;myPicture&#8221;</strong> and no, it does not contain your picture, just the place to find your picture, a separate picture somewhere, a jpg file in its own image folder.  &#8220;myPicture&#8221; only points to it, but that&#8217;s good enough.</p>
<p>You want Flash like &#8220;myPicture&#8221; not like &#8220;myAge&#8221;.</p>
<p>Then, specifically, the web sites she brought me, good and bad:</p>
<p><strong>Scrolling:</strong></p>
<p>The HotSizzle Studio (this is not actually their name) site, for example.  </p>
<p>On their Press page (a swf):</p>
<p style="padding-left: 30px;">
<ul>
<li>each link launches full item into its <strong>own new window, not into same</strong> Press page (swf)</li>
<li>the links scroll with a custom-drawn scroller</li>
<li>the links &#8220;float&#8221; (no box, scroll on page background within invisible boundaries)</li>
</ul>
<p>You could <strong>go on forever</strong> this way, link after link, whistling like a Hobbit.</p>
<p>Not like that <strong>other site</strong>, which shall remain nameless:</p>
<p style="padding-left: 30px;">
<ul>
<li><strong>link not a link</strong>: contains entire item, not a link to a larger item </li>
<li>standard issue scroller on white box</li>
<li>white box with boundaries matching nothing</li>
</ul>
<p>Sorry, starts bad, gets worse.  Has a <strong>short life</strong>.  Not short enough though, this sad life.  </p>
<p><strong>Thumbnail Menu (Toolbar)</strong></p>
<p>The HotSizzle Client page has &#8220;toolbar&#8221; (or thumbnail menu) that races onstage like <strong>the Rockettes</strong>.</p>
<p>Each thumbnail brings up the same image at a larger size, and a caption, some text, and a link to full example at another site.</p>
<p>As with Press page, the links take us <strong>elsewhere for the full item</strong>.  Here we get a <strong>tiny fixed-format</strong> text, <strong>no scrolling</strong>:</p>
<ul>
<li>picture caption, a dozen plain-fact words</li>
<li>client:</li>
<li>produced by&#8230;</li>
<li>photography by&#8230;</li>
<li>launch link</li>
<li>alternate launch link</li>
</ul>
<p>Credits&#8230;</p>
<p>Actually, that larger image is just the first of an image sequence.  Image sequence <strong>does not scroll</strong>, however, but uses Paging Links.</p>
<p>Come to think of it, the Thumbnail Menu itself is just another variation on <strong>Paging Links</strong>&#8230;</p>
<p>You could go on forever this way, sauntering happily along.</p>
<p><strong>In Short</strong></p>
<p>From your HotSizzle example, I tell her, we might derive a HotSizzle Law for the Control and Confinement of IWVLS, where <strong>IWVLS</strong> (pronounced &#8220;oovals&#8221; or &#8220;ewvals&#8221; or maybe even &#8220;evils&#8221;) are <strong>Items of Widely Varying Length or Size</strong>.</p>
<p><strong>HotSizzle  Law for the Control and Confinement of IWVLS</strong></p>
<p>Or:</p>
<p>How to Include All Those IWVLS Without Trashing Your Beautiful Flash Design</p>
<ul>
<li>no texts or other items of widely varying length or size within the Flash page</li>
<li>instead link to such items <strong>(IWVLS) elsewhere</strong></li>
<li>list of links, however, may expand to any length</li>
<li>but each link itself is strictly fixed in length and size, not an IWVLS</li>
<li>links scroll discreetly across the page background, within invisible boundaries</li>
<li>links scroll with cool little custom scroller</li>
<li><strong>Confine IWVLS</strong>:</li>
<ul>
<li>outside the Flash page</li>
<li>each on its own page,</li>
<li>usually html, that page&#8230;</li>
<li>smaller, that page&#8230;</li>
<li>floats, that page, over the main page</li>
<li>(how many words does it take to sidestep &#8220;pop-up&#8221; ?)</li>
</ul>
</ul>
<p>Yes, I tell my artist friend, we could do what HotSizzle does, and more, and for less.</p>
<p>How?  <strong>Components</strong>.  aka <strong>Gadgets</strong>.   </p>
<p>Like those gadgets you buy now, I tell her, except that we make our own.  </p>
<p>Two kinds of <strong>Page Linking gadget</strong>, for example.  An <strong>OutOfTheBoxScroller gadget</strong>.</p>
<p>You would start your work with our gadgets.  Put your work into them (as you do now, when you buy these somewhere). </p>
<p>We make slow going for ourselves when we draw directly onto the main timeline, and then retrofit for a gadget effect.</p>
<p>By <strong>gadget effect</strong>, I mean: Easy to place any number of them, as needed.  As needed <strong>over time</strong>.</p>
<p>HotSizzle has a big gadget for their Studio page.  Their artists start with that gadget, and put their work into it.  The gadget is made with ActionScript.  The timeline for this page might be entirely empty.  At runtime an ActionScript looks at the latest XML to see how many copies of that gadget to make.  </p>
<p>As we did with our <a href="http://JohnHicks.com/FaceCards.html">FaceCards</a>.</p>
<p><strong>In Short In Short</strong> (at the risk of <strong>oversimplification</strong>):</p>
<p>To catch HotSizzle and pass them, we need:</p>
<ul>
<li><strong>no timeline</strong>: an empty single-frame timeline</li>
<li><strong>gadgets from first to last</strong>: all artistry put inside of ActionScript gadgets</li>
<li>gadgets: my invisible ActionScript (to your specs)</li>
<li>visuals: your skins, your content&#8230;</li>
</ul>
<p>Component is my middle name, though I sometimes skip it:</p>
<p>John Hicks<br />
Cerium <strong>Component</strong> Software Inc</p>
<p>No code today.  Do you get paid for making a difference, or paid for code?  Because unless you arrange to be paid for making a difference, you could write the wrong code year after year, the more the wronger, the wronger the more.  </p>
<p>Until one day you pause for a no-code what-are-we-actually-doing-here day.</p>
]]></content:encoded>
			<wfw:commentRss>http://ceriumsoftware.com/wp/?feed=rss2&amp;p=60</wfw:commentRss>
		</item>
		<item>
		<title>CMS Flash: A Blue Eye for the Duck</title>
		<link>http://ceriumsoftware.com/wp/?p=44</link>
		<comments>http://ceriumsoftware.com/wp/?p=44#comments</comments>
		<pubDate>Sat, 16 Aug 2008 18:55:37 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://ceriumsoftware.com/wp/?p=44</guid>
		<description><![CDATA[A fine Flash artist asks: 
Can I script her site so that clients can make minor adjustments without her?
Well, how minor? 
Like the changes they want again and again during development.  One pic in place of another.  Different wording in a blurb.  Like that.  
Yes, I say.  The answer is [...]]]></description>
			<content:encoded><![CDATA[<p>A fine Flash artist asks: </p>
<p>Can I script her site so that clients can make minor adjustments without her?</p>
<p>Well, how minor? </p>
<p>Like the changes they want again and again during development.  One pic in place of another.  Different wording in a blurb.  Like that.  </p>
<p>Yes, I say.  The answer is always Yes.  Yes, software can tie your shoe, if you invest enough.  Then the question shifts.  What would the client pay for that?  </p>
<p>Make or break, says the Flash artist.  They might never use this.  But they might not want my site if I&#8217;m the only one who can fix every little thing.</p>
<p>I see.  I know the feeling.  I don&#8217;t want in until I know a way out.  Don&#8217;t want to feel trapped.  </p>
<p>The client may never use this, but won&#8217;t proceed without it.  Won&#8217;t use, and won&#8217;t skip.  </p>
<p>Ok, I get that.  Understanding the tech tools is always the least of our challenges.  We think people make no sense whenever they make more sense than we can keep up with.  </p>
<p>So I research Flash CMS.  Am I wrong, or are these just Easy-Flash-Substitutes by another name?  If you start with this or that Easy, then changes are, well, Easy.  What starts Easy stays Easy.  Start there, stay there, trapped in Easy.  </p>
<p>No use to my Flash artist.  </p>
<p>She shows me a Fla with three dozen layers on the timeline, and three dozen symbols in the library.  For every symbol in the library, another few texts or whatever play along the timeline without showing in the library.  Static Text, many of them.  </p>
<p>How script her work without breaking it?  Then, how get each runtime text or picture to the right place inside the whirling shooting gallery of Flash? </p>
<p>First, promote Static Text to Dynamic Text.  Script can do nothing with Static Text.  </p>
<p>Ah, Dynamic Text can render HTML, I see.  Including the &lt;img&gt; tag.  Great then, we promote bitmaps to Dynamic Text as well, and set their htmlText to &lt;img&#8230;&gt;.   One trick to replace both pictures and texts.  </p>
<p>Now, how get new HTML to those text fields, from outside Flash at runtime?  </p>
<p>For the moment I won&#8217;t detail all my false starts.  XML, to begin with.  Easy enough to get XML into Flash at runtime, including HTML wrapped in a cheerful and welcoming &lt;![CDATA[ and ]]&gt;.</p>
<p>But Flash is a shooting gallery inside.  Your target comes and goes, on top of (inside of) something else that comes and goes, like ducks in a shooting gallery, on a tiny ferris wheel that jogs into view from one side and vanishes at the other.  The eye of your duck opens and closes as he rises and falls on the ferris wheel.  You have a blue eye for the red-eyed duck, thanks to XML, but first you must catch him.  </p>
<p>My XML told me how to find him.  I felt like a bicycle messenger in Manhattan.  What room, what building, what street.   And what hours?  No use to find the place when your guy is out.  Where then?  Find the container of the container of the container.  The Over state of a SimpleButton, for instance, with another busy container inside, and our duck among the jumble there.  And what hours?   I needed earliest frame and latest frame for that button.  </p>
<p>Yes, at last I learned to run down that duck and deliver his new blue eye.  But what if he moved to another address?  If my Flash artist edited the Fla much, I had to rewrite the directions to my duck.</p>
<p>Meanwhile I found a good demo of <a href="http://blog.circlecube.com/wp-content/uploads/2008/02/htmlToFlash.html">HTML in Flash</a>.  My Flash artist was impressed.  Hmmm, I thought, he is delivering new HTML to Flash from JavaScript.</p>
<p>Flash supplies an ExternalInterface for talking to JavaScript in the browser that runs Flash.  </p>
<p>Suppose instead of chasing down that duck to deliver a new blue eye, I taught the duck to come get it?  </p>
<p>So I wrote a TextFieldJS class.  It contains my TextField (the Dynamic Text promoted from Static Text) and the ExternalInterface.  TextFieldJS looks to the JavaScript in the browser for its runtime value.</p>
<p>That JavaScript looks like this:</p>
<link rel="stylesheet" href="http://ceriumsoftware.com/wp/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code>&lt;script type=&quot;text/javascript&quot;&gt;</code></li>
<li value="2" class="tab1 even"><code>var jsReady = false;</code></li>
<li value="3" class="tab1 odd"><code>var arrHtml = new Array();</code></li>
<li value="4" class="tab2 even"><code>arrHtml[&quot;FrontPic&quot;] = &quot;&lt;img src=&#8217;istockphoto_4383679_petri_dishes_for_medical_research.jpg&#8217; width=&#8217;380&#8242; height=&#8217;253&#8242;&gt;&quot;;</code></li>
<li value="5" class="tab2 odd"><code>arrHtml[&quot;FrontBlurb&quot;] = &quot;A multi-media presentation incorporating 14 Cultural Trends including:&lt;li&gt;Trends behaviors and attitudes&lt;/li&gt;&lt;p&gt;&lt;li&gt;Underlying psychological need states&lt;/li&gt;&lt;p&gt;&lt;li&gt;Emphasis on why? vs. what?&lt;/li&gt;&lt;p&gt;&lt;li&gt;Evolving cultural examples from food, fashion, music, tech and retail arenas&lt;/li&gt;&lt;p&gt;&lt;li&gt;Customized concepts using trends for your brand&lt;/li&gt;&lt;p&gt;&lt;li&gt;Group dynamic Trend Exercises&lt;/li&gt;&quot;;</code></li>
<li value="6" class="tab1 even"><code>function isReady() {</code></li>
<li value="7" class="tab3 odd"><code>return jsReady;</code></li>
<li value="8" class="tab1 even"><code>}</code></li>
<li value="9" class="tab1 odd"><code>function pageInit() {</code></li>
<li value="10" class="tab2 even"><code>jsReady = true;</code></li>
<li value="11" class="tab1 odd"><code>}</code></li>
<li value="12" class="tab1 even"><code>function getValue(aID) {</code></li>
<li value="13" class="tab2 odd"><code>return arrHtml[aID];</code></li>
<li value="14" class="tab1 even"><code>}</code></li>
<li value="15" class="tab0 odd"><code>&lt;/script&gt;</code></li>
</ol>
<p>And to tell Flash it&#8217;s ready:</p>
<p style="padding-left: 30px;">&lt;body onload=&#8221;pageInit()&#8221;&gt;</p>
<p>Each TextFieldJS calls getValue() with its own unique name, &#8220;FrontPic&#8221; or &#8220;FrontBlurb&#8221; in this example.</p>
<p>From the browser, JavaScript responds with new HTML for the TextField.  In the case of &#8220;FrontPic&#8221; that&#8217;s </p>
<p style="padding-left: 30px;">&lt;img src=&#8217;istockphoto_4383679_petri_dishes_for_medical_research.jpg&#8217; width=&#8217;380&#8242; height=&#8217;253&#8242;&gt;</p>
<p>Now we&#8217;re updating text and pictures inside Flash at runtime.  </p>
<p>Here&#8217;s TextFieldJS</p>
<link rel="stylesheet" href="http://ceriumsoftware.com/wp/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code>﻿package cerium {</code></li>
<li value="2" class="tab1 even"><code>import flash.display.*;</code></li>
<li value="3" class="tab1 odd"><code>import flash.text.*;</code></li>
<li value="4" class="tab1 even"><code>import flash.external.ExternalInterface;</code></li>
<li value="5" class="tab1 odd"><code>import flash.utils.Timer;</code></li>
<li value="6" class="tab1 even"><code>import flash.events.*;</code></li>
<li value="7" class="tab1 odd"><code>//sprite contains our TextField; convert TextField to symbol (MovieClip);</code></li>
<li value="8" class="tab1 even"><code>//whether TextField shows bitmap or html text;</code></li>
<li value="9" class="tab1 odd"><code>public class TextFieldJS extends Sprite {</code></li>
<li value="10" class="tab2 even"><code>//m_TextField.htmlText = ExternalInterface.call(kJavaScriptFunction,m_ID);</code></li>
<li value="11" class="tab3 odd"><code>//calls JavaScript getValue(aID) in HTML shared by entire Flash movie and every TextFieldJS therein;</code></li>
<li value="12" class="tab3 even"><code>//therefore need string ID</code></li>
<li value="13" class="tab2 odd"><code>private const kJavaScriptFunction:String = &quot;getValue&quot;;//no parens</code></li>
<li value="14" class="tab2 even"><code>public var m_ID:String;//as known to JavaScript</code></li>
<li value="15" class="tab2 odd"><code>//TextField we converted to symbol:</code></li>
<li value="16" class="tab2 even"><code>public var m_TextField:TextField;//unless Automatically Declared Stage Instances</code></li>
<li value="17" class="tab2 odd"><code>private var m_TickCount:int;</code></li>
<li value="18" class="tab2 even"><code>public function TextFieldJS() {</code></li>
<li value="19" class="tab3 odd"><code>m_TextField.border = false;</code></li>
<li value="20" class="tab3 even"><code>m_TextField.background = false;</code></li>
<li value="21" class="tab3 odd"><code>m_TextField.alpha = 1;</code></li>
<li value="22" class="tab3 even"><code>m_TextField.multiline = true;</code></li>
<li value="23" class="tab3 odd"><code>m_TextField.wordWrap = true;</code></li>
<li value="24" class="tab3 even"><code>if(ExternalInterface.available) {</code></li>
<li value="25" class="tab7 odd"><code>try {</code></li>
<li value="26" class="tab5 even"><code>//ask browser if JavaScript ready:</code></li>
<li value="27" class="tab5 odd"><code>var isJavaScriptReady:Boolean = isJavaScriptReady();</code></li>
<li value="28" class="tab5 even"><code>if (isJavaScriptReady) {</code></li>
<li value="29" class="tab6 odd"><code>getValue();</code></li>
<li value="30" class="tab5 even"><code>}</code></li>
<li value="31" class="tab5 odd"><code>else {</code></li>
<li value="32" class="tab6 even"><code>m_TextField.text = &quot;JavaScript not ready.  Starting timer.&quot;;</code></li>
<li value="33" class="tab6 odd"><code>//timer calls browser at 100ms intervals;</code></li>
<li value="34" class="tab6 even"><code>//once the browser replies ready, stop timer;</code></li>
<li value="35" class="tab6 odd"><code>m_TickCount = 0;</code></li>
<li value="36" class="tab6 even"><code>var aTimer:Timer = new Timer(100);</code></li>
<li value="37" class="tab6 odd"><code>aTimer.addEventListener(TimerEvent.TIMER,onTimerTick);</code></li>
<li value="38" class="tab6 even"><code>aTimer.start();</code></li>
<li value="39" class="tab5 odd"><code>}</code></li>
<li value="40" class="tab4 even"><code>}</code></li>
<li value="41" class="tab4 odd"><code>catch(aError:SecurityError) {</code></li>
<li value="42" class="tab5 even"><code>m_TextField.text = &quot;Security error: &quot; + aError.message;</code></li>
<li value="43" class="tab4 odd"><code>}</code></li>
<li value="44" class="tab4 even"><code>catch(aError:Error) {</code></li>
<li value="45" class="tab5 odd"><code>m_TextField.text = &quot;Error: &quot; + aError.message;</code></li>
<li value="46" class="tab4 even"><code>}</code></li>
<li value="47" class="tab3 odd"><code>}</code></li>
<li value="48" class="tab3 even"><code>else {</code></li>
<li value="49" class="tab4 odd"><code>m_TextField.text = &quot;No external interface available.&quot;;</code></li>
<li value="50" class="tab3 even"><code>}//end available</code></li>
<li value="51" class="tab2 odd"><code>}</code></li>
<li value="52" class="tab2 even"><code>private function getValue():void {</code></li>
<li value="53" class="tab3 odd"><code>m_TextField.text = &quot;&quot;;</code></li>
<li value="54" class="tab3 even"><code>m_TextField.htmlText = &quot;&quot;;</code></li>
<li value="55" class="tab3 odd"><code>m_TextField.htmlText = ExternalInterface.call(kJavaScriptFunction,getID());</code></li>
<li value="56" class="tab2 even"><code>}</code></li>
<li value="57" class="tab2 odd"><code>private function isJavaScriptReady():Boolean {</code></li>
<li value="58" class="tab3 even"><code>var isReady:Boolean = ExternalInterface.call(&quot;isReady&quot;);</code></li>
<li value="59" class="tab3 odd"><code>return isReady;</code></li>
<li value="60" class="tab2 even"><code>}</code></li>
<li value="61" class="tab2 odd"><code>private function onTimerTick(aEvent:TimerEvent):void {</code></li>
<li value="62" class="tab3 even"><code>m_TickCount++;</code></li>
<li value="63" class="tab3 odd"><code>m_TextField.text = m_TickCount.toString(10);</code></li>
<li value="64" class="tab3 even"><code>var isReady:Boolean = isJavaScriptReady();</code></li>
<li value="65" class="tab3 odd"><code>if (isReady) {</code></li>
<li value="66" class="tab4 even"><code>//done with Timer</code></li>
<li value="67" class="tab4 odd"><code>Timer(aEvent.target).stop();</code></li>
<li value="68" class="tab3 even"><code>}</code></li>
<li value="69" class="tab2 odd"><code>}</code></li>
<li value="70" class="tab2 even"><code>protected function getID():String {</code></li>
<li value="71" class="tab6 odd"><code>return &quot;no override&quot;;</code></li>
<li value="72" class="tab2 even"><code>}</code></li>
<li value="73" class="tab2 odd"><code>//method</code></li>
<li value="74" class="tab1 even"><code>}//class</code></li>
<li value="75" class="tab0 odd"><code>}//package</code></li>
<li value="76" class="tab0 even"><code>//</code></li>
<li value="77" class="tab0 odd"><code>// Copyright 2008 John Hicks, Cerium Component Software Inc.</code></li>
<li value="78" class="tab0 even"><code>//</code></li>
<li value="79" class="tab0 odd"><code>// Available under the terms of the Creative Commons Attribution-Share Alike 3.0 Unported license:</code></li>
<li value="80" class="tab0 even"><code>// http://creativecommons.org/licenses/by-sa/3.0/</code></li>
<li value="81" class="tab0 odd"><code>//</code></li>
<li value="82" class="tab0 even"><code>//     need not find TextField by traversing Display List containers with our runtime value;</code></li>
<li value="83" class="tab0 odd"><code>//     instead teach TextField, however deeply hidden, to reach out for its own runtime value;</code></li>
<li value="84" class="tab0 even"><code>//</code></li>
<li value="85" class="tab0 odd"><code>//     JavaScript in Html:</code></li>
<li value="86" class="tab0 even"><code>//</code></li>
<li value="87" class="tab0 odd"><code>//    &lt;script type=&quot;text/javascript&quot;&gt;</code></li>
<li value="88" class="tab0 even"><code>//    	var jsReady = false;</code></li>
<li value="89" class="tab0 odd"><code>//      var arrValues = new Array();</code></li>
<li value="90" class="tab0 even"><code>//      arrValues['Pic_Taste'] = &quot;&lt;img src=&#8217;TextField_Pic.jpg&#8217; width=&#8217;95&#8242; height=&#8217;69&#8242;&gt;&quot;;</code></li>
<li value="91" class="tab0 odd"><code>//      arrValues['Text_Taste'] = &quot;&lt;br&gt;&lt;p align=&#8217;right&#8217;&gt;\&quot;&lt;i&gt;So what?&lt;/i&gt;\&quot; you say?&lt;/p&gt;&quot;&#8217;</code></li>
<li value="92" class="tab0 even"><code>//    	function isReady() {</code></li>
<li value="93" class="tab0 odd"><code>//    	  return jsReady;</code></li>
<li value="94" class="tab0 even"><code>//    	}</code></li>
<li value="95" class="tab0 odd"><code>//    	function pageInit() {</code></li>
<li value="96" class="tab0 even"><code>//    		jsReady = true;</code></li>
<li value="97" class="tab0 odd"><code>//    	}</code></li>
<li value="98" class="tab0 even"><code>//    	function getValue(aID) {</code></li>
<li value="99" class="tab0 odd"><code>//    		return arrValues[aID];</code></li>
<li value="100" class="tab0 even"><code>//    	}</code></li>
<li value="101" class="tab0 odd"><code>//    &lt;/script&gt;</code></li>
<li value="102" class="tab0 even"><code>//    &lt;/head&gt;</code></li>
<li value="103" class="tab0 odd"><code>//    &lt;body bgcolor=&quot;#000000&quot; onload=&quot;pageInit()&quot;&gt;</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ceriumsoftware.com/wp/?feed=rss2&amp;p=44</wfw:commentRss>
		</item>
		<item>
		<title>Frump1 extends Frump</title>
		<link>http://ceriumsoftware.com/wp/?p=5</link>
		<comments>http://ceriumsoftware.com/wp/?p=5#comments</comments>
		<pubDate>Thu, 14 Aug 2008 13:32:11 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Jsfl]]></category>

		<guid isPermaLink="false">http://ceriumsoftware.com/wp/?p=5</guid>
		<description><![CDATA[
The art people hand you a Fla with a dozen symbols that you want to manage with a single ActionScript class.  Now what was that trick Moock described?
The symbols are Frump1, Frump2, Frump3 and so on.  They do complex things.  Lots of ActionScript.
Frump1 could never be mistaken for Frump2 by the art people.  But to [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_6" class="wp-caption aligncenter" style="width: 236px"><img class="size-full wp-image-6" title="Linkage Box" src="http://ceriumsoftware.com/wp/wp-content/uploads/2008/08/linkagebox.png" alt="My Kind of Linkage Box" width="226" height="160" /><p class="wp-caption-text">My Kind of Linkage Box</p></div>
<p>The art people hand you a Fla with a dozen symbols that you want to manage with a single ActionScript class.  Now what was that trick Moock described?</p>
<p>The symbols are Frump1, Frump2, Frump3 and so on.  They do complex things.  Lots of ActionScript.</p>
<p>Frump1 could never be mistaken for Frump2 by the art people.  But to your ActionScript they do the same things.</p>
<p>You don&#8217;t want to repeat the ActionScript each time, copy and paste, copy and paste, Frump1, Frump2&#8230;.   Later if you get something wrong you have to fix it again in every Frump.</p>
<p>No, you want Frump1 extends Frump.  The family resemblances go into Frump, the Frump ActionScript class.  That leaves Frump1 and Frump2 looking bare, just the skeleton of an ActionScript class.  Fine, if they only differ outwardly, as drawn by the art people.</p>
<p>So you click Linkage for Frump1 in the library.  Linkage links sketches to scripts, art work to ActionScript.  Puts the motors inside the dolls for Tim Burton&#8217;s Corpse Bride.</p>
<p>Frump1, the box says up top, the symbol name from the library.  Movie Clip,  you say, not Button or Graphic.  Export for Actionscript, check.  Export in frame one, check.</p>
<p>Now the empty box for Class.   You want to type:</p>
<p style="padding-left: 30px;">Class: Frump1<br />
Base Class: Frump</p>
<p>But the box below already says:</p>
<p style="padding-left: 30px;">Base Class: flash.display.MovieClip</p>
<p>There&#8217;s a way.  You&#8217;ve done it many times.  But you can also get this wrong, and go around and around for the next hour.  You&#8217;ve done that too, many times.</p>
<p>What was the trick Moock showed us?  The little rain dance you do.  Give Flash one of these and let Flash generate the other.  But which?</p>
<p>Flush that, Flash.</p>
<p>So I wrote my own Linkage Box.</p>
<p>Now, after I write the ActionScripts for Frump and Frump1 (which extends Frump), I pull up my Linkage Box.  </p>
<p>I select Frump1 in the library and select SetClass from the Command menu.</p>
<p>A box asks me to confirm</p>
<p style="padding-left: 30px;">Symbol: Frump1</p>
<p>Then in my own Linkage Box I write:</p>
<p style="padding-left: 30px;">Class: Frump1<br />
Base Class: Frump</p>
<p>&#8220;Done!&#8221;</p>
<p>So here&#8217;s the Command.  SetClass, a JavaScript inside Flash.</p>
<p>To put this on your Command list, put SetClass.jsfl in a Flash folder.  Mine is</p>
<p style="padding-left: 30px;">c:\Users\John\AppData\Local\Adobe\Flash CS3\en\Configuration\Commands</p>
<p>Two files actually.  One is SetClass.xml, which makes the box you see:</p>
<link rel="stylesheet" href="http://ceriumsoftware.com/wp/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code>&lt;dialog title=&quot;Options&quot; buttons=&quot;accept,cancel&quot;&gt;</code></li>
<li value="2" class="tab1 even"><code>&lt;grid&gt;</code></li>
<li value="3" class="tab2 odd"><code>&lt;columns&gt;</code></li>
<li value="4" class="tab3 even"><code>&lt;column /&gt;</code></li>
<li value="5" class="tab3 odd"><code>&lt;column /&gt;</code></li>
<li value="6" class="tab2 even"><code>&lt;/columns&gt;</code></li>
<li value="7" class="tab2 odd"><code>&lt;rows&gt;</code></li>
<li value="8" class="tab3 even"><code>&lt;row&gt;</code></li>
<li value="9" class="tab4 odd"><code>&lt;br /&gt;</code></li>
<li value="10" class="tab3 even"><code>&lt;/row&gt;</code></li>
<li value="11" class="tab3 odd"><code>&lt;row&gt;</code></li>
<li value="12" class="tab4 even"><code>&lt;label value=&quot;class:&quot; /&gt;</code></li>
<li value="13" class="tab4 odd"><code>&lt;textbox id=&quot;aClassName&quot; value=&quot;&quot; /&gt;</code></li>
<li value="14" class="tab3 even"><code>&lt;/row&gt;</code></li>
<li value="15" class="tab3 odd"><code>&lt;row&gt;</code></li>
<li value="16" class="tab4 even"><code>&lt;label value=&quot;base class:&quot; /&gt;</code></li>
<li value="17" class="tab4 odd"><code>&lt;textbox id=&quot;aBaseClassName&quot; value=&quot;&quot; /&gt;</code></li>
<li value="18" class="tab3 even"><code>&lt;/row&gt;</code></li>
<li value="19" class="tab2 odd"><code>&lt;/rows&gt;</code></li>
<li value="20" class="tab1 even"><code>&lt;/grid&gt;</code></li>
<li value="21" class="tab0 odd"><code>&lt;/dialog&gt;</code></li>
<li value="22" class="tab0 even"><code>&lt;!-- Copyright 2008 John Hicks, Cerium Component Software Inc. Available under the terms of the Creative Commons Attribution-Share Alike 3.0 Unported license: http://creativecommons.org/licenses/by-sa/3.0/ --&gt;</code></li>
</ol>
<p>Then SetClass.jsfl</p>
<link rel="stylesheet" href="http://ceriumsoftware.com/wp/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code>﻿function setClass() {</code></li>
<li value="2" class="even">&nbsp;</li>
<li value="3" class="tab2 odd"><code>var aDoc = fl.getDocumentDOM();</code></li>
<li value="4" class="tab2 even"><code>var aLib = aDoc.library;</code></li>
<li value="5" class="odd">&nbsp;</li>
<li value="6" class="tab2 even"><code>if(aLib.getSelectedItems().length == 0) {</code></li>
<li value="7" class="tab5 odd"><code>alert(&quot;Select library symbol!&quot;);</code></li>
<li value="8" class="tab5 even"><code>return;</code></li>
<li value="9" class="tab2 odd"><code>}</code></li>
<li value="10" class="tab2 even"><code>var aLibraryItemName = aLib.getSelectedItems()[0].name;</code></li>
<li value="11" class="tab2 odd"><code>alert(&quot;symbol: &quot; + aLibraryItemName);</code></li>
<li value="12" class="tab1 even"><code>var aInput = flash.getDocumentDOM().xmlPanel(fl.configURI + &quot;Commands/SetClass.xml&quot;);</code></li>
<li value="13" class="tab1 odd"><code>if(aInput.dismiss != &quot;accept&quot;) {</code></li>
<li value="14" class="tab5 even"><code>alert(&quot;Ok, cancel.&quot;);</code></li>
<li value="15" class="tab5 odd"><code>return;</code></li>
<li value="16" class="tab1 even"><code>}</code></li>
<li value="17" class="tab1 odd"><code>aLib.selectItem(aLibraryItemName);</code></li>
<li value="18" class="tab1 even"><code>aLib.setItemProperty(&quot;linkageExportForAS&quot;, true);</code></li>
<li value="19" class="tab1 odd"><code>aLib.setItemProperty(&quot;linkageExportInFirstFrame&quot;, true);</code></li>
<li value="20" class="tab1 even"><code>aLib.setItemProperty(&quot;linkageClassName&quot;, aInput.aClassName);</code></li>
<li value="21" class="tab1 odd"><code>aLib.setItemProperty(&quot;linkageBaseClass&quot;, aInput.aBaseClassName);</code></li>
<li value="22" class="tab1 even"><code>alert(&quot;Done!&quot;);</code></li>
<li value="23" class="tab0 odd"><code>}</code></li>
<li value="24" class="tab0 even"><code>setClass();</code></li>
<li value="25" class="tab0 odd"><code>&lt;!-- Copyright 2008 John Hicks, Cerium Component Software Inc. Available under the terms of the Creative Commons Attribution-Share Alike 3.0 Unported license: http://creativecommons.org/licenses/by-sa/3.0/ --&gt;</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ceriumsoftware.com/wp/?feed=rss2&amp;p=5</wfw:commentRss>
		</item>
	</channel>
</rss>
