<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Theo Stråhlén &#187; Code</title>
	<atom:link href="http://theodesign.se/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://theodesign.se</link>
	<description>The blog and portfolio of Theo Stråhlén. Currently a student at Hyper Island.</description>
	<lastBuildDate>Thu, 27 Jan 2011 21:05:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iPhone simulation</title>
		<link>http://theodesign.se/iphone-simulation/</link>
		<comments>http://theodesign.se/iphone-simulation/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 20:59:19 +0000</pubDate>
		<dc:creator>theo</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[simulation]]></category>

		<guid isPermaLink="false">http://theodesign.se/?p=298</guid>
		<description><![CDATA[Almost two months ago I did this little thing. I was looking at some CSS3 animations and I wanted to try something out so I did this iPhone simulation. It&#8217;s basically a bunch of icons in a grid just like &#8230; <a href="http://theodesign.se/iphone-simulation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-303" href="http://theodesign.se/iphone-simulation/iphone/"><img class="alignnone size-full wp-image-303" title="iphone" src="http://theodesign.se/wp-content/uploads/2011/01/iphone.jpg" alt="iPhone Simulation with CSS3 and jQuery" width="800" height="400" /></a></p>
<p>Almost two months ago I did this little thing. I was looking at some CSS3 animations and I wanted to try something out so I did this iPhone simulation. It&#8217;s basically a bunch of icons in a grid just like on the iPhone and you can click and hold and the icons starts wiggle and you can move them around and delete them. This is made with very little jQuery and some CSS3. Works best in Chrome, as always.</p>
<p><a title="iPhone Simulation CSS3" href="http://nyc-kids.com/iphone/" target="_blank">http://nyc-kids.com/iphone/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theodesign.se/iphone-simulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3: Dynamic Positioning Class</title>
		<link>http://theodesign.se/as3-dynamic-positioning-class/</link>
		<comments>http://theodesign.se/as3-dynamic-positioning-class/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 09:17:32 +0000</pubDate>
		<dc:creator>theo</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Hyper Island]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[henrik porseland]]></category>
		<category><![CDATA[positioning]]></category>

		<guid isPermaLink="false">http://theodesign.se/?p=244</guid>
		<description><![CDATA[Dont have time reading all this? Download source here For your fullscreen flash website to look as you want in every resolution you need to use dynamic positioning of your movieclips. I and Henrik Porseland put together this yesterday, most &#8230; <a href="http://theodesign.se/as3-dynamic-positioning-class/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://theodesign.se/as3-dynamic-positioning-class/"><img class="alignnone size-full wp-image-245" title="Screen shot 2010-10-21 at 4.12.01 PM" src="http://theodesign.se/wp-content/uploads/2010/10/Screen-shot-2010-10-21-at-4.12.01-PM.png" alt="" width="790" height="300" /></a></p>
<p>Dont have time reading all this? <a href="http://theodesign.se/wp-content/uploads/2010/10/DynamicPositioning.zip">Download source here</a></p>
<p>For your fullscreen flash website to look as you want in every resolution you need to use dynamic positioning of your movieclips. I and <a title="Henrik Porseland" href="http://porseland.com" target="_blank">Henrik Porseland</a> put together this yesterday, most for our own sake but also to share with others. It&#8217;s a simple class where you can place object just by typing &#8220;left&#8221; and &#8220;top&#8221; och &#8220;middle&#8221; and &#8220;bottom&#8221;. Let me show you some examples of what you can do!</p>
<p><span id="more-244"></span></p>
<p>First of all you need to import the class into your project and set some stage properties. Do that by this code:</p>
<pre>import com.blacksmiths.DynamicPositioning;
var position:DynamicPositioning = new DynamicPositioning();
var setPosition = position.setPos;

stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;</pre>
<p>Now you need a resize handler for your object to change position when window is resized. Add this to the bottom your code:</p>
<pre>function resizeHandler(e:Event){
	// Nothing yet
}
stage.addEventListener(Event.RESIZE, resizeHandler);
stage.dispatchEvent(new Event(Event.RESIZE));</pre>
<p>To position your objects just add this in your resizeHandler function:</p>
<pre>position.setStageSize(stage.stageWidth,stage.stageHeight);

setPosition(box1, "left", "top");
setPosition(box2, "right", "top");
setPosition(box3, "left", "bottom");
setPosition(box4, "right", "bottom");
setPosition(box5, "middle", "middle");</pre>
<p>This code will place the objects exactly like the image on top of this post. One in every corner and one i the middle. Just like the code saids!<br />
You can tweak it how you want it. Place by number or word or both. Here is some examples how you can use the Class:</p>
<pre>setPosition(box, "middle", "bottom-20"); // center and 20px from bottom
setPosition(box, "right-100", 20); // 100px from right and 20px down
setPosition(box, "right", "top"); // in the top right corner</pre>
<p>For this to work you need to download the class, for an example just download the source.<br />
It&#8217;s very easy and quick to use. Please try it out and we&#8217;ll be happy for some feedback.</p>
<p><a class="source" href="http://theodesign.se/wp-content/uploads/2010/10/DynamicPositioning.zip">Download source for DynamicPositioning</a></p>
<p>Thank you!</p>
]]></content:encoded>
			<wfw:commentRss>http://theodesign.se/as3-dynamic-positioning-class/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>AS3: Check Microphone Activity</title>
		<link>http://theodesign.se/as3-check-microphone-activity/</link>
		<comments>http://theodesign.se/as3-check-microphone-activity/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 17:57:01 +0000</pubDate>
		<dc:creator>theo</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[microphone]]></category>

		<guid isPermaLink="false">http://theodesign.se/?p=227</guid>
		<description><![CDATA[Check out the demo here: http://theodesign.se/examples/microphone-as3/ This is a very simple example of how to get activity level of the microphone in Flash, Actionscript 3. Using the microphone on the web is a simple way of doing the experience for &#8230; <a href="http://theodesign.se/as3-check-microphone-activity/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://theodesign.se/as3-check-microphone-activity/"><img class="alignnone size-full wp-image-281" title="Screen shot 2010-10-24 at 9.30.07 PM" src="http://theodesign.se/wp-content/uploads/2010/10/Screen-shot-2010-10-24-at-9.30.07-PM.png" alt="" width="790" height="300" /></a></p>
<p>Check out the demo here: <a href="http://theodesign.se/examples/microphone-as3/" target="_blank">http://theodesign.se/examples/microphone-as3/</a></p>
<p>This is a very simple example of how to get activity level of the microphone in Flash, Actionscript 3.<br />
Using the microphone on the web is a simple way of doing the experience for the user a lot more fun. We used this for ledighetdeluxe.se where we blowed confetti online using the microphone. It&#8217;s cool and simple!<span id="more-227"></span></p>
<p>Here is the code I used for the example above, as you can see it&#8217;s not much!</p>
<pre>var myMic:Microphone = Microphone.getMicrophone(); // detect microphone
myMic.soundTransform = new SoundTransform(0, 0); // removes the sound from mic
myMic.setLoopBack(true); 

stage.addEventListener(Event.ENTER_FRAME, getMicrophone);
function getMicrophone(e:Event){
	bar.width = myMic.activityLevel*6.8; // get the activity level (0-100) and set width
	percent.text = "Activity: " + String(myMic.activityLevel) + "%";
}</pre>
<p>Simple huh?<br />
<a title="Source for MicrophoneActivity" href="http://theodesign.se/wp-content/themes/twentyten/flash/MicrophoneActivity.zip"> Download source file here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theodesign.se/as3-check-microphone-activity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery OSX Looking Dock</title>
		<link>http://theodesign.se/jquery-osx-looking-dock/</link>
		<comments>http://theodesign.se/jquery-osx-looking-dock/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 10:55:18 +0000</pubDate>
		<dc:creator>theo</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[dock]]></category>
		<category><![CDATA[jqdock]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[thexv]]></category>

		<guid isPermaLink="false">http://theodesign.se/?p=129</guid>
		<description><![CDATA[I am very interested of what jQuery can do and the plugins there is keeps impressing me. I saw the world cup site Twitter did and at the top they were using some kind of dock with the flags of &#8230; <a href="http://theodesign.se/jquery-osx-looking-dock/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://theodesign.se/jquery-osx-looking-dock"><img class="alignnone size-full wp-image-130" title="dock_pic" src="http://theodesign.se/wp-content/uploads/2010/06/dock_pic.jpg" alt="" width="660" height="234" /></a></p>
<p>I am very interested of what jQuery can do and the plugins there is keeps impressing me. I saw the <a href="http://twitter.com/worldcup" target="_blank">world cup site Twitter </a>did and at the top they were using some kind of dock with the flags of the teams. When I and Henrik Porseland were coding whatisxv.com we wanted a dock with students but the time ran out and we forgot about it.</p>
<p>But now I found <a href="http://www.wizzud.com/jqDock/" target="_blank">jqDock</a>! It&#8217;s very easy to use and i will show a very simple example here. You can do both horizontal and vertical dock menus and custom the looks of it very very easy. As I said before I wanted a dock menu with all the students in my class.<span id="more-129"></span></p>
<p><a href="http://whatisxv.com/html/dock.php" target="_blank">Take a look a the Demo I did</a></p>
<p>This is how I did it:<br />
First of all to use this wonderful plugin you need jQuery v1.2.3 or later. And then you can download the plugin <a href="http://www.wizzud.com/component/option,com_remository/Itemid,27/func,fileinfo/filecatid,64/parent,category/" target="_blank">here</a>.</p>
<p>Start with link the files in your &lt;head&gt; tag. Link in the jqDock source (full or compressed) after jQuery itself as in the example below:</p>
<pre>&lt;script type='text/javascript' src='jquery-1.2.3.min.js'&gt;&lt;/script&gt;
&lt;script type='text/javascript' src='jquery.jqDock.js'&gt;&lt;/script&gt;</pre>
<p>Create a div and put an ID or Class on it. Then fill it with images that you want in your dock menu. In my example:</p>
<pre>&lt;div id="dockmenu"&gt;
...
&lt;a href="#"&gt;&lt;img src="img/student.jpg" title="Student Name" alt="Student Name" /&gt;&lt;/a&gt;
&lt;a href="#"&gt;&lt;img src="img/student.jpg" title="Student Name" alt="Student Name" /&gt;&lt;/a&gt;
&lt;a href="#"&gt;&lt;img src="img/student.jpg" title="Student Name" alt="Student Name" /&gt;&lt;/a&gt;
...
&lt;/div&gt;</pre>
<p>To convert your HTML into a Dock, simply call the jqDock function.</p>
<pre>&lt;script type="text/javascript"&gt;
$(document).ready(function($)  {
	$('#dockmenu').jqDock({align:'bottom', size:65, labels:true});
});
&lt;/script&gt;</pre>
<p>This code will make the menu expand from the bottom and up and every picture will have a label on it. You can see it in my <a href="http://whatisxv.com/html/dock.php" target="_blank">example</a>.</p>
<p>It&#8217;s very easy to style your dock menu as well. Here is the CSS for my menu:</p>
<pre>div.jqDockWrap{margin:0 auto;}

div.jqDockLabel {color:#fff;background:#000; font-family:Myriad Pro; padding:4px;
font-size:11px;font-weight:normal;margin-top:-25px!important;white-space:nowrap;}

div.jqDockLabel a, a:hover, a:visited{color:#FFF; text-decoration:none;}

#dockmenu{clear:both;display:block;width:100%;position:absolute;text-align:center;
left:0; bottom:0px;}

#dockmenu img{padding:1px;float:left;display:block;}</pre>
<p>Good Luck creating your own dock menu with <a href="http://www.wizzud.com/jqDock/" target="_blank">jqDock</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://theodesign.se/jquery-osx-looking-dock/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

