<?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>Small Program Blog &#187; Flex</title>
	<atom:link href="http://blog.sunnycyk.hk/?cat=17&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.sunnycyk.hk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 05 Nov 2011 06:32:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Simple Flash Movie</title>
		<link>http://blog.sunnycyk.hk/?p=342</link>
		<comments>http://blog.sunnycyk.hk/?p=342#comments</comments>
		<pubDate>Fri, 26 Jun 2009 01:56:44 +0000</pubDate>
		<dc:creator>Sunny</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Drawing]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.sunnycyk.hk/?p=342</guid>
		<description><![CDATA[Sometime I saw like a growing tree on some flash movie, and it is very attractive if you have very nice complete branches growing up.  So I tried to do my way.  It is basically a complete picture of a tree(my ugly drawing for test), and a circle mask that grow during the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime I saw like a growing tree on some flash movie, and it is very attractive if you have very nice complete branches growing up.  So I tried to do my way.  It is basically a complete picture of a tree(my ugly drawing for test), and a circle mask that grow during the timeline.  As the result it looks like the tree growing.  These may be the easy and alternate way for doing this effect instead of programming it.<br />
 <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="550" HEIGHT="400" id="myMovieName"><PARAM NAME=movie VALUE="http://blog.sunnycyk.hk/wp-content/uploads/2009/06/branch.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED href="http://blog.sunnycyk.hk/wp-content/uploads/2009/06/branch.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sunnycyk.hk/?feed=rss2&amp;p=342</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScripts 3.0 Client Library for Facebook Platform API</title>
		<link>http://blog.sunnycyk.hk/?p=287</link>
		<comments>http://blog.sunnycyk.hk/?p=287#comments</comments>
		<pubDate>Wed, 08 Apr 2009 06:41:19 +0000</pubDate>
		<dc:creator>Sunny</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.sunnycyk.hk/?p=287</guid>
		<description><![CDATA[I was reading something about how to work with flash and facebook API together, and I found Adobe actually has a client library for that.  
ActionScripts 3.0 Client Library for Facebook Platform API
It is very useful for someone if interesting in developing Facebook App in Flash/Flex.  
]]></description>
			<content:encoded><![CDATA[<p>I was reading something about how to work with flash and facebook API together, and I found Adobe actually has a client library for that.  </p>
<p><a href="http://www.adobe.com/devnet/facebook/">ActionScripts 3.0 Client Library for Facebook Platform API</a></p>
<p>It is very useful for someone if interesting in developing Facebook App in Flash/Flex.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sunnycyk.hk/?feed=rss2&amp;p=287</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex &#8211; Playing with Twitter API and solving the cross-domain problem</title>
		<link>http://blog.sunnycyk.hk/?p=279</link>
		<comments>http://blog.sunnycyk.hk/?p=279#comments</comments>
		<pubDate>Thu, 26 Mar 2009 17:27:30 +0000</pubDate>
		<dc:creator>Sunny</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.sunnycyk.hk/?p=279</guid>
		<description><![CDATA[Today I wrote a small and simple Flex program with Twitter API.  Here is my code:


&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
  &#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; backgroundImage=&#34;@Embed(source='image/twitter_bg.png')&#34; height=&#34;50&#34; width=&#34;850&#34; layout=&#34;absolute&#34; creationComplete=&#34;twitterService.send()&#34;&#62;
&#60;mx:Script&#62;
&#60;![CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;

[Bindable]
private var Feed:Object;

public function twitterHandler(event:ResultEvent):void {
Feed = event.result.user;
}

]]&#62;
&#60;/mx:Script&#62;
&#60;mx:HTTPService id=&#34;twitterService&#34; url=&#34;proxy.php&#34; result=&#34;twitterHandler(event)&#34; /&#62;
  &#60;mx:HBox width=&#34;800&#34; height=&#34;41&#34; verticalCenter=&#34;1&#34; x=&#34;0&#34; verticalAlign=&#34;middle&#34;&#62;
  &#60;mx:Spacer x=&#34;0&#34; y=&#34;0&#34; width=&#34;15&#34;/&#62;
  &#60;mx:Image source=&#34;@Embed(source='image/twitter_logo_header.png')&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Today I wrote a small and simple Flex program with Twitter API.  Here is my code:</p>
<pre>
<code>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; backgroundImage=&quot;@Embed(source='image/twitter_bg.png')&quot; height=&quot;50&quot; width=&quot;850&quot; layout=&quot;absolute&quot; creationComplete=&quot;twitterService.send()&quot;&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;

[Bindable]
private var Feed:Object;

public function twitterHandler(event:ResultEvent):void {
Feed = event.result.user;
}

]]&gt;
&lt;/mx:Script&gt;
&lt;mx:HTTPService id=&quot;twitterService&quot; url=&quot;proxy.php&quot; result=&quot;twitterHandler(event)&quot; /&gt;
  &lt;mx:HBox width=&quot;800&quot; height=&quot;41&quot; verticalCenter=&quot;1&quot; x=&quot;0&quot; verticalAlign=&quot;middle&quot;&gt;
  &lt;mx:Spacer x=&quot;0&quot; y=&quot;0&quot; width=&quot;15&quot;/&gt;
  &lt;mx:Image source=&quot;@Embed(source='image/twitter_logo_header.png')&quot; width=&quot;126&quot; height=&quot;25&quot;/&gt;
  &lt;mx:Image source=&quot;{Feed.profile_image_url}&quot; width=&quot;30&quot; height=&quot;30&quot;/&gt;
  &lt;mx:Label text=&quot;{Feed.screen_name}&quot; fontSize=&quot;16&quot; color=&quot;#2896AD&quot; width=&quot;83&quot;/&gt;
  &lt;mx:Label text=&quot;{Feed.status.text}&quot; width=&quot;498&quot; fontSize=&quot;12&quot; color=&quot;#084755&quot;/&gt;
  &lt;/mx:HBox&gt;
  &lt;/mx:Application&gt;
</code>
</pre>
<p>and you can see the result here: <a href="http://sunnycyk.hk/twitter/">http://sunnycyk.hk/twitter/</a></p>
<p>It may look easy, but actually it takes me sometime to figure out how to make it works.  The code was working fine in debug mode with Flex, but it did not work on release mode.  I was wondering why and searching on internet, and finally figure out it is because of security reason.  </p>
<p>There are couple methods you can try, but I just used a easy way to do it by adding a proxy.php file.  What proxy.php does just requests data from the remote domain site (for my case, it is &#8220;http://twitter.com/users/show/skyc999.xml&#8221;), and regenerates the output so that your flash player will think that you are working with a local XML file.  </p>
<p>When my flash file runs, it will call proxy.php.  Then proxy.php will grab XML file from Twitter, and generate the XML output to my flash file.  Because my flash file only calls the local file, it does not voliate the flash player security policy setting, and everything works again!</p>
<p>The proxy.php only contains two line of code:</p>
<pre>
<code>
&lt;?php
$dataURL = "http://twitter.com/users/show/skyc999.xml";
readfile($dataURL);
?&gt;
</code>
</pre>
<p>If you are a twitter user, you can try my program(download it?) and replace the skyc999  in $dataURL with your screen name.  </p>
<p>This example just gives a basic idea how to work with cross-domain files and Twitter API.  Hope it can help you (and me) <img src='http://blog.sunnycyk.hk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sunnycyk.hk/?feed=rss2&amp;p=279</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
