<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>orangeSPLoTCH</title>
	
	<link>http://orangesplotch.com/blog</link>
	<description>Web developing in the middle of the night.</description>
	<pubDate>Mon, 17 Nov 2008 21:17:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-beta2-9665</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><image><link>http://orangeSPLoTCH.com/</link><url>http://orangesplotch.com/media/images/logo/splotch100.jpg</url><title>orangeSPLoTCH</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://orangesplotch.com/blog/feed" type="application/rss+xml" /><item>
		<title>SwfObj Version 0.6 Released</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/456428091/</link>
		<comments>http://orangesplotch.com/blog/swfobj-version-06-released/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 21:17:36 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[media library]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[swfobj]]></category>

		<category><![CDATA[swfobject]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=113</guid>
		<description><![CDATA[SwfObj just received some needed bug fixes. You can view some notes on the changes here. Or just go and <a href="http://wordpress.org/extend/plugins/swfobj/" title="Download the SwfObj WordPress plugin.">get the latest version</a>.]]></description>
			<content:encoded><![CDATA[<p class="intro">A new version of SwfObj just shipped out of the factory today. This release fixes a couple of bugs that were recently brought to my attention by users like you.</p>
<h3>Taming the big bully</h3>
<p>Apparently, unknown to me, this plugin has been inserting swfobj shortcode whenever a media object is imported into a post from the Media Library, whether it is a Flash object or not. That kind of over-aggressive attitude is not welcome around here. As a result I added a media check to the import function. Now the swfobj shortcode is only inserted when embedding Flash objects. I also sent the plugin to time-out and told him he needed to apologize to everyone for his bad behavior.</p>
<h3>Class-itis</h3>
<p>A minor bug fix that most people probably won&#8217;t notice involved cleaning up the class attribute. It was being added to both object tags as well as being placed in a defunct param tag. The class attribute is now only applied to the outer object tag and no defunct param tags to speak of.</p>
<p class="aside">I&#8217;d also like to take this chance to thank all of you who have sent in feedback both good and bad on this plugin. Thank you for taking the time to contact me so I can continue to improve the SwfObj plugin. And a very big thanks to the generous person who recently sent me a donation as well! <br />Please continue to send any bug or feature requests you have. All feedback good and bad is appreciated.</p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/456428091" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/swfobj-version-06-released/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/swfobj-version-06-released/</feedburner:origLink></item>
		<item>
		<title>Flash Player 10</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/448575913/</link>
		<comments>http://orangesplotch.com/blog/flash-player-10/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 16:50:43 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[fullscreen]]></category>

		<category><![CDATA[player]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=110</guid>
		<description><![CDATA[Flash released version 10 of their player. It comes with one feature I am especially excited about. Keyboard inputs in fullscreen mode!]]></description>
			<content:encoded><![CDATA[<p class="intro">I turned on my computer today and was greeted with a Flash Player update request. Being the curious fellow that I am, I went and checked the release notes and made a very pleasant discovery.</p>
<h3>Flash Player 10 supports keyboard inputs in fullscreen mode!</h3>
<p>Many of you may not be aware, but when Flash originally added support for fullscreen mode in version 9, they bizarrely blocked everything but mouse inputs when a user switched to full screen. This meant that all interactivity had to come from the mouse. They stated it was a security measure, <em>which may be true</em>, but seemed a bit excessive. It was a real downer for me seeing the possibilities of what could be done in fullscreen mode, and not being able to do them because of the limitations.</p>
<p>But now that is no more. I know I&#8217;m not the only one excited about this feature, so get ready to see all of your favorite games now available in fullscreen mode. And hopefully Adobe&#8217;s fears of secret fullscreen popups stealing people&#8217;s identities won&#8217;t come to fruition. We&#8217;ll have to wait and see how this feature ends up being used and abused over the next few months.</p>
<p class="update"><strong>Update: </strong> Guess I should read the fine print. While this does bring support for arrow, shift, spacebar and enter keys; it still blocks input from what they are calling &#8220;print&#8221; keys. Print keys apparently are all of the letter/number keys on the keyboard. Better than nothing, but still frustrating. No support for text blocks in fullscreen mode. Oh well.</p>
<p class="aside">There are some other great features included, so if you are that kind of nerd, go check out <a title="Flash Player 10 release notes" href="http://www.adobe.com/go/flplayer10_rn">the release notes</a> yourself. <em>(WARNING: the notes are in a large pdf that showed up in Chinese in my browser, so you may want to download it rather than viewing it in your browser)</em></p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/448575913" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/flash-player-10/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/flash-player-10/</feedburner:origLink></item>
		<item>
		<title>WordPress Media Plugin Tutorial 1: Custom media tabs</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/300616520/</link>
		<comments>http://orangesplotch.com/blog/wordpress-media-plugin-tutorial-1-custom-media-tabs/#comments</comments>
		<pubDate>Thu, 29 May 2008 15:31:47 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[api]]></category>

		<category><![CDATA[hooks]]></category>

		<category><![CDATA[media]]></category>

		<category><![CDATA[media library]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[series]]></category>

		<category><![CDATA[wordpress 2.5]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=98</guid>
		<description><![CDATA[The first part in the WordPress 2.5 Media API tutorial series. This article discusses how to customize the tabs available in the WordPress media library using hooks made available in the latest WordPress release.]]></description>
			<content:encoded><![CDATA[<p class="intro">This is the first tutorial in a series covering the media hooks available in the WordPress 2.5 API. This article shows how to add a custom media tab to WordPress&#8217;s built in media library. We&#8217;ll be using the WordPress API to do this, so no code hacks are required. All examples are based on<a href="http://wordpress.org/extend/plugins/swfobj/"> the SwfObj plugin</a> I developed. Feel free to <a href="http://wordpress.org/extend/plugins/swfobj/download/">download SwfObj</a> as a reference.</p>
<h3>WordPress hooks</h3>
<p>WordPress has conveniently added hooks to its core code, allowing developers the ability to modify content and add functionality without having to hack WordPress source files.  These include filters and actions. For these tutorials we will be using both the &#8216;<code>add_filter</code>&#8216; and &#8216;<code>add_action</code>&#8216; functions.</p>
<p>If you are unfamiliar with WordPress&#8217;s hooks, I&#8217;d recommend <a href="http://codex.wordpress.org/Plugin_API">reading their API documentation first</a>.</p>
<h3>Creating a media tab</h3>
<p>When viewing media in WordPress&#8217;s media library, there are tabs for images, video, and audio. I am going to add a &#8220;Flash&#8221; tab to the list. You can add whatever media tab you require.</p>
<p><a href="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss1.png"><img class="alignnone size-full wp-image-96" title="A screenshot of the Media Library showing the Flash tab" src="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss1.png" alt="\" width="400" height="171" /></a></p>
<p><strong>Adding file type categories is actually quite easy to do.</strong> To add a tab, you first need to know the MIME type of your category. Flash files (<code>.swf</code> files) use the &#8216;<code>application/x-shockwave-flash</code>&#8216;  MIME type. If you don&#8217;t happen to know the MIME type for your files, upload one using the WordPress media button. Once it is uploaded, WordPress displays its type right under the file name.</p>
<p>The WordPress hook to add a category tab to your library is the &#8216;<code>post_mime_types</code>&#8216; filter. WordPress uses an array called <code>$post_mime_types</code> to store all of the MIME types it lists in the Media Library. To add a new media type, you simply need to add it to this array. The following code adds a &#8220;Flash&#8221; media category that lists all .swf files in the library.</p>
<pre>function modify_post_mime_types($post_mime_types) {
    $post_mime_types['application/x-shockwave-flash'] = array('Flash', 'Manage Flash', 'Flash (%s)');
    return $post_mime_types;
}

add_filter('post_mime_types', 'modify_post_mime_types');</pre>
<p>The array that is stored in the new <code>$post_mime_types</code> entry holds the following values</p>
<ol>
<li>The title of the media type <em>(&#8217;Flash&#8217;)</em>.</li>
<li>The title to display when viewing this category in the Media Library <em>(&#8217;Manage Flash&#8217;)</em>.</li>
<li>And the title to put on the tab in the Media Library <em>(&#8217;Flash (%s)&#8217;)</em>. The <code>%s</code> is replaced by the number of items in this category.</li>
</ol>
<h3>Extras</h3>
<p>WordPress allows you to add both general and specific MIME types. You can add an &#8216;<code>application</code>&#8216; type which will show all objects whose MIME type starts with &#8216;<code>application/</code>&#8216;. To only show a specific file type, use the full MIME type, such as &#8216;<code>application/x-shockwave-flash</code>&#8216;. Make sure if you are declaring something specific, that you use the full MIME type, not just the value after the &#8216;<code>/</code>&#8216;.</p>
<p>Here are a few file types you may be interested in.</p>
<ul>
<li>PNG: <code>image/png</code></li>
<li>PDF: <code>application/pdf</code></li>
<li>ZIP: <code>application/zip</code></li>
</ul>
<p>You can also remove media types from the list if you&#8217;d like. To do this, use the <code>unset</code> function. Here is an example that removes the &#8216;audio&#8217; category from the Media Library.</p>
<pre>function modify_post_mime_types($post_mime_types) {
    unset ($post_mime_types['audio']);
    return $post_mime_types;
}</pre>
<p>And there you have it. Total control over the media types listed in WordPress using the WordPress API. In future posts we&#8217;ll discuss how to customize uploading, editing and embedding media into your posts. Please post any comments or questions you have. </p>
<p class="aside">If anyone has a better name for the &#8220;WordPress 2.5 Media API tutorial series&#8221; please let me know. That&#8217;s a monster to type out.</p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/300616520" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/wordpress-media-plugin-tutorial-1-custom-media-tabs/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/wordpress-media-plugin-tutorial-1-custom-media-tabs/</feedburner:origLink></item>
		<item>
		<title>WordPress Media API tutorial series</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/299456403/</link>
		<comments>http://orangesplotch.com/blog/wordpress-media-api-tutorial-series/#comments</comments>
		<pubDate>Wed, 28 May 2008 00:45:14 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[api]]></category>

		<category><![CDATA[hooks]]></category>

		<category><![CDATA[media]]></category>

		<category><![CDATA[media library]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[series]]></category>

		<category><![CDATA[wordpress 2.5]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=99</guid>
		<description><![CDATA[While developing the SwfObj WordPress plugin, I realized there is a large gap in documentation on WordPress media library API. In an attempt to help fill in that gap a little, I am developing a tutorial series based on the API hooks I used to develop SwfObj.]]></description>
			<content:encoded><![CDATA[<p class="intro">Recently I developed the <a href="http://orangesplotch.com/blog/swfobj/">SwfObj WordPress plugin</a>. This required using several newly available WordPress media hooks. Unfortunately, few of these are documented and it took a lot of trial and error to get things working. In the hopes of helping other developers save a few hours, I&#8217;m putting together a series of tutorials based on what I learned.</p>
<h3>Coming Soon to a Feed near you</h3>
<p>The plan is to make these short and simple. Each one will highlight one or two API hooks available in WordPress and how they work. The first in this series will be released later this week. If you are interested, <a href="http://orangesplotch.com/blog/feed/">subscribe to the feed</a> and you&#8217;ll be ready to go. Or just check in later this week</p>
<p>If you have any questions or requests, please let me know.  Feedback will drive the development of future articles. And as always, <a href="http://orangesplotch.com/freelunch">donations are very much appreciated</a>.</p>
<p class="aside">I am also looking for sponsors of this series if anyone is interested. All the articles will be published freely here irregardless of whether I get any funding. It doesn&#8217;t hurt to ask, <em>I hope</em>.<br />If interested, <a href="http://orangesplotch.com/contact/">contact me for terms</a>.</p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/299456403" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/wordpress-media-api-tutorial-series/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/wordpress-media-api-tutorial-series/</feedburner:origLink></item>
		<item>
		<title>SwfObj version 0.3 released</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/296814623/</link>
		<comments>http://orangesplotch.com/blog/swfobj-version-03-released/#comments</comments>
		<pubDate>Fri, 23 May 2008 20:28:19 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Site]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[swfobj]]></category>

		<category><![CDATA[swfobject]]></category>

		<category><![CDATA[wordpress 2.5]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=93</guid>
		<description><![CDATA[A new release of the SwfObj WordPress plugin just in time for Memorial Day. So go grill up some hamburgers and when you get a chance, update your plugins. It seems SwfObj is all I've been talking about for the last little while.]]></description>
			<content:encoded><![CDATA[<p class="intro">Last night I quietly released version 0.3 of the SwfObj WordPress plugin. The plugin is making steady progress towards an official 1.0 release. I&#8217;ll touch on the new features, but try to keep this post short so you can enjoy your Memorial Day weekend.</p>
<h3>Upgraded interface</h3>
<p>If you use the media toolbar to insert Flash objects into your posts, you will now find a lot more options available for customizing the embedded object. These include width, height, alignment, id, class, allowfullscreen, etc. Any options filled in will be included in the auto-generated shortcode when the object is inserted in the post.</p>
<p><a href="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss3.png"><img class="alignnone size-full wp-image-95" title="swfobj_ss3" src="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss3.png" alt="SwfObj plugin screenshot showing advanced options hidden." width="400" height="326" /></a></p>
<p>In an effort to keep the library interface clean and practical, the advanced options are tucked away by default. If you want to use them to embed an object, click &#8220;Show Advanced Options&#8221; and they magically appear. The interface is still a bit cluttered, but its the best I&#8217;ve got for now.</p>
<p><a href="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss2.png"><img class="alignnone size-full wp-image-94" title="swfobj_ss2" src="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss2.png" alt="SwfObj plugin screenshot showing media library view." width="400" height="328" /></a></p>
<h3>The webpage</h3>
<p><a href="http://orangesplotch.com/blog/swfobj/">SwfObj&#8217;s official web page</a> also got an upgraded look. It has two fat download and donate buttons. I also added a &#8220;recent news&#8221; blurb, so you can quickly see any new posts about the plugin. <strong>Pretty exciting.</strong> Ok, not really.</p>
<h3>The future</h3>
<p>There is still more to be done on SwfObj. Not all of the Flash parameters are supported yet. The code could use some polishing. And lots of testing and bug fixing. If anyone has any problems or feature requests, please let me know.</p>
<p>Hopefully I&#8217;ll get some translations in as well. <em>Any takers?<br />
</em></p>
<p>Updates probably won&#8217;t be as frequent as the last two releases, though. Most of the major features are in now. Rather than playing with plugins all the time, I think it&#8217;s time to start doing some actual Flash.</p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/296814623" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/swfobj-version-03-released/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/swfobj-version-03-released/</feedburner:origLink></item>
		<item>
		<title>SwfObj Plugin Unleashed</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/294083245/</link>
		<comments>http://orangesplotch.com/blog/swfobj-plugin-unleashed/#comments</comments>
		<pubDate>Tue, 20 May 2008 07:44:12 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[SPLoTCH]]></category>

		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[swfobj]]></category>

		<category><![CDATA[wordpress 2.5]]></category>

		<category><![CDATA[wp plugin]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=92</guid>
		<description><![CDATA[A new version of the SwfObj WordPress plugin was released today. Come see what's new.]]></description>
			<content:encoded><![CDATA[<p class="intro">It&#8217;s been almost one week since I released the SwfObj plugin for WordPress. In that time its been downloaded 65 times and 2 people have contacted me about it. In my opinion that&#8217;s not too shabby. So now what?</p>
<p><strong>SwfObj is overdue for an overhaul</strong>. As I stated in my <a href="http://orangesplotch.com/blog/swfobj-wordpress-plugin/">original release announcement</a>, the purpose of this plugin is to take the pain out of uploading and embedding Flash media in WordPress. Right now it makes it easier to embed content, but you still have to upload the Flash files to the server manually, figure out their URLs, and then type out the shortcode. This falls far short of being painless.</p>
<p>Today SwfObj is taking a step in the right direction. Expanded features now make uploading and embedding Flash content into WordPress just a little easier. <strong>Still not painless, but closer.</strong></p>
<h3>Upload Flash directly</h3>
<p>When you install and enable the latest SwfObj release, a new media button will appear in your post editor. This allows you to upload new Flash content to your WordPress Media Library for embedding. Additionally you can view all of the Flash content currently in your library and insert it into your post. Simply click on the &#8220;Media Library&#8221; to see all of your Flash objects.</p>
<p>Inserting Flash content from the library injects the proper shortcode into the post or page you are editing. Currently it only embeds the &#8220;<code>src</code>&#8221; and &#8220;<code>alt</code>&#8221; properties. Any additional properties such as dimensions have to be added manually. Future releases will auto-embed more properties.</p>
<h3>Multiple language support</h3>
<p>This release also adds international support for the SwfObj plugin. If anyone wants to translate this into their native language, please do. I&#8217;d love to have this available in several languages.</p>
<h3>Try it out</h3>
<p>If you use Flash a lot in your posts and are looking for an easier way to upload and embed them, this plugin may be something you&#8217;ll want.  Feel free to download <a title="SwfObj WordPress Plugin" href="http://wordpress.org/extend/plugins/swfobj">the latest version of the SwfObj plugin</a> and try it out. Let me know if you have any questions or comments. I&#8217;d love to hear about any features you&#8217;d like to see, or problems you have encountered while using it. All feedback, <em>good and bad</em>, is welcome.</p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/294083245" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/swfobj-plugin-unleashed/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/swfobj-plugin-unleashed/</feedburner:origLink></item>
		<item>
		<title>SwfObj Wordpress Plugin</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/289217408/</link>
		<comments>http://orangesplotch.com/blog/swfobj-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 13 May 2008 06:08:27 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[embed]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[shortcode]]></category>

		<category><![CDATA[swf]]></category>

		<category><![CDATA[swfobj]]></category>

		<category><![CDATA[swfobject]]></category>

		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=75</guid>
		<description><![CDATA[I've just released the <a href="http://wordpress.org/extend/plugins/swfobj/">SwfObj WordPress plugin</a>. It's already saving me loads of time embedding Flash objects in my posts. Hopefully it can be of value to you, too.]]></description>
			<content:encoded><![CDATA[<p class="intro">I am currently developing a <a href="http://wordpress.org/extend/plugins/swfobj/" title="SwfObj WordPress plugin">WordPress Plugin</a> for those who are Flash Fiends like myself.</p>
<h3>Embedding Flash was a pain</h3>
<p>As you may have noticed, I embed a lot of Flash files into my blog posts. Embedding Flash content into WordPress posts is a tedious process at best. There are several options and parameters, all needing to be entered correctly or the object won&#8217;t display properly. Add to that the complexity of multiple browser support and you&#8217;ve got quite a mess, especially if you are concerned with valid XHTML markup.</p>
<p>Up until this point, I&#8217;ve been copy/pasting the object code into my posts. First I ftp the Flash file onto my server. Then I pull up a past post that had Flash in it. Then I copy that code to my new post, and edit the items that have changed such as the src and the object dimensions. Finally I save the post and preview it to see if I entered everything correctly. This takes way longer than it should.</p>
<h3>Some recent developments</h3>
<p>Last year I came across the SwfObject project. It is a great tool to simplify embedding Flash content. The markup is XHTML compliant, but still works most browsers, including IE6.</p>
<p>Flash forward to last month, when WordPress 2.5 was released. The new release includes the handy shortcode feature as well as improved media support with a nice API.</p>
<h3>Flash magic voodoo</h3>
<p>Combine the two and for me, you&#8217;ve got something magical. Assuming I&#8217;m not the only person who embeds heaps of Flash content into their posts, I decided to put together this new plugin: <a href="http://wordpress.org/extend/plugins/swfobj/"><strong>SwfObj</strong></a>.</p>
<p>While there are still a lot of features in the works, this initial version has significantly simplified the process of embedding Flash into my posts. A simple shortcode, such as the following, is all the markup I need to embed them. Here is the new shortcode, and the resulting embedded object.</p>
<blockquote><p><code>&#91;swfobj src="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" width="500" height="196" allowfullscreen="true" required_player_version="9.0.0"]</code>
</p></blockquote>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="500" height="196" class="test">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" width="500" height="196" allowfullscreen="true">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p><em>Admittedly this shortcode example isn&#8217;t that short. But it sure is a lot shorter and easier to read than the resulting embedded object code.</em></p>
<pre>
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="500" height="196">
  &lt;param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" />
  &lt;param name="allowFullScreen" value="true" />
  &lt;!--&#91;if !IE]--&gt;
  &lt;object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" width="500" height="196" allowFullScreen="true">
  &lt;!--&#91;endif]--&gt;

    &lt;p>The Flash plugin is required to view this object.&lt;/p>
  &lt;!--&#91;if !IE]--&gt;
  &lt;/object>
  &lt;!--&#91;endif]--&gt;
&lt;/object>
</pre>
<p class="aside">
For more details on the plugin, visit the shiny new <a href="http://orangesplotch.com/blog/swfobj">SwfObj WordPress plugin homepage</a>. Feel free to <a href="http://wordpress.org/extend/plugins/swfobj/">download</a> it and use it on your own site. Any feedback is welcome.</p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/289217408" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/swfobj-wordpress-plugin/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/swfobj-wordpress-plugin/</feedburner:origLink></item>
		<item>
		<title>Your site is kind’a ugly</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/281926384/</link>
		<comments>http://orangesplotch.com/blog/your-site-is-kinda-ugly/#comments</comments>
		<pubDate>Fri, 02 May 2008 02:10:34 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[SPLoTCH]]></category>

		<category><![CDATA[Site]]></category>

		<category><![CDATA[flowers]]></category>

		<category><![CDATA[redesign]]></category>

		<category><![CDATA[ugly]]></category>

		<category><![CDATA[wife]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=68</guid>
		<description><![CDATA[Due to recent events (i.e. mockery), I'll be redesigning the look of this, here site.]]></description>
			<content:encoded><![CDATA[<p class="intro">Due to recent events <em>(i.e. mockery)</em>, I&#8217;ll be redesigning the look of this, here site.</p>
<p>Yesterday, while driving across town with my wife, we engaged in a little conversation. It&#8217;s something we like to do to pass the time. Usually I can&#8217;t remember much of anything that is discussed during these activities. I could try to blame this on the fact that I am concentrating on driving. However, that theory fails to explain why I have the same time recalling conversations that have happened when I was sitting on the couch at home.</p>
<p>However, yesterdays discussion is still replaying in my mind today. Even stranger, I think my wife&#8217;s comments might actually motivate me to take action. This is very odd indeed, when considering the proportion of times she&#8217;s asked me to clean up my mess to the times I&#8217;ve cleaned up my mess.</p>
<p>So what was it that she said? I believe her exact words were:</p>
<blockquote><p>No offense, but your site is kind&#8217;a boring and ugly. Maybe you should put some flowers on it.</p></blockquote>
<p>While there won&#8217;t be any flowers added, there will be some changes coming to the site. There are a lot of things I don&#8217;t like about the current layout. I&#8217;ve added a lot of content since it was first pieced together and most of that is hidden away in the archives. That and it&#8217;s &#8220;kind&#8217;a ugly&#8221;.</p>
<p>So if you notice things moving around, or colors changing randomly, now you know why. I&#8217;ll be hacking things out spontaneously over the next little while until I get the site to a place I&#8217;m happy with. At least until my wife stops mocking me.</p>
<p class="aside">Maybe I will put some flowers on it.</p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/281926384" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/your-site-is-kinda-ugly/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/your-site-is-kinda-ugly/</feedburner:origLink></item>
		<item>
		<title>Actionscript Tutorial: Starry Night</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/280114228/</link>
		<comments>http://orangesplotch.com/blog/actionscript-tutorial-starry-night/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 14:11:27 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[actionscript 3.0]]></category>

		<category><![CDATA[night sky]]></category>

		<category><![CDATA[star]]></category>

		<category><![CDATA[twinkle]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=28</guid>
		<description><![CDATA[This is a very basic Actionscript tutorial that will show you how to make a sky full of twinkling stars. Everything for this tutorial will be done in Actionscript, using Actionscript 3.0. If you're interested, jump on in and check it out.]]></description>
			<content:encoded><![CDATA[<p class="intro">This is a very basic Actionscript tutorial that will show you how to make a sky full of twinkling stars. Everything for this tutorial will be done in Actionscript, using Actionscript 3.0. It is targeted at novices, but hopefully pros and newbies alike can get something from it. Make a wish on the first star you see and maybe your dreams will come true.</p>
<h3>The first star I see tonight</h3>
<p>First we need to make our black sky. This is going to be a black rectangle that covers the entire area of the <code>Stage</code>. We&#8217;ll draw this using a Sprite, which is a type of object that can hold graphics, such as black rectangles. Here is how simple it is to make night.</p>
<pre>bg = new Sprite();
bg.graphics.beginFill(0);
bg.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
addChild(bg);</pre>
<p>The last line adds the <code>bg</code> <code>Sprite</code> to the <code>Stage</code>. This is what triggers the Flash player to actually render the object. Until you put this line in, <code>bg</code> is invisible.</p>
<p>Next we are going to need to draw a star. The stars are just tiny circles, so there isn&#8217;t too much to drawing them. Make the star by creating a new <code>Sprite</code>, drawing a white circle in it with a 2 pixel radius, positioning it, then adding it to the <code>Stage</code> so it will be displayed. I&#8217;ve made the positioning random so every time you run it, your star will be in a different place. The following Actionscript is all we need to dynamically draw our star.</p>
<pre>var star:Sprite = new Sprite();
star.graphics.beginFill(0xFFFFFF);
star.graphics.drawCircle(0, 0, 2);
star.x = Math.random() * stage.stageWidth;
star.y = Math.random() * stage.stageHeight;
addChild(star);</pre>
<p class="note">In all of the following examples, you can click on the image to regenerate it.</p>
<p>Here is the resulting dynamically created star.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_1" width="500" height="90">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/lonestar.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/lonestar.swf" width="500" height="90">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<h3>The Milky Way</h3>
<p>One star is nice and all, but what we really want is a whole sky full of stars. The Universe has bajillions of stars, but for this tutorial we&#8217;ll just make 100. The nice thing about doing this in Actionscript is that we can make 200 stars just as easily. All you need to do is change one number in the code.</p>
<p>To make lots of stars, we put the star creation in a for loop and run it as many times as we want stars. It may surprise you just how easy it is to make lots of stars now that we know how to make just one. Here&#8217;s the code with just two extra lines.</p>
<pre><strong>for (var i:Number = 0; i&lt;100; ++i) {</strong>
    var star:Sprite = new Sprite();
    star.graphics.beginFill(0xFFFFFF);
    star.graphics.drawCircle(0, 0, 2);
    star.x = Math.random() * stage.stageWidth;
    star.y = Math.random() * stage.stageHeight;
    addChild(star);
<strong>}</strong></pre>
<p>And you&#8217;ve got a starry sky.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_2" width="500" height="90">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/starrynight_samesize.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/starrynight_samesize.swf" width="500" height="90">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p>Now they say variety is the spice of life, but all of these stars are exactly the same, just in a different location. What we want to do now is make them all different sizes. I am going to vary mine between a radius of 0.25 and 1.5, but you can feel free to make yours whatever size you want. Changing the size of the stars to be random is again, very easy. We just need to change one line of code.</p>
<pre>for (var i:Number = 0; i&lt;100; ++i) {
    var star:Sprite = new Sprite();
    star.graphics.beginFill(0xFFFFFF);
    star.graphics.drawCircle(0, 0, <strong>((Math.random() * 1.25) + 0.25)</strong>);
    star.x = Math.random() * stage.stageWidth;
    star.y = Math.random() * stage.stageHeight;
    addChild(star);
}</pre>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_3" width="500" height="90">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/starrynight_notwinkle.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/starrynight_notwinkle.swf" width="500" height="90">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<h3>Twinkle, twinkle little star</h3>
<p>To make this starry sky even better, you can add a little twinkle effect. I&#8217;ve been playing around with this quite a bit to try and get just the right effect. You want them to flicker, but not too much. It is a sweet spot between not being able to notice the twinkle, to it being way too obvious and annoying.</p>
<p>The effect is by adding an <code>ENTER_FRAME</code> event handler to each star <code>Sprite</code>. The <code>ENTER_FRAME </code>event handler is a function that is called every frame of your movie. To make the stars twinkle I randomly change their their <code>alpha</code> and size very subtly. Also, I keep the value within a certain limit so that the stars don&#8217;t disappear on me. Play around with the effect on your own to find your sweet spot.</p>
<pre>public function Twinkle(event:Event):void {
    // get the current star to tweak
    var _self:Sprite = Sprite(event.currentTarget);

    // change the alpha and size of the star
    _self.alpha += Math.random() * 0.02 - 0.01;
    _self.scaleX = _self.alpha * 0.5 + 0.5;
    _self.scaleY = _self.alpha * 0.5 + 0.5;

    // do some bounds checking
    if (_self.alpha &lt; 0.5) _self.alpha = 0.5;
    if (_self.alpha &gt; 1) _self.alpha = 1;
}</pre>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_4" width="500" height="196">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" width="500" height="196" allowfullscreen="true">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<h3>To infinity and beyond</h3>
<p>You can use this wherever you want to throw some stars into a scene. If you don&#8217;t want the stars, or the night sky to cover the entire stage, simply change the bounds from the stage.stageWidth and stage.stageHeight to whatever you want them to be. Or put other elements on top of this, like mountains, or a cityscape or whatever you feel like. The possibilities are as numberless as the stars <em>(sorry, that was really pathetic)</em>.</p>
<p>Feel free to download the full source files used to make this. Included is a bonus full screen enabled version.<strong> Now that&#8217;s exciting!</strong></p>
<ul id="starrynight-downloads" class="downloads">
<li><a title="Download the source files used in this tutorial." type="zip" href="http://orangesplotch.com/files/starrynight.zip">Starry Night Actionscript 3.0 source files.</a></li>
</ul>
<p class="aside">And that&#8217;s the end of our tutorial. Hope you enjoyed your stay. Feel free to <a href="#discussion">leave any comments or questions</a> you have. <strong>Thanks!</strong></p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/280114228" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/actionscript-tutorial-starry-night/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/actionscript-tutorial-starry-night/</feedburner:origLink></item>
		<item>
		<title>Flash Fullscreen Fun</title>
		<link>http://feeds.feedburner.com/~r/orangesplotch/~3/276397761/</link>
		<comments>http://orangesplotch.com/blog/flash-fullscreen-fun/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 20:09:56 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[actionscript 3.0]]></category>

		<category><![CDATA[AS3]]></category>

		<category><![CDATA[fullscreen]]></category>

		<category><![CDATA[hyperspace]]></category>

		<category><![CDATA[star field]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=58</guid>
		<description><![CDATA[While delving deep into the mysteries of Actionscript 3.0, I came across something that really made me smile. Apparently the Flash Player 9.x allows for FullScreen mode. I must have been living in a cave for the past couple of years. How have I never seen this before?]]></description>
			<content:encoded><![CDATA[<p class="intro">While delving deep into the mysteries of Actionscript 3.0, I came across something that really made me smile. Apparently the Flash Player 9.x allows for FullScreen mode. I must have been living in a cave for the past couple of years. <strong>How have I never seen this before?</strong></p>
<div class="object-wrapper">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_5" width="500" height="250">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/fullscreen.swf" />
      <param name="allowfullscreen" value="true" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/fullscreen.swf" width="500" height="250" allowfullscreen="true">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br />
<em>Click anywhere on the video to go to fullscreen mode.</em></div>
<p>The great thing is how easy it is to do. Here is a handler that turns fullscreen mode on and off.</p>
<pre>private function FullScreenSwitch(event:Event):void {
  if (StageDisplayState.FULL_SCREEN == stage.displayState) {
    stage.displayState = StageDisplayState.NORMAL;
  }
  else {
    stage.displayState = StageDisplayState.FULL_SCREEN;
  }
}</pre>
<p>There are a few caveats to the system and one of them is really frustrating.</p>
<p><strong>First:</strong> fullscreen mode can only be set by the user interacting with something, such as clicking with the mouse. Fullscreen mode can&#8217;t just be dynamically turned on without any user interaction. Fair enough. I think I&#8217;d be pretty ticked if web sites had banner ads that suddenly went fullscreen on their own.</p>
<p><strong>Second:</strong> a little text blurb shows up when the video switches to text mode telling the user they can switch it off by hitting the Escape key. This fades away after a couple of seconds. Again, I think this is great. You don&#8217;t want someone who accidentally makes a Flash video full screen to not be able to get out of it.</p>
<p><strong>Third:</strong> and very annoyingly, all keyboard inputs are blocked in fullscreen mode. <em>What!?!</em> Apparently Adobe thinks it is a huge security risk to allow keyboard input while in fullscreen mode. I don&#8217;t understand this at all, and it totally ruins most of the great ideas I had for implementing fullscreen mode.  Can you imagine how much cooler games would be if they were in fullscreen. Too bad! Unless they are mouse only games, you can&#8217;t play them in fullscreen. Maybe that&#8217;s why I hadn&#8217;t heard of this until recently. Better than nothing, though.</p>
<p class="aside">For more detailed info on how it all works, check out this <a href="http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode_02.html">fullscreen tutorial over at Adobe</a>.</p>
<img src="http://feeds.feedburner.com/~r/orangesplotch/~4/276397761" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/flash-fullscreen-fun/feed/</wfw:commentRss>
		<feedburner:origLink>http://orangesplotch.com/blog/flash-fullscreen-fun/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.695 seconds -->
