<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Shiki</title>
	
	<link>http://shikii.net/blog</link>
	<description>no awesome tagline here</description>
	<lastBuildDate>Thu, 26 Aug 2010 08:41:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/shikii/OfdV" /><feedburner:info uri="shikii/ofdv" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Adding a MovieClip/Sprite from an external SWF to a skin</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/6b9N7HFEpyk/</link>
		<comments>http://shikii.net/blog/adding-a-movieclipsprite-from-an-external-swf-to-a-skin/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 12:55:28 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[bitmapimage]]></category>
		<category><![CDATA[external]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[movieclip]]></category>
		<category><![CDATA[skin]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[spritevisualelement]]></category>
		<category><![CDATA[swf]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=225</guid>
		<description><![CDATA[I&#8217;m trying to learn a little bit of Flex 4 development. I&#8217;ve done a lot of Flash/AS3 since more than a year now but I haven&#8217;t really gotten into Flex yet. From what I learned in a day, they did a lot of improvements in separating the logic from the presentation (design). Most of this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to learn a little bit of Flex 4 development. I&#8217;ve done a lot of Flash/AS3 since more than a year 
now but I haven&#8217;t really gotten into Flex yet. From what I learned in a day, they did a lot of improvements
in separating the logic from the presentation (design). Most of this is done through skins (i.e. separate mxml
files defining how a control will look). Skins act just like a container; it can contain shapes and additional 
controls. If applied to a control, that control will inherit all the shapes and controls from that skin.</p>

<p>My first annoying stumbling block was trying to add an exported symbol (e.g. MovieClip, Sprite) from an external swf to a skin. 
The skin will be applied to a button and should apply a background using the exported symbol. There are two ways
that I&#8217;ve come up with: using <code>BitmapImage</code> or <code>SpriteVisualElement</code>.</p>

<p>For <code>BitmapImage</code>, just add this to the skin (<code>&lt;s:SparkSkin&gt;</code> tag):</p>

<pre><code>&lt;s:BitmapImage source="@Embed('assets/assets.swf#CaptureButton')" /&gt;
</code></pre>

<p>The above will add a bitmap version of the exported symbol named &#8220;CaptureButton&#8221; from the SWF file named &#8220;assets/assets.swf&#8221; located in the project directory. The problem with bitmaps 
is they look horrible when scaled up so I wanted to add the CaptureButton as a <code>Sprite</code> or <code>MovieClip</code> (vector) instead. 
I did it using <code>SpriteVisualElement</code> which takes a few more lines to set up. You&#8217;ll have to add the <code>SpriteVisualElement</code> 
tag and add the external symbol to it through code (on the <code>addedToStage</code> event). Here&#8217;s the full code of the skin file 
using <code>SpriteVisualElement</code>:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" 
             xmlns:fb="http://ns.adobe.com/flashbuilder/2009" 
             xmlns:mx="library://ns.adobe.com/flex/mx"
             minWidth="21" minHeight="21" alpha.disabled="0.5"&gt;

  &lt;fx:Metadata&gt;&lt;![CDATA[ [HostComponent("spark.components.Button")] ]]&gt;&lt;/fx:Metadata&gt;
  &lt;fx:Script&gt;
    &lt;![CDATA[

      // embed our symbol (Sprite)
      [Embed('assets/assets.swf#CaptureButton')]
      private var CaptureButton:Class;

      /**
       * As defined in the SpriteVisualElement tag at the bottom of the page, this 
       * event handler will be called when it gets added to the stage.
       */
      protected function mySprite_addedToStageHandler(event:Event):void
      {
        // create an instance of our embedded symbol
        var sprite:Sprite = new CaptureButton() as Sprite; // or use MovieClip if you're adding a symbol with more than 1 frame
        sprite.x = 10;
        sprite.scaleX *= 2;
        sprite.scaleY *= 2;
        mySprite.addChild(sprite); // add it to the SpriteVisualElement
      }
    ]]&gt;
  &lt;/fx:Script&gt;

  &lt;s:states&gt;
    &lt;s:State name="over" /&gt;
    &lt;s:State name="down" /&gt;
    &lt;s:State name="disabled" /&gt;
    &lt;s:State name="up"/&gt;
  &lt;/s:states&gt;  

  &lt;!-- call mySprite_addedToStageHandler() when this element gets added to the stage --&gt;
  &lt;s:SpriteVisualElement id="mySprite" addedToStage="mySprite_addedToStageHandler(event)" /&gt;

&lt;/s:SparkSkin&gt;
</code></pre>

<p>The <code>SpriteVisualElement</code> takes more lines to setup than <code>BitmapImage</code>. I hope that this is just a lack of knowledge on my part. 
There might be a way to add a Sprite/MovieClip with just 1 tag. For now, this works great and I&#8217;m fine with that.</p>

<p>Assigning the skin to a button should look like this:</p>

<pre><code>&lt;!-- assuming we named our skin "CaptureButtonSkin" --&gt;
&lt;s:Button id="captureButton" skinClass="CaptureButtonSkin" height="197" width="442" x="365"/&gt;
</code></pre>

<h2>Update 2010-08-26</h2>

<p>After a night&#8217;s sleep I found it. Crap. It was this easy:</p>

<pre><code>&lt;mx:Image source="@Embed('assets/assets.swf#CaptureButton')" /&gt;
</code></pre>

<p>Face palm. Excuse me while I bang my head against the wall.</p>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/6b9N7HFEpyk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/adding-a-movieclipsprite-from-an-external-swf-to-a-skin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/adding-a-movieclipsprite-from-an-external-swf-to-a-skin/</feedburner:origLink></item>
		<item>
		<title>Creating a custom image service for Twitter for iPhone</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/_sb3P70bgFo/</link>
		<comments>http://shikii.net/blog/creating-a-custom-image-service-for-twitter-for-iphone/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 00:52:30 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=191</guid>
		<description><![CDATA[We&#8217;ve just recently deployed a custom endpoint to allow Twitter for iPhone users to post their pics through PicLyf. When you attach an image to a tweet, Twitter for iPhone will upload that image to the image service of your choice. It allows you to choose from various image services (e.g. yFrog, Twitpic, TweetPhoto) or [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright">
  <img src="http://shikii.net/blog/wp-content/uploads/2010/08/img_0031.png" alt="" title="Custom Image Service" width="320" height="240" class="alignright size-full wp-image-217" />
</div>

<p>We&#8217;ve just recently deployed a custom endpoint to allow <a href="http://itunes.apple.com/app/twitter/id333903271?mt=8">Twitter for iPhone</a> users to post their pics through <a href="http://piclyf.com">PicLyf</a>.</p>

<p>When you attach an image to a tweet, Twitter for iPhone will upload that image to the image service of your choice. It allows you to choose from various image services (e.g. yFrog, Twitpic, TweetPhoto) or a custom image service. In our (PicLyf) case, it was custom. We made a custom endpoint: <code>http://api.piclyf.com/twitter</code>. Using this url as the custom image service, attached images will be uploaded to the user&#8217;s PicLyf account.</p>

<h2>Implementation</h2>

<p>This functionality works through the use of <a href="http://dev.twitter.com/pages/oauth_echo">OAuth Echo</a>. From Twitter:</p>

<blockquote>
  <p>OAuth Echo is a means to securely delegate OAuth authorization with a third party while interacting with an API. Within the Twitter ecosystem, we use OAuth Echo as a means to allow your application to use services such as Twitpic and yfrog.</p>
</blockquote>

<p>You may want to read about OAuth Echo first. Basically, Twitter for iPhone sends you the image along with the OAuth credentials of the user who wants to upload the image. Note that the OAuth credentials also includes the app&#8217;s consumer key. What you&#8217;ll have to do is use these credentials and verify them with the Twitter API. If the verification succeeds, you will receive the user&#8217;s Twitter information. You may then save the image in your server and link it with the user&#8217;s Twitter account. Lastly, you will have to return the correct response to Twitter for iPhone specifying the url where the image can be viewed:</p>

<pre><code>&lt;mediaurl&gt;http://foo.com/bar/pic-url.html&lt;/mediaurl&gt;
</code></pre>

<h3>Sample code in PHP</h3>

<p>Here is a sample class which encapsulates the OAuth Echo process:</p>

<pre><code>class TwitterOAuthEcho
{
  public $verificationUrl = 'https://api.twitter.com/1/account/verify_credentials.json';
  public $userAgent = __CLASS__;

  public $verificationCredentials;

  /**
   *
   * @var int
   */
  public $resultHttpCode;
  /**
   *
   * @var array
   */
  public $resultHttpInfo;
  public $responseText;

  /**
   * Save the OAuth credentials sent by the Consumer (e.g. Twitter for iPhone, Twitterrific)
   */
  public function setCredentialsFromRequestHeaders()
  {    
    $this-&gt;verificationCredentials = isset($_SERVER['HTTP_X_VERIFY_CREDENTIALS_AUTHORIZATION']) 
      ? $_SERVER['HTTP_X_VERIFY_CREDENTIALS_AUTHORIZATION'] : '';
  }

  /**
   * Verify the given OAuth credentials with Twitter
   * @return boolean
   */
  public function verify()
  {
    $curl = curl_init($this-&gt;verificationUrl);
    curl_setopt($curl, CURLOPT_USERAGENT, $this-&gt;userAgent);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        'Authorization: ' . $this-&gt;verificationCredentials,
      ));

    $this-&gt;responseText = curl_exec($curl);
    $this-&gt;resultHttpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    $this-&gt;resultHttpInfo = curl_getinfo($curl);
    curl_close($curl);

    return $this-&gt;resultHttpCode == 200;
  }
}
</code></pre>

<p>The <code>setCredentialsFromRequestHeaders</code> method saves the OAuth credentials sent by the consumer (e.g. Twitter for iPhone, Twitterrific). These credentials will be used in the <code>verify</code> method which sends the verification request to Twitter.</p>

<p>Using the class above, your custom image service page <em>(e.g. <code>http://api.piclyf.com/twitter</code>)</em> should handle the request like this:</p>

<pre><code>$oauthecho = new TwitterOAuthEcho();
$oauthecho-&gt;userAgent = 'My Custom Image Service App 1.0';
$oauthecho-&gt;setCredentialsFromRequestHeaders();
if ($oauthecho-&gt;verify()) {      
  // Verification was a success, we should be able to access the user's Twitter info from the responseText.
  $userInfo = json_decode($oauthecho-&gt;responseText, true);
  $twitterId = isset($userInfo['id']) ? $userInfo['id'] : null;      
  // You can use $userInfo or $twitterId above to maybe check if you have a record of this user
  // in your db.

  // You can access the uploaded image using $_FILES. Save it and create a url where it can be accessed.

  // Return the image url back to the consumer
  $imagePageUrl = 'http://somwhere.com/image1';
  echo '&lt;mediaurl&gt;' . $imagePageUrl . '&lt;/mediaurl&gt;';

} else {
  // verification failed, we should return the error back to the consumer
  $response = json_decode($oauthecho-&gt;responseText, true);      
  $message = isset($response['error']) ? $response['error'] : null;      
  if (!headers_sent())
    header('HTTP/1.0 ' . $oauthecho-&gt;resultHttpCode);
  echo $message;
}
</code></pre>

<p>The code above is just a sample and your final code will look very different especially if you&#8217;re using a framework. I&#8217;ve also left
out the part where you&#8217;ll get the image from $_FILES and save/process it. That is beyond the scope of this article.</p>

<h2>Notes</h2>

<p>The note in Twitter for iPhone&#8217;s custom image service screen says you can get more (developer) info in this url: http://developer.atebits.com. As of this writing, the information on that page is no longer accurate. Twitter for iPhone no longer sends you the user&#8217;s username and password. The info at <a href="http://twitterrific.com/ipad/poweruser">Twitterrific</a> is more accurate. And yes, if your service works for Twitter for iPhone, it should work on Twitterrific too.</p>

<h3>Further reading:</h3>

<ul>
<li><a href="http://www.bennadel.com/blog/1965-Creating-A-Custom-Image-Upload-Service-For-Tweetie-Twitter-For-iPhone-Using-ColdFusion.htm">Creating A Custom Image Upload Service For Tweetie (Twitter For iPhone) Using ColdFusion</a></li>
<li><a href="http://dev.twitter.com/pages/oauth_echo">Using OAuth Echo</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/_sb3P70bgFo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/creating-a-custom-image-service-for-twitter-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/creating-a-custom-image-service-for-twitter-for-iphone/</feedburner:origLink></item>
		<item>
		<title>Why I don’t code in Ruby</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/72_FklAqV7I/</link>
		<comments>http://shikii.net/blog/why-i-dont-code-in-ruby/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 15:35:57 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/why-i-dont-code-in-ruby/</guid>
		<description><![CDATA[Well, not yet anyway. Perhaps when those hosting prices go down I&#8217;d go and take a shot at building something useful. I did start reading a few books on Ruby and Rails. It&#8217;s an incredibly awesome and fun language. I&#8217;ve never been very excited when learning a new language. I drool when I see Ruby [...]]]></description>
			<content:encoded><![CDATA[<p>Well, not yet anyway. Perhaps when those hosting prices go down I&#8217;d go and take a shot at building something useful. I did start reading a few books on Ruby and Rails. It&#8217;s an incredibly awesome and fun language. I&#8217;ve never been very excited when learning a new language. I drool when I see Ruby code. It&#8217;s easy to learn but I&#8217;ve already forgotten most about it since I don&#8217;t use it fulltime.</p>

<p>If it were just me, I&#8217;d have built <a href="http://piclyf.com">PicLyf</a> using Ruby to make it more exciting. But there&#8217;s the city talent pool we had to think of. Currently, it&#8217;s hard to find good PHP developers. I reckon it&#8217;ll be more hard to find those who know Ruby.</p>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/72_FklAqV7I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/why-i-dont-code-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/why-i-dont-code-in-ruby/</feedburner:origLink></item>
		<item>
		<title>Creating PID files for beanstalkd on CentOS</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/zf8EJpQHu3w/</link>
		<comments>http://shikii.net/blog/creating-pid-files-for-beanstalkd-on-centos/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 13:48:35 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=138</guid>
		<description><![CDATA[Yep, managing servers is hard >.&#60; I&#8217;ve been trying to set beanstalkd to be managed by monit on CentOS. Unfortunately beanstalkd doesn&#8217;t seem to create pid files on CentOS (it creates one in Ubuntu though). Pid files are needed by monit so it can check if the process is still running or not. Many grueling [...]]]></description>
			<content:encoded><![CDATA[<p>Yep, managing servers is <strong>hard</strong> >.&lt; I&#8217;ve been trying to set <a href="http://kr.github.com/beanstalkd/">beanstalkd</a> to be managed 
by <a href="http://mmonit.com/monit/">monit</a> on CentOS. Unfortunately beanstalkd doesn&#8217;t seem to create pid files on CentOS (it creates one in Ubuntu though). 
Pid files are needed by monit so it can check if the process is still running or not. Many grueling hours later, I settled with 
modifying <strong><code>/etc/init.d/beanstalkd</code></strong> and adding this to the <code>start()</code> function (after <code>daemon $exec</code>&#8230;):</p>

<pre><code>echo `ps auxf | grep -v grep | grep "$exec -d $options" | awk '{print $2}'` &gt; /var/run/beanstalkd.pid
</code></pre>

<p>I have no idea what all those grep and awk exactly mean. ^_^x But the effect is it creates the pid file in <code>/var/run/beanstalkd.pid</code> containing 
the correct process id of beanstalkd. You could then have monit watch that pid file.</p>

<p><a href="http://gist.github.com/515422">Here&#8217;s</a> the whole modified script. And this is my main reference: http://gist.github.com/508889. A huge thanks to him (Sam X).</p>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/zf8EJpQHu3w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/creating-pid-files-for-beanstalkd-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/creating-pid-files-for-beanstalkd-on-centos/</feedburner:origLink></item>
		<item>
		<title>The undefined curl function in console (WampServer)</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/_fO76j0pER8/</link>
		<comments>http://shikii.net/blog/the-undefined-curl-function-in-console-wampserver/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 08:57:06 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wampserver]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=122</guid>
		<description><![CDATA[Stupid stupid me. On Windows/WampServer, I&#8217;ve always had this problem when working with PHP code that can run in the console and using cURL methods.. PHP Fatal error: Call to undefined function curl_init() in D:\Shiki\github\yii-clockwerk\test-app\CurlHelper.php on line 90 Fatal error: Call to undefined function curl_init() in D:\Shiki\github\yii-clockwerk\test-app\CurlHelper.php on line 90 It (cURL) works in the [...]]]></description>
			<content:encoded><![CDATA[<p>Stupid stupid me. On Windows/WampServer, I&#8217;ve always had this problem when working with PHP code that can run in the console and using 
<a href="http://php.net/manual/en/book.curl.php">cURL</a> methods..</p>

<pre><code>PHP Fatal error:  Call to undefined function curl_init() in D:\Shiki\github\yii-clockwerk\test-app\CurlHelper.php on line 90
Fatal error: Call to undefined function curl_init() in D:\Shiki\github\yii-clockwerk\test-app\CurlHelper.php on line 90
</code></pre>

<p>It (cURL) works in the browser but not when in console. I didn&#8217;t think that it was 
<a href="http://old.nabble.com/Using-curl-inside-cake-console-td20409372.html">this simple</a> to fix. The PHP CLI uses a different config 
file (php.ini) compared to the one used by WampServer/Apache. You can see the location of the config file being used by typing:</p>

<pre><code>php --ini
</code></pre>

<p>Result:</p>

<pre><code>Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File:         C:\wamp\bin\php\php5.3.0\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)
</code></pre>

<p>You can then fix the curl problem by enabling it in the php.ini file being used. Make sure this is not commented out:</p>

<pre><code>extension=php_curl.dll
</code></pre>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/_fO76j0pER8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/the-undefined-curl-function-in-console-wampserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/the-undefined-curl-function-in-console-wampserver/</feedburner:origLink></item>
		<item>
		<title>FirePHP Logger for Yii Framework</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/ReiNrd-vwX4/</link>
		<comments>http://shikii.net/blog/firephp-logger-for-yii-framework/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 11:59:41 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[firephp]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=96</guid>
		<description><![CDATA[I made this a few weeks ago. It is a Yii Framework extension which routes log messages to FirePHP. Requirements Download the extension from the Yii Framework extension page or GitHub. Install Firebug and FirePHP plugins for Firefox. Enable output_buffering in php.ini. Installation Download and extract the &#8220;shiki&#8221; folder to your extensions directory. This is [...]]]></description>
			<content:encoded><![CDATA[<p>I made this a few weeks ago. It is a <a href="http://yiiframework.com">Yii Framework</a> extension which routes log messages to 
<a href="http://firephp.org">FirePHP</a>.</p>

<h3>Requirements</h3>

<ul>
<li>Download the extension from the Yii Framework <a href="http://www.yiiframework.com/extension/firephp-logroute/">extension page</a>
or <a href="http://github.com/shiki/yii-firephplogroute">GitHub</a>.</li>
<li>Install <a href="http://getfirebug.com/">Firebug</a> and FirePHP plugins for Firefox.</li>
<li>Enable <a href="http://www.php.net/manual/en/outcontrol.configuration.php#ini.output-buffering">output_buffering</a> in php.ini.</li>
</ul>

<h3>Installation</h3>

<ol>
<li>Download and extract the &#8220;shiki&#8221; folder to your extensions directory. This is usually <code>/protected/extensions</code>.</li>
<li>Download the FirePHP core class and put it somewhere in your <code>/protected</code> directory. I usually put these files in <code>/protected/vendors</code>.</li>
<li>Modify your config file to include this LogRoute class and set the <code>fbPath</code> property to the path of fb.php. Use a Yii alias 
(e.g. <code>application.vendors.FirePHPCore031.lib.FirePHPCore.fb</code>):</li>
</ol>

<h4>config file code (e.g. /protected/config/main.php)</h4>

<pre><code>'log'=&gt;array(
    'class'=&gt;'CLogRouter',
    'routes'=&gt;array(
        // the default (file logger)
        array(
            'class'=&gt;'CFileLogRoute',
            'levels'=&gt;'error, warning',
        ),
        // the FirePHP LogRoute
        array(
            'class' =&gt; 'ext.shiki.firePHPLogRoute.ShikiFirePHPLogRoute', // "ext" alias points to /protected/extensions
            'fbPath' =&gt; 'application.vendors.FirePHPCore031.lib.FirePHPCore.fb', // set path to fb.php
        ),
    ),
),
</code></pre>

<h3>Usage</h3>

<p>Once you&#8217;ve got the extension setup in the config, you can use Yii&#8217;s logging methods to log messages to FirePHP.</p>

<pre><code>// logging an INFO message (arrays will work and looks awesome in FirePHP)
Yii::log(array('username' =&gt; 'Shiki', 'profiles' =&gt; array('twidl', 'twitter', 'facebook')), CLogger::LEVEL_INFO);

// logging a WARNING message
Yii::log("You didn't setup a profile, are you really a person?", CLogger::LEVEL_WARNING);

// logging with a CATEGORY (categories are displayed as "labels" in FirePHP -- just an additional info text)
Yii::log('Profile successfully created', CLogger::LEVEL_INFO, 'application.user.profiles');

// tracing simple text
Yii::trace('Loading application.user.profiles.ninja', 'application.user.profiles');

// logging an ERROR
Yii::log('We have successfully determined that you are not a person', CLogger::LEVEL_ERROR, 'Any category/label will work');
</code></pre>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/ReiNrd-vwX4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/firephp-logger-for-yii-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/firephp-logger-for-yii-framework/</feedburner:origLink></item>
		<item>
		<title>Installing Memcached for PHP 5.3 on Windows 7</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/20lF-jjsTYs/</link>
		<comments>http://shikii.net/blog/installing-memcached-for-php-5-3-on-windows-7/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 06:23:30 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wampserver]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=80</guid>
		<description><![CDATA[First off, all credits go to this guy. I&#8217;m just listing the steps on how I did it in Windows 7 with PHP 5.3. Also, I tested this using WampServer but I believe it should work on any PHP install. Install memcached Download the Memcached Win32 library here: http://code.jellycan.com/memcached/. Extract the downloaded archive file in [...]]]></description>
			<content:encoded><![CDATA[<div class="wide"><img title="Memcached" src="http://shikii.net/blog/wp-content/uploads/2010/03/memcached-win7.jpg" alt="" width="640" /></div>

<p>First off, all credits go to <a href="http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/">this guy</a>. 
I&#8217;m just listing the steps on how I did it in Windows 7 with PHP 5.3. Also, I tested this using 
<a href="http://www.wampserver.com/en/">WampServer</a> but I believe it should work on any PHP install.</p>

<h2>Install memcached</h2>

<ul>
<li>Download the Memcached Win32 library here: http://code.jellycan.com/memcached/. Extract the downloaded archive file in a 
directory (e.g. <code>c:\memcached</code>). There should be a <code>memcached.exe</code> in there.</li>
<li>Run a command prompt <strong>as an administrator</strong>. Some info on how to do that 
<a href="http://blogs.msdn.com/tims/archive/2006/11/02/windows-vista-secret-10-open-an-elevated-command-prompt-in-six-keystrokes.aspx">here</a>.</li>
<li><p>Install memcached as a service. Go to the memcached directory, type and run:</p>

<pre><code>memcached -d install
</code></pre></li>
<li><p>Start the memcached service by running:</p>

<pre><code>memcached -d start
</code></pre></li>
</ul>

<h2>Install PHP Memcache extension (php_memcache.dll)</h2>

<ul>
<li>Chances are you don&#8217;t have <code>php_memcache.dll</code> in your PHP extensions yet. 
You can download a build of it <a href="http://downloads.php.net/pierre/">here</a>. Make sure to download the correct one for your system. 
Mine was 32bit and PHP 5.3 so I used this: <a href="http://downloads.php.net/pierre/php_memcache-cvs-20090703-5.3-VC6-x86.zip">php_memcache-cvs-20090703-5.3-VC6-x86.zip</a>. 
The archive should contain <code>php_memcache.dll</code>. Extract the archive to your php extensions directory. On my system (WampServer), 
this was <code>C:\wamp\bin\php\php5.3.0\ext</code>.</li>
<li><p>Edit <code>php.ini</code>, add this line to enable the extension:</p>

<pre><code>extension=php_memcache.dll
</code></pre>

<p>This is a little easier for WampServer users because there&#8217;s a menu for enabling extensions ^_^x</p></li>
</ul>

<h2>Test</h2>

<p>Test the installation using the sample PHP code here: <a href="http://www.php.net/manual/en/memcache.examples-overview.php">http://www.php.net/manual/en/memcache.examples-overview.php</a>.</p>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/20lF-jjsTYs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/installing-memcached-for-php-5-3-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/installing-memcached-for-php-5-3-on-windows-7/</feedburner:origLink></item>
		<item>
		<title>“Ignoring funny ref” error on Git + Dropbox</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/Hx9TXb2IVLo/</link>
		<comments>http://shikii.net/blog/ignoring-funny-ref-error-on-git-dropbox/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 03:54:28 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=70</guid>
		<description><![CDATA[At Twidl HQ, we use a combination of Git and Dropbox for managing our source code. It&#8217;s a simple but awesome setup. Sometimes, we get this really cryptic error when fetching from our main repo (our shared Dropbox folder): Ignoring funny ref 'refs/remotes/origin/master (Shiki's conflicted copy 2010-01-14)' locally It seems to happen when 2 people [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://twidl.it">Twidl HQ</a>, we use a combination of <a href="http://git-scm.com/">Git</a> and <a href="https://www.dropbox.com/">Dropbox</a> 
for managing our source code. It&#8217;s a simple but awesome setup. Sometimes, we get this really cryptic error when <strong>fetching</strong> from our main repo 
(our <em>shared</em> Dropbox folder):</p>

<pre><code>Ignoring funny ref 'refs/remotes/origin/master (Shiki's conflicted copy 2010-01-14)' locally
</code></pre>

<p>It seems to happen when 2 people push to <code>origin/master</code> at almost the same time. This makes Dropbox update the same file and seems to be 
the cause of the error. When this happens, you can bet that one of the people who did the push will <strong>lose</strong> his changes to <code>origin/master</code>. 
So you&#8217;ll have to fix it accordingly.</p>

<p>The &#8220;funny ref&#8221; error does not have any critical effect on the repo and Git seems to work perfectly. It will just annoy you every time 
you try to fetch. It turns out that this <code>"master (Shiki's conflicted copy 2010-01-14)"</code> is a branch in the main repo. 
Simply deleting it will remove the error. In terminal, go to your main repo&#8217;s <em>(Dropbox)</em> root folder:</p>

<pre><code>git branch -d "master (Shiki's conflicted copy 2010-01-14)"
</code></pre>

<p>If you&#8217;re not sure of the name of the conflicting branch, you can execute <code>git branch</code> to show all branches. 
There should at least be a &#8220;master&#8221; branch and your conflicting branch.</p>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/Hx9TXb2IVLo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/ignoring-funny-ref-error-on-git-dropbox/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/ignoring-funny-ref-error-on-git-dropbox/</feedburner:origLink></item>
		<item>
		<title>Creating custom Box2D shape components in PushButton Engine</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/p-PmZC0FzBY/</link>
		<comments>http://shikii.net/blog/creating-custom-box2d-shape-components-in-pushbutton-engine/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 13:40:22 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[Flash Games]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[box2d]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[pushbutton engine]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=58</guid>
		<description><![CDATA[If you ever need to use other ways of creating Box2D shapes that are not currently available in PushButton Engine, you can simply make one yourself. You&#8217;ll just need to create a subclass of CollisionShape and use it just like the PBE shape classes. Here&#8217;s a sample class we use to create an oriented box [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever need to use other ways of creating <a href="http://www.box2d.org">Box2D</a> shapes that are not currently available 
in <a href="http://www.pushbuttonengine.com">PushButton Engine</a>, you can simply make one yourself. You&#8217;ll just need to create a subclass of <code>CollisionShape</code> 
and use it just like the PBE shape classes.</p>

<p>Here&#8217;s a sample class we use to create an oriented box shape:</p>

<pre><code>package cavalcade.box2D
{
    import Box2D.Collision.Shapes.b2PolygonDef;
    import Box2D.Collision.Shapes.b2ShapeDef;
    import Box2D.Common.Math.b2Vec2;

    import com.pblabs.box2D.CollisionShape;

    import flash.geom.Point;

    public class OrientedBoxCollisionShape extends CollisionShape
    {
        public var halfWidth:Number = 0.5;
        public var halfHeight:Number = 0.5;
        public var center:Point = new Point();
        public var angle:Number = 0;

        public function OrientedBoxCollisionShape()
        {
            super();
        }

        override protected function doCreateShape():b2ShapeDef
        {
            var scale:Number = _parent.manager.inverseScale;            

            var shape:b2PolygonDef = new b2PolygonDef();
            shape.SetAsOrientedBox(halfWidth * scale * _parent.size.x, halfHeight * scale * _parent.size.y, b2Vec2.Make(center.x, center.y), angle);            
            return shape;
        }
    }
}
</code></pre>

<p>As you can see, the class inherits from <code>CollisionShape</code> and overrides the <code>doCreateShape</code> method in order to create the actual 
Box2D oriented box shape from there. Use it in the level files like this:</p>

<pre><code>&lt;component type="com.pblabs.box2D.Box2DSpatialComponent" name="Cart"&gt;
    &lt;collidesWithTypes childType="String"&gt;
        &lt;_0&gt;Platform&lt;/_0&gt;
    &lt;/collidesWithTypes&gt;

    &lt;collisionShapes childType="com.pblabs.box2D.CollisionShape"&gt;
        &lt;_0 type="cavalcade.box2D.OrientedBoxCollisionShape"&gt;
            &lt;halfWidth&gt;0.42&lt;/halfWidth&gt;
            &lt;halfHeight&gt;0.12&lt;/halfHeight&gt;
            &lt;density&gt;50&lt;/density&gt; &lt;!-- you can still use the same properties in CollisionShape --&gt;
            &lt;friction&gt;2&lt;/friction&gt;
            &lt;restitution&gt;0&lt;/restitution&gt;
            &lt;angle&gt;3&lt;/angle&gt; &lt;!-- specify an angle of rotation --&gt;
            &lt;center&gt; &lt;!-- you can override the location of the box so it won't be positioned somewhere other than the center of the entity --&gt;
                &lt;x&gt;1&lt;/x&gt;
                &lt;y&gt;-0.5&lt;/y&gt; 
            &lt;/center&gt;
        &lt;/_0&gt;                
    &lt;/collisionShapes&gt;
    &lt;collisionType childType="String"&gt;
        &lt;_0&gt;Renderable&lt;/_0&gt;
    &lt;/collisionType&gt;
    &lt;manager componentReference="SpatialDB" /&gt;
        &lt;position type=""&gt;
            &lt;x&gt;0&lt;/x&gt;
            &lt;y&gt;110&lt;/y&gt;
        &lt;/position&gt;
        &lt;size type=""&gt;
            &lt;x&gt;60&lt;/x&gt;
            &lt;y&gt;45&lt;/y&gt;
        &lt;/size&gt;
&lt;/component&gt;
</code></pre>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/p-PmZC0FzBY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/creating-custom-box2d-shape-components-in-pushbutton-engine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/creating-custom-box2d-shape-components-in-pushbutton-engine/</feedburner:origLink></item>
		<item>
		<title>Experiment: Using SWF MovieClips in PushButton Engine</title>
		<link>http://feedproxy.google.com/~r/shikii/OfdV/~3/2uq9-ltspsU/</link>
		<comments>http://shikii.net/blog/experiment-using-swf-movieclips-in-pushbutton-engine/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 17:11:17 +0000</pubDate>
		<dc:creator>Shiki</dc:creator>
				<category><![CDATA[Flash Games]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[movieclip]]></category>
		<category><![CDATA[pushbutton engine]]></category>
		<category><![CDATA[swf]]></category>

		<guid isPermaLink="false">http://shikii.net/blog/?p=32</guid>
		<description><![CDATA[Important: This tutorial is now deprecated due to the new and awesome, fully rewritten, rendering components. You can see some discussions about it here. I&#8217;ve been working with PushButton Engine for a short while now but last night was actually the first time I tried integrating/using a MovieClip from a SWF into PBE. Unfortunately, there [...]]]></description>
			<content:encoded><![CDATA[<blockquote>
  <p><strong>Important</strong>: This tutorial is now deprecated due to the new and awesome, fully rewritten, rendering components. 
  You can see some discussions about it <a href="http://pushbuttonengine.com/forum/viewtopic.php?f=5&amp;t=353">here</a>.</p>
</blockquote>

<p>I&#8217;ve been working with <a href="http://www.pushbuttonengine.com">PushButton Engine</a> for a short while now but last night was actually the 
first time I tried integrating/using a MovieClip from a SWF into PBE. Unfortunately, there are no documentations on how do this at the 
moment. The examples mostly use images (pngs). I won&#8217;t b<em>tch about it because that is totally understandable. 
The PBE team are working their a</em>*es off to get to 1.0 and the documentation is the least of their worries. I could at least 
thank them for doing such a good job &#8212; PBE&#8217;s a well thought-out framework, everything I learned from it made a lot of sense.</p>

<p>Anyway, what I wanted to do was simply to put my MovieClip in a SWF library into the stage. I am using FlexBuilder 3 + the latest PBE 
code from the SVN. I somehow got some ideas on how to do this when I was hanging out at the 
<a href="http://pushbuttonengine.com/chat/">#pbengine IRC channel</a>. And I did a lot of digging on the PBE code and did lots of experiments to 
try to understand how to use them. There are 2 different components we can use:</p>

<ul>
<li><code>com.pblabs.rendering2D.SWFSpriteSheetComponent</code>. This one actually had a class description: <em>&#8220;A class that is similar to the 
SpriteSheetComponent except the frames are loaded by rasterizing a MovieClip rather than a single image&#8221;.</em> 
Assuming you&#8217;ve gone through the PBE examples, I think this means that instead of creating the frames from a sprite sheet image 
and have it used by SpriteRenderComponent, you&#8217;ll be getting your frames from a loaded MovieClip instead. 
Nevertheless, this isn&#8217;t what I was aiming for.</li>
<li><code>com.pblabs.rendering2D.SWFRenderComponent</code>. This component somehow works like SpriteRenderComponent, only it uses MovieClips. 
A little code investigation later, looks like this component will need to be subclassed in order for it to work. From that subclass, 
you can do what you want to do with your movieclip  using a protected _clip variable.</li>
</ul>

<p>Since I still wanted control over a movieclip, I used SWFRenderComponent. I&#8217;ll explain below how I did it. Please do note that I am 
still a novice with PBE (and Flex for that matter) so the method I used might not be good practice.</p>

<h3>Requirements</h3>

<ul>
<li><strong>Latest PBE code</strong>. You can get it from the SVN <a href="http://code.google.com/p/pushbuttonengine/source/checkout">here</a> or 
download <a href="http://code.google.com/p/pushbuttonengine/downloads/list">here</a>. As of this writing, I&#8217;m at revision 470 (Sep 10, 2009)</li>
<li><strong>SWF</strong>. I have a compiled SWF containing exported assets (movieclip classes) that I want to use in PBE.</li>
<li><strong>Flex compiler / IDE</strong> / or whatever your preferred tool is. I&#8217;m using FlexBuilder + Flex Compiler.</li>
<li><strong>A PBE Project</strong>. Our team used the <a href="http://code.google.com/p/pushbuttonengine/source/browse/trunk#trunk/examples/PBEngineDemo">PBEngineDemo</a> 
project as the base project.</li>
</ul>

<h3>Embed the SWF</h3>

<p>In <code>Resources.as</code>, embed the SWF using the same method as the sample embedded resources in the PBEngineDemo project.</p>

<pre><code>[Embed(source='../assets/gamemovieclips.swf', mimeType='application/octet-stream')]
public var _embeddedSWF:Class;
</code></pre>

<p>I thought that the above would be enough just like embedding images. However, I was getting this warning from the log:</p>

<pre><code>WARN: Resources - ResourceBundle - No resource type specified for extension '.swf'.  In the ExtensionTypes parameter, expected to see something like: ResourceBundle.ExtensionTypes.mycustomext = "com.mydomain.customresource" where mycustomext is the (lower-case) extension, and "com.mydomain.customresource" is a string of the fully qualified resource class name.  Defaulting to generic DataResource.
</code></pre>

<p>This resulted to the gamemovieclips.swf not getting embedded in the final swf. I tried to look at the problem in ResourceBundle.as, 
and somehow, adding this to Resources.as fixed it:</p>

<pre><code>public class Resources extends ResourceBundle
{
  ResourceBundle.ExtensionTypes.swf = "com.pblabs.engine.resource.SWFResource"; // added this line

  [Embed(source='../assets/gamemovieclips.swf', mimeType='application/octet-stream')]
  public var _embeddedSWF:Class; // our embedded swf

  // other embed files below
  ...
</code></pre>

<h3>Subclass SWFRenderComponent</h3>

<p>Next, I created a new class which inherits <code>SWFRenderComponent</code> and overrides the <code>getClipInstance()</code> method. For this example, 
let&#8217;s say in my embedded swf (gamemovieclips.swf in the example above) I have a car animation movieclip exported as CarMC. 
I will then need to have <code>getClipInstance()</code> return an instance of that movieclip. My class would then look like this:</p>

<pre><code>package com.game.renders
{
    import com.pblabs.engine.resource.Resource;
    import com.pblabs.engine.resource.ResourceManager;
    import com.pblabs.engine.resource.SWFResource;
    import com.pblabs.rendering2D.SWFRenderComponent;

    import flash.display.MovieClip;

    public class CarRenderComponent extends SWFRenderComponent
    {
        public function CarRenderComponent()
        {
            super();
        }

        // override getClipInstance() and return a CarMC movieclip instance
        protected override function getClipInstance():MovieClip
        {
            // check if we are currently loading the movieclip or a CarMC instance was already loaded
            if (_clipInstance == null &amp;amp;&amp;amp; !_loading) {

                _loading = true;
                // load CarMC from gamemovieclips.swf using PBE's ResourceManager
                //I'm also passing an anonymous function which gets called if gamemovieclips.swf is loaded
                ResourceManager.instance.load("../assets/gamemovieclips.swf", SWFResource, function(resource:Resource):void {
                    // reaching this part of the code means that gamemovieclips.swf was loaded
                    // we will then get an instance of CarMC by calling getExportedAsset below
                    _clipInstance = (resource as SWFResource).getExportedAsset("CarMC") as MovieClip;

                    if (_clipInstance) { // check if the class was actually loaded
                        // if it was loaded, you can now do whatever you want with it

                        // for example, I have a child movieclip in CarMC with instance name "wheel" and I want it stopped initially
                        _wheel = _clipInstance.getChildByName("wheel") as MovieClip;
                        _wheel.stop();
                    }

                    _loading = false;
                });

            }

            // return our CarMC instance that will be rendered to the scene/stage
            return _clipInstance;
        }

        private var _loading:Boolean = false; // set to true if we are currently loading a movieclip
        private var _clipInstance:MovieClip = null; // will temporarily hold the loaded movieclip
        private var _wheel:MovieClip = null;
    }
}
</code></pre>

<p>A problem with this method is that I&#8217;m using <code>ResourceManager</code> to load the swf and then the movieclip. This means that loading the 
movieclip is not instantaneous. I did try a different method for this but somehow couldn&#8217;t get the movieclip loaded into PBE.</p>

<h3>Add the component to the level file</h3>

<p>Now that I have a render class (CarRenderComponent). I can add it to any entity with a spatial component. (Please see PBEngineDemo for 
more info on this)</p>

<pre><code>&lt;entity name="car"&gt;
    &lt;component type="com.pblabs.box2D.Box2DSpatialComponent" name="CarSpatial"&gt;
        ....
    &lt;/component&gt;
    &lt;!-- our render component here --&gt;
    &lt;component type="com.game.renders.CarRenderComponent" name="SWFRender"&gt;
        &lt;loop&gt;true&lt;/loop&gt; &lt;!-- set to TRUE. The SWFRenderComponent will destroy the CarMC once it's done playing if this is FALSE --&gt;
        &lt;positionReference&gt;@CarSpatial.position&lt;/positionReference&gt; &lt;!-- set the spatial's position as the movieclip's position when rendering --&gt;
        &lt;scaleFactor&gt;0.3&lt;/scaleFactor&gt; &lt;!-- you can resize/scale your MC using this --&gt;
        &lt;screenOffset&gt; &lt;!-- or you can offset it's render position from the @CarSpatial.position --&gt;
            &lt;x&gt;0&lt;/x&gt;
            &lt;y&gt;20&lt;/y&gt;
        &lt;/screenOffset&gt;
    &lt;/component&gt;
&lt;/entity&gt;
</code></pre>

<p>One thing I noticed was the properties <code>&lt;sizeReference&gt;</code> and <code>&lt;rotationReference&gt;</code> didn&#8217;t seem to have any effect on the render. 
I&#8217;ll have look at that another time. Maybe I&#8217;m just missing something.</p>

<p>That&#8217;s it. I was happy enough to see the movieclip embedded, rendered and animated on the scene. Hopefully, this will be of help to someone.</p>
<img src="http://feeds.feedburner.com/~r/shikii/OfdV/~4/2uq9-ltspsU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://shikii.net/blog/experiment-using-swf-movieclips-in-pushbutton-engine/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://shikii.net/blog/experiment-using-swf-movieclips-in-pushbutton-engine/</feedburner:origLink></item>
	</channel>
</rss>
