Burkean
Sunday, January 27th, 2008Burkean, named after Edumund Burke: a political incrementalist.
Burkean, named after Edumund Burke: a political incrementalist.
One power you have in making custom panels for Flash (or whatever recent Adobe programs that support flash-based panels) that is almost never realized is the ability to respond to events. Does anything like this sound familiar to you: you want to update the panel every time the user changes a document or creates a new one? You want to do something when the document closes? The user moves their mouse (and not directly above the panel)? Fools all over the internet dogmatically claim that it’s impossible. It’s not. Here’s how you do it:
Writing purely in Javascript for Flash (JSFL), you might notice that you can attach events much like you can in actionscript thusly:
someCallback = function () {
alert('all your bases are belong to us');
}
fl.addEventListener("documentChanged", someCallback);
To do that in your flash panel, simply enclose that stuff in an MMExecute(); Thusly:
MMExecute("someCallback = function () { alert('all your bases are belong to us'); }");
MMExecute("fl.addEventListener("documentChanged", someCallback);");
And.. it works. Sure enough. But that’s not very interactive. I want FLASH to do something (since javascript just doesn’t do much in the authoring environment), like, say, update the display with new info. Wouldn’t it be cool if I could do this?
MMExecute("fl.addEventListener("documentChanged", SomeAS3Function);");
Alas, not possible. Holy Hell. ExternalInterface can’t even help us out here (right? I’d love to be wrong here…) But here’s what you can do. It’s not terribly pretty, but it does the job and when Adobe comes to their senses and builds AS3 JSFL communication into newer products, it would be very easy to modify the code for a more elegant solution. You can have global variables in the javascript and access them anywhere in the flash document. So, try this:
MMExecute("var updt = false");
MMExecute("updateDoc = function() { updt = true; }");
MMExecute("fl.addEventListener('documentChanged', updateDoc);");
Then, somewhere that is always looping (i.e., where stop() wasn’t called), you’ll want to add an event listener for entering the frame:
this.addEventListener(Event.ENTER_FRAME, updatey);
function updatey(event:Event) {
if(MMExecute("updt") == "true") {
// whatever you wanna do! Resurrect dinosaurs, make robots feel...
MMExecute("updt = false;");
}
}
Note, that MMExecute returns a string so, though it be boolean in javascript, it’s converted to “true” and “false” in actionscript. When dealing with arrays and such, this becomes particularly frustrating, though you must question the design of your program any time you are passing complicated objects around… think about it.
Oh, one final note. It seems the capabilities I wish existed in Flash do exist in Fireworks (?) as detailed here. I looked and looked but could not find any equivalent to IsFwCallbackInstalled for Flash. Given how many things I’ve had to discover that were not anywhere to be found on Adobe’s site and how many undocumented features there are, I can’t help but wondering if a more elegant solution is lurking below.. Do tell me if you find it, mmkay?
Here are some English rules I willfully ignore. There are more, but here are ones that come to mind. English is full of rules that were invented by Latin-obsessed pedants that don’t make the language clearer or do any of the other things rules were meant for (except annoy the lazy):
When you listen to people talk about their political opinions, one thing that becomes immediately apparent is that they don’t fit neatly with the two major political parties (here in America). That’s to be expected, but is it reasonable to expect that, on average, people’s political values will cluster around these parties? I’m not so sure.
Furthermore, I see the important kernel of political value to be what one sees as important, relative to other things, not so much what one sees as the best solution to these problems. I see people’s jobs as voting in their own best interest. People’s ideas about how best to achieve whatever their value goals are (economic stability, social justice, etc.) are quite often wrong - most people don’t understand economics or sociology or whatever. Furthermore, it’s a good idea to separate ideology from implementation so that political activists don’t get caught up with a pet solution when what really matters is their problem, regardless of solution. This is (in theory!) what politicians are for - to be experts.
So, given that political parties should be based on political values and based on what the political values of the people really are, I propose polling people on a series of questions, allowing them to rank what they see as most important. Then, use mathematical techniques to find loci (not too much unlike those used to distinguish populations, etc.) and let these be the true political parties! This data can be used to discover the right type of voting for our nation and further to justify something other than our current system!
Is anyone aware of someone having tried this before? Anyone who could point me in the right direction for what statistical techniques to use? I’m sure I couldn’t be the first person to have come up with this idea, yet it may well be quite important in determining the future of our country. It may well stem the tide of people voting against their own interests, but then again, in the wise words of ‘tater salad, “you can’t fix stupid.”
The childish love of standing on top of a mound.
Drunken flies get hypersexual : Nature News
No time for a real post today (yes, I put a lot of thought into yesterday’s). Enjoy Nature link.
Forest: Shinto Shrine::
Cunt: Panties::