Smokescreen Real-Time Converts Flash To HTML5

Smokescreen is a new open-source project:

Smokescreen is a new open-source project aimed at converting Flash to JavaScript/HTML5 to run where it previously couldn’t and better interoperate with webpages where it previously could.

With Smokescreen you can reach new platforms without learning any new tools; your Flash is automatically converted to JavaScript/HTML5.

Based on the iPad demo video and this online demo, I’m thoroughly impressed. It’ll be interesting to see how much ActionScript interactivity it can convert, presumably to JavaScript.

The Simplest JavaScript Show/Hide In The World

Need to hide, then show some HTML content? Maybe you need to hide some text until the user explicity asks for it? In any case, here’s a really simple way to do it:

<script type="text/javascript">
function toggle(element) {
	document.getElementById(element).style.display = (document.getElementById(element).style.display == "none") ? "" : "none";
}
</script>

Click to toggle insightful quote…

In Code We Trust

Add this to your HTML (or preferrably your globally included JavaScript file):

<script type="text/javascript">
function toggle(element) {
	document.getElementById(element).style.display = (document.getElementById(element).style.display == "none") ? "" : "none";
}
</script>

Add this to where you want to show or hide stuff:

<a href="javascript:toggle('secret')">Click to toggle…</a>

<div id="secret" style="display: none;">

Top Secret!

</div>

[Update]: Thanks to Jeff Minard for drastically optimising the code.