<?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>Kris Range &#187; actionscript</title>
	<atom:link href="http://blog.krisrange.com/tag/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.krisrange.com</link>
	<description>Web development</description>
	<lastBuildDate>Fri, 16 Sep 2011 15:23:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Facebook Graph API library for ActionScript 3</title>
		<link>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/</link>
		<comments>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 09:03:37 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[graph]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=101</guid>
		<description><![CDATA[The company I work for just released an open-source ActionScript 3 library for the Facebook Graph APIs! This library simplifies the creation and acquisition of data from the Facebook Graph API, as well as the expectation of returned data in a consistent and strongly-typed format. This includes, but not limited to, retrieving and posting on [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.dareville.com/">company</a> I work for just released an open-source <a href="http://github.com/Dareville/Facebook-Graph">ActionScript 3 library for the Facebook Graph APIs</a>!</p>
<p>This <a href="http://github.com/Dareville/Facebook-Graph">library</a> simplifies the creation and acquisition of data from the Facebook Graph API, as well as the expectation of returned data in a consistent and strongly-typed format. This includes, but not limited to, retrieving and posting on users’ wall feeds, creating and retrieving events and event statuses, posting comments, searching content and much more!</p>
<p>It does not provide login authentication as there are many other libraries available for this purpose and really…why re-invent the wheel? Some great examples are from <a href="http://www.bigspaceship.com/blog/labs/bss-classes-flash-and-the-fb-graph/">Big Spaceship</a> and <a href="http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/">Jozef Chúťka</a>.</p>
<p>There is some functionality that has not yet been implemented (places, inbox, send email, etc) but our intent is to include them as soon as possible. If you are interested in contributing, please do so with our repository on <a href="http://github.com/Dareville/Facebook-Graph">Github</a>!</p>
<h3>Syntax</h3>
<p>Once you have acquired your <code>access_token</code> from Facebook, you can call any one of the services provided by the API. Keep in mind that you may need to have already prompted the user with specific permissions during the authentication step in order for methods to return data properly. <a href="http://developers.facebook.com/docs/authentication/permissions">See more on Facebook extended permissions</a>.</p>
<p>Almost every method that you can call with these services, dispatches a <a href="http://github.com/robertpenner/as3-signals">Signal</a> upon completion or failure. For full documentation and more information on the signals dispatched, please visit our <a href="http://labs.dareville.com/api/facebookgraph/asdoc/">ASDoc</a></p>
<p>Executing a service is as simple as the following:</p>
<pre>
var service : FacebookUserService = new FacebookUserService();
service.getNewsFeed( access_token );
</pre>
<p>Listening for the response is just as easy, especially if you are familiar with Signals. Add a listener to the signal and create your responder method. Each method is documented in our <a href="http://labs.dareville.com/api/facebookgraph/asdoc/">ASDocs</a> with the provided parameter reteurned.</p>
<pre>service.newsFeedLoaded.addOnce( onNewsFeedLoaded );
function onNewsFeedLoaded( vo : FacebookFeedCollectionData ):void
{
}
</pre>
<h3>Examples</h3>
<h4>Post on current logged in users’ wall</h4>
<pre>var post : FacebookFeedCreatePostData = new FacebookFeedCreatePostData( msg, link, icon );

var service : FacebookUserService = new FacebookUserService();
service.wallPostCreated.addOnce( onWallPostCreated );
service.createWallPost( access_token, FacebookConstants.CONNECTION_ME, post );

function onWallPostCreated( post_id : String ):void
{
}
</pre>
<h4>Get wall post comments</h4>
<pre>var service : FacebookCommentService = new FacebookCommentService();
service.commentsLoaded.addOnce( onCommentsLoad );
service.getComments( access_token, post_id );

function onCommentsLoad( vo : FacebookCommentCollectionData ) : void
{
}
</pre>
<h4>Upload a photo</h4>
<pre>var source : ByteArray = jpg.encode( bmd );
var photo : FacebookPhotoCreateData = new FacebookPhotoCreateData(
&amp;quot;Photo caption&amp;quot;, source );

var service : FacebookPhotoService = new FacebookPhotoService();
service.photoCreated.addOnce( onPhotoCreated );
service.createPhoto( access_token, photo, FacebookConstants.CONNECTION_ME );

function onPhotoCreated( id : String ):void
{
}
</pre>
<p>Check out our blog post as well as our Github and ADDocs:</p>
<p><a href="http://www.dareville.com/post/facebook-graph-as3-api-give-that-baby-a-spin/">Dareville library for Facebook Graph APIs</a><br />
<a href="http://github.com/Dareville/Facebook-Graph">Github library</a><br />
<a href="http://labs.dareville.com/api/facebookgraph/asdoc/">ASDocs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spotify url validation</title>
		<link>http://blog.krisrange.com/2010/05/spotify-url-validation/</link>
		<comments>http://blog.krisrange.com/2010/05/spotify-url-validation/#comments</comments>
		<pubDate>Mon, 31 May 2010 06:28:13 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[spotify]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=43</guid>
		<description><![CDATA[I created this class for a project I am working on where I need to validate Spotify playlist and track URLs. I hope someone will get some use out of it or maybe improve it. It provides two static methods for validating and allows you to specify the return type which currently is a HTTP [...]]]></description>
			<content:encoded><![CDATA[<p>I created this class for a project I am working on where I need to validate Spotify playlist and track URLs. I hope someone will get some use out of it or maybe improve it. It provides two static methods for validating and allows you to specify the return type which currently is a HTTP or Spotify URL format.</p>
<p><a href="http://www.krisrange.com/code/SpotifyUtil.as">SpotifyUtil</a></p>
<p>Here is an example of how to use the method which will convert the link variable below to &#8220;spotify:user:user_name:playlist:3WbWswJtOPIdKBQmZs9pGr&#8221;:</p>
<pre>
var link : String = &quot;http://open.spotify.com/user/user_name/playlist/3WbWswJtOPIdKBQmZs9pGr&quot;;

var validUrl : String = SpotifyUtil.validatePlaylist( link, SpotifyUtil.URL_FORMAT_SPOTIFY );

if( validUrl )
{
	trace( link );
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/05/spotify-url-validation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ANT with JavaScript</title>
		<link>http://blog.krisrange.com/2010/05/ant-with-javascript/</link>
		<comments>http://blog.krisrange.com/2010/05/ant-with-javascript/#comments</comments>
		<pubDate>Thu, 20 May 2010 16:55:49 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=26</guid>
		<description><![CDATA[Recently at work we had the need to build an application that could both be run over the network and on the local filesystem. Well, this doesn&#8217;t work with the Flash security setup as SWF files can only be run on one or the other. Like many other developers, we use ANT to build our [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at work we had the need to build an application that could both be run over the network and on the local filesystem. Well, this doesn&#8217;t work with the Flash security setup as SWF files can only be run on one or the other. Like many other developers, we use ANT to build our projects and would like setting this property to be built into our build files. The SDK compiler has a nice property called &#8220;use-network&#8221; which can easily be set to true or false depending on your need which solves this situation nicely. The problem we ran into was with ANT and dealing with IF/ELSE target statements.</p>
<p>What we wanted to do was to use the same build SWF targets but for both situations without having to modify our process. Our solution was a nifty trick that used JavaScript inside ANT. I had never seen this technique before but some searching for a solution led us in this direction.</p>
<p>As you can see below, we have two initial targets, one which builds for local file system and one which builds for network use. We can then run either target first, which sets a property in our ANT file and then run our normal SWF build targets as normal, with this property set to the &#8220;use-network&#8221; property. Really looking forward to exploring some more complexities with JavaScript integration (as well as other languages from what I&#8217;ve read).</p>
<pre>
&lt;target name=&quot;compile_local&quot;&gt;
	&lt;script language=&quot;javascript&quot;&gt;
	&lt;![CDATA[
		presenter.setProperty( &quot;use-network&quot;, &quot;false&quot; );
	]]&gt;
	&lt;/script&gt;
&lt;/target&gt;
&lt;target name=&quot;compile_network&quot;&gt;
	&lt;script language=&quot;javascript&quot;&gt;
	&lt;![CDATA[
		presenter.setProperty( &quot;use-network&quot;, &quot;true&quot; );
	]]&gt;
	&lt;/script&gt;
&lt;/target&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/05/ant-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just launched SNOOP420.COM</title>
		<link>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/</link>
		<comments>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 21:28:23 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[launch]]></category>
		<category><![CDATA[420]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snoop]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=20</guid>
		<description><![CDATA[Check it out! Props go out to our team for all the work that went into it! SNOOP 4:20]]></description>
			<content:encoded><![CDATA[<p>Check it out! Props go out to our team for all the work that went into it!</p>
<p><a href="http://www.snoop420.com/">SNOOP 4:20</a></p>
<p><img src="http://media.tumblr.com/tumblr_l172aeLbmD1qa1ofo.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting build version numbers into Flash and Flex Applications</title>
		<link>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/</link>
		<comments>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 09:16:12 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=12</guid>
		<description><![CDATA[For an ActionScript project I am currently working on (and for future projects), we wanted to be able to include the ANT build number into our applications when we do development and production quality releases to clients. The added value in this is that it is extremely helpful if you are constently pushing releases. It [...]]]></description>
			<content:encoded><![CDATA[<p>For an ActionScript project I am currently working on (and for future projects), we wanted to be able to include the ANT build number into our applications when we do development and production quality releases to clients. The added value in this is that it is extremely helpful if you are constently pushing releases. It saves time so that we can easily tell what version our clients are running on their development and production servers. This helps avoid unneeded debugging time making sure that the versions are correct. We also wanted this to happen automatically, or as much as possible, without the need for us to modify text files or add compiler variables.</p>
<p>Ok, lets get started! First, all of these instructions assumes you have a good knowledge in how ANT works. It also assumes you will be building an ActionScript or Flex project. In this case, we are going to be creating a custom ContextMenu but you can really do this for anything. This will allow anyone us to see the version numbers when they right click on our application.</p>
<p>Ok, so how is this done? Open up your build.properties file for the project and add the following lines:</p>
<pre>
project.major	  = 1
project.minor     = 0
project.revision  = 0
project.version   = ${project.major}.${project.minor}.${project.revision}
</pre>
<p>The projet will act as our properties for figuring out the project major, minor and revision. These could probably be automated in some way but for now I am ok with manually setting these values since I will know when these versions change. We will also need to include a build number into our build so just add the following before anything else into your build file. Also note that if this file does not exist, ANT will create it for you so no need to concern yourself with what the contents are. Let ANT do the dirty work!</p>
<pre>
&lt;buildnumber file=&quot;${basedir}/build/build.number&quot; /&gt;
</pre>
<p>Next, we are going to want to copy our classes to a temporary directory so that we can modify them without harming the source. As you can see I have some temp.outdir and classes.dir properties</p>
<pre>

&lt;target name=&quot;copyClasses&quot; description=&quot;Creates a temporary directory where the code will be duplicated so we can modify and build without harming the original files&quot;&gt;
	&lt;mkdir dir=&quot;${temp.outdir}&quot; /&gt;
	&lt;copy todir=&quot;${temp.outdir}&quot;&gt;
		&lt;fileset dir=&quot;${classes.dir}&quot;/&gt;
	&lt;/copy&gt;
&lt;/target&gt;
</pre>
<p>Now that our classes are copied, we need to do a search on them for particular strings that we will end up replacing with the project version. In my case, I have a ContextMenu class which has a string value defined as &#8220;[PROJECT_VERSION_NUMBER]&#8221; so I do a regular expression replace in ANT to find that value and replace it.</p>
<pre>

&lt;target name=&quot;projectversion&quot; description=&quot;&quot;&gt;
	&lt;replaceregexp match=&quot;[PROJECT_VERSION_NUMBER]&quot; replace=&quot;${project.fullname} : ${project.version}.${build.number}&quot; flags=&quot;gs&quot;&gt;
		&lt;fileset dir=&quot;${temp.outdir}&quot; includes=&quot;**/*.as&quot;/&gt;
	&lt;/replaceregexp&gt;
&lt;/target&gt;
</pre>
<p>And that is it. Now we have our build number plus project version automatically showing up in our application.</p>
<div style="text-align: center;"><img src="http://media.tumblr.com/tumblr_l0792hZFA61qa1ofo.png" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

