<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Miscellanea</title>
	<atom:link href="http://userflex.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://userflex.wordpress.com</link>
	<description>Tasty tidbits of Flex knowledge</description>
	<lastBuildDate>Thu, 19 Feb 2009 19:55:51 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='userflex.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/2da6260726694e9125c236d0fd1cc0b2?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Miscellanea</title>
		<link>http://userflex.wordpress.com</link>
	</image>
			<item>
		<title>Tweaking The AS3 Flickr API in Flex and AIR</title>
		<link>http://userflex.wordpress.com/2009/02/19/as3flickrlib-tweaks/</link>
		<comments>http://userflex.wordpress.com/2009/02/19/as3flickrlib-tweaks/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 19:55:51 +0000</pubDate>
		<dc:creator>Nick Schneble</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://userflex.wordpress.com/?p=448</guid>
		<description><![CDATA[I&#8217;ve discovered a handful of issues using the AS3 Flickr API in Flex 3 and AIR, and as a result I&#8217;ve made a number of tweaks, additions and bugfixes to the source code.
Aside from recompiling the SWC (see here), here are the bugs I&#8217;ve found and some of the changes I&#8217;ve made:
Auth.checkToken()
This method is used [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=448&subd=userflex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve discovered a handful of issues using the AS3 Flickr API in Flex 3 and AIR, and as a result I&#8217;ve made a number of tweaks, additions and bugfixes to the source code.</p>
<p>Aside from recompiling the SWC (see <a href="http://userflex.wordpress.com/2009/02/10/flickr-api-flex3/">here</a>), here are the bugs I&#8217;ve found and some of the changes I&#8217;ve made:</p>
<p><span><br /></span><strong>Auth.checkToken()</strong><br />
This method is used to return the credentials attached to an authentication token. If you&#8217;ve already gone through the <a href="http://code.google.com/p/as3flickrlib/wiki/LoginProcess">login process</a> in your application and are loading a saved auth token, this is the method you call to verify the token is still valid.</p>
<p>However there is a bug in the method parameters passed to the flickr.auth.checkToken API method.</p>
<p>Here&#8217;s the original method:</p>
<div style="font-family:courier;border:1px solid #9c9c9c;background-color:#f3f3f3;">
<table>
<tr>
<td>
public function checkToken (token : String) : void<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;MethodGroupHelper.invokeMethod (_service, checkToken_result,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8221;flickr.auth.checkToken&#8221;, false, new NameValuePair<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&#8220;auth_token&#8221;, token));<br />
}
</td>
</tr>
</table>
</div>
<p><span><br /></span>The problem is the fourth parameter; a boolean that determines whether the method needs to be signed. The value here is <em>false</em>, when in fact it needs to be <em>true</em>.</p>
<p>The updated method:</p>
<div style="font-family:courier;border:1px solid #9c9c9c;background-color:#f3f3f3;">
<table>
<tr>
<td>
public function checkToken (token : String) : void<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;MethodGroupHelper.invokeMethod (_service, checkToken_result,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8221;flickr.auth.checkToken&#8221;, <em>true</em>, new NameValuePair<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&#8220;auth_token&#8221;, token));<br />
}
</td>
</tr>
</table>
</div>
<p><span><br /></span><br />
<strong>FlickrService, User Public Properties</strong><br />
These two classes contain a large number of public properties you&#8217;ll likely end up referencing in your application. For FlickrService, this includes the auth token and its associated permissions. For User, this includes the NSID, username and pro status of the authorized Flickr account.</p>
<p>While there&#8217;s nothing wrong with these classes, none of these properties are made [Bindable] by default. So if you reference any of these properties as a bindable value in a MXML component, you&#8217;ll need to modify the source code accordingly.</p>
<p><span><br /></span><strong>User.buddyIconUrl</strong><br />
This is a property I added to the User class. It points to the buddy icon URL of the authorized Flickr user.</p>
<p>You can implement this in one of two ways. First, you could add a basic getter/setter to User, and then set the property in the result handler for a FlickrService.people.getInfo() method call:</p>
<div style="font-family:courier;border:1px solid #9c9c9c;background-color:#f3f3f3;">
<table>
<tr>
<td>
private function onGetInfo (event : FlickrResultEvent) : void<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (event.success)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var user : User = event.data ["user"] as User;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.buddyIconUrl = &#8220;http://farm4.static.flickr.com/&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ user.iconServer + &#8220;/buddyicons/&#8221; + user.nsid + &#8220;.jpg&#8221;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}
</td>
</tr>
</table>
</div>
<p><span><br /></span>Second, you could make the property read-only by adding just the getter to User and building the URL directly in the method:</p>
<div style="font-family:courier;border:1px solid #9c9c9c;background-color:#f3f3f3;">
<table>
<tr>
<td>
public function get buddyIconUrl () : String<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;return &#8220;http://farm4.static.flickr.com/&#8221;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ iconServer + &#8220;/buddyicons/&#8221; + nsid + &#8220;.jpg&#8221;;<br />
}
</td>
</tr>
</table>
</div>
<p><span><br /></span><br />
I&#8217;ll update this post if I discover more bugs or make new tweaks to the API.</p>
Posted in ActionScript, Flex, Flickr Tagged: code, development <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/userflex.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/userflex.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/userflex.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/userflex.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/userflex.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/userflex.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/userflex.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/userflex.wordpress.com/448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/userflex.wordpress.com/448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/userflex.wordpress.com/448/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=448&subd=userflex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://userflex.wordpress.com/2009/02/19/as3flickrlib-tweaks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8818c04436c5e8590d842b521c3626d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nick</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Use The Flickr API in Flex 3</title>
		<link>http://userflex.wordpress.com/2009/02/10/flickr-api-flex3/</link>
		<comments>http://userflex.wordpress.com/2009/02/10/flickr-api-flex3/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 21:34:41 +0000</pubDate>
		<dc:creator>Nick Schneble</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://userflex.wordpress.com/?p=417</guid>
		<description><![CDATA[The AS3 Flickr API on Google Code (as3flickrlib) is a great tool for integrating Flickr into your Flex or Flash application.
But if you want to include the SWC in a Flex 3 or AIR project, you need to download the source code and recompile it as a Flex 3 Library. The SWC included in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=417&subd=userflex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The AS3 Flickr API on Google Code (<a href="http://code.google.com/p/as3flickrlib/">as3flickrlib</a>) is a great tool for integrating Flickr into your Flex or Flash application.</p>
<p>But if you want to include the SWC in a Flex 3 or AIR project, you need to download the source code and recompile it as a Flex 3 Library. The SWC included in the zip file is compiled for Flex 2 and will generate a runtime error when you try to instantiate an instance of FlickrService.</p>
<p>Once you have the Flex 3 SWC in your project, using the actual Flickr API is pretty straightforward. As with all third-party Flickr apps, you first need to authenticate your application for a Flickr user.</p>
<p>Here&#8217;s a simplified version of the <a href="http://code.google.com/p/as3flickrlib/wiki/LoginProcess">login process</a>:</p>
<div style="font-family:courier;border:1px solid #9c9c9c;background-color:#f3f3f3;">
<table>
<tr>
<td>
var flickr : FlickrService = new FlickrService (YOUR_FLICKR_API_KEY);<br />
flickr.secret = YOUR_FLICKR_API_SECRET;<br />
<br />
flickr.addEventListener (FlickrResultEvent.AUTH_GET_FROB, onGetFrob);<br />
<br />
// starts the Flickr login process<br />
flickr.auth.getFrob ();<br />
<br />
private function onGetFrob (event : FlickrResultEvent) : void<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (event.success)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var frob : String = event.data.frob as String;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var authURL : String = flickr.getLoginURL (frob, AuthPerm.READ);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;navigateToURL (new URLRequest (authURL), &#8220;_blank&#8221;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}
</td>
</tr>
</table>
</div>
<p><span><br /></span>The authURL is the page on Flickr where you authenticate your application. Your app needs to be authenticated before you can retrieve an auth token:</p>
<div style="font-family:courier;border:1px solid #9c9c9c;background-color:#f3f3f3;">
<table>
<tr>
<td>
flickr.addEventListener (FlickrResultEvent.AUTH_GET_TOKEN, onGetToken);<br />
<br />
flickr.auth.getToken (frob);<br />
<br />
private function onGetToken (event : FlickrResultEvent) : void<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (event.success)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var authResult : AuthResult = event.data as AuthResult;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flickr.token = authResult.token;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flickr.permission = authResult.perms;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}
</td>
</tr>
</table>
</div>
<p><span><br /></span>Once you have an auth token, you should have access to the private information in the user&#8217;s account, and depending on the permission level, the ability to add, edit and delete photos and metadata.</p>
Posted in ActionScript, Flex, Flickr Tagged: code, development <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/userflex.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/userflex.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/userflex.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/userflex.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/userflex.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/userflex.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/userflex.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/userflex.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/userflex.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/userflex.wordpress.com/417/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=417&subd=userflex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://userflex.wordpress.com/2009/02/10/flickr-api-flex3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8818c04436c5e8590d842b521c3626d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nick</media:title>
		</media:content>
	</item>
		<item>
		<title>Passing Special Chars in Flashvars</title>
		<link>http://userflex.wordpress.com/2009/01/29/special-chars-in-flashvars/</link>
		<comments>http://userflex.wordpress.com/2009/01/29/special-chars-in-flashvars/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 19:57:47 +0000</pubDate>
		<dc:creator>Nick Schneble</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://userflex.wordpress.com/?p=398</guid>
		<description><![CDATA[When you pass in parameters to a Flash or Flex application, you can include most special characters without URL encoding the values.
This includes the following characters:
; / ? : @ $ , # - _ . ! ~ * ' ( )
But as I recently discovered, this doesn&#8217;t apply to plus (+) signs.
If you pass [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=398&subd=userflex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When you pass in parameters to a Flash or Flex application, you can include most special characters without URL encoding the values.</p>
<p>This includes the following characters:<br />
<code>; / ? : @ $ , # - _ . ! ~ * ' ( )</code></p>
<p>But as I recently discovered, this doesn&#8217;t apply to plus (<code>+</code>) signs.</p>
<p>If you pass in a plus sign as part of a parameter, it will automatically be converted into whitespace. To preserve the plus sign, you need to pass in <code>%2b</code>, which is the URL encoding for a plus sign.</p>
Posted in Flash, Flex Tagged: code, development <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/userflex.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/userflex.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/userflex.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/userflex.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/userflex.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/userflex.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/userflex.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/userflex.wordpress.com/398/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/userflex.wordpress.com/398/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/userflex.wordpress.com/398/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=398&subd=userflex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://userflex.wordpress.com/2009/01/29/special-chars-in-flashvars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8818c04436c5e8590d842b521c3626d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nick</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Restrict Your Flex App By Domain</title>
		<link>http://userflex.wordpress.com/2009/01/15/restrict-app-by-domain/</link>
		<comments>http://userflex.wordpress.com/2009/01/15/restrict-app-by-domain/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 23:52:31 +0000</pubDate>
		<dc:creator>Nick Schneble</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://userflex.wordpress.com/?p=369</guid>
		<description><![CDATA[To prevent your Flex app from running on certain domains, you&#8217;ll need to use JS to check the current domain, and then decide how to disable your application.
Here&#8217;s the sample code to retrieve the domain (you&#8217;ll notice it takes advantage of the getWindowLocation() method I defined in an earlier post last year):




private function getDomain () [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=369&subd=userflex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>To prevent your Flex app from running on certain domains, you&#8217;ll need to use JS to check the current domain, and then decide how to disable your application.</p>
<p>Here&#8217;s the sample code to retrieve the domain (you&#8217;ll notice it takes advantage of the getWindowLocation() method I defined in an <a href="http://userflex.wordpress.com/2008/05/15/get-app-location/">earlier post</a> last year):</p>
<div style="font-family:courier;border:1px solid #9c9c9c;background-color:#f3f3f3;">
<table>
<tr>
<td>
private function getDomain () : String<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;var domain : String = getWindowLocation ();<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (domain != null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// removes the &#8220;http://&#8221; or &#8220;https://&#8221; prefix<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain = domain.substring (domain.indexOf (&#8220;//&#8221;) + 2);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// removes the &#8220;www.&#8221; prefix<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (domain.indexOf (&#8220;www.&#8221;) == 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain = domain.substring (4);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// removes the rest of the URL minus the domain<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (domain.indexOf (&#8220;/&#8221;) &gt; 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain = domain.substring (0, domain.indexOf (&#8220;/&#8221;));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;return domain;<br />
}
</td>
</tr>
</table>
</div>
<p><span><br /></span>There are several easy ways to disable your application. It all depends on how crafty you want to be about it.</p>
<p>You can check the current domain on preinitialize, for example, and simply never display the UI for a restricted domain (more on that <a href="http://userflex.wordpress.com/2008/02/07/preload-runtime-styles/">here</a>).</p>
<p>Or you can opt for the classic approach, and open an &#8220;undismissable&#8221; modal dialog to prevent the user from ever interacting with your application.</p>
<p>(or you can just translate everything into Japanese and invert all the colors&#8230; the sky&#8217;s the limit!)  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
Posted in ActionScript, Flex Tagged: code, development <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/userflex.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/userflex.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/userflex.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/userflex.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/userflex.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/userflex.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/userflex.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/userflex.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/userflex.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/userflex.wordpress.com/369/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=369&subd=userflex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://userflex.wordpress.com/2009/01/15/restrict-app-by-domain/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8818c04436c5e8590d842b521c3626d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nick</media:title>
		</media:content>
	</item>
		<item>
		<title>I/O Stream Errors (2032) When Ignoring HTTP Status Events in AIR</title>
		<link>http://userflex.wordpress.com/2009/01/08/io-stream-errors-in-air/</link>
		<comments>http://userflex.wordpress.com/2009/01/08/io-stream-errors-in-air/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 20:05:50 +0000</pubDate>
		<dc:creator>Nick Schneble</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://userflex.wordpress.com/?p=314</guid>
		<description><![CDATA[I recently discovered something interesting trying to implement a REST API call in an AIR application.
When you load a URL request in Flex, you usually listen for complete, I/O error and security error events on the loader. However, I&#8217;ve learned that it&#8217;s important to also listen for HTTP response status events when loading a URL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=314&subd=userflex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I recently discovered something interesting trying to implement a REST API call in an AIR application.</p>
<p>When you load a URL request in Flex, you usually listen for complete, I/O error and security error events on the loader. However, I&#8217;ve learned that it&#8217;s important to also listen for HTTP response status events when loading a URL request in AIR.</p>
<p>Otherwise you might not receive a response when the result is anything other than success (200). Instead, you&#8217;ll receive an I/O error: &#8220;Error #2032: Stream Error.&#8221;</p>
<p>Consider the following sample code:</p>
<div style="font-family:courier;border:1px solid #9c9c9c;background-color:#f3f3f3;">
<table>
<tr>
<td>
var loader : URLLoader = new URLLoader ();<br />
<br />
loader.addEventListener (Event.COMPLETE, onComplete);<br />
loader.addEventListener (IOErrorEvent.IO_ERROR, onIOError);<br />
loader.addEventListener (SecurityErrorEvent.SECURITY_ERROR,<br />
&nbsp;&nbsp;&nbsp;&nbsp;onSecurityError);<br />
<br />
// AIR-only!<br />
loader.addEventListener (HTTPStatusEvent.HTTP_RESPONSE_STATUS,<br />
&nbsp;&nbsp;&nbsp;&nbsp;onHTTPStatus);<br />
<br />
loader.load (request);
</td>
</tr>
</table>
</div>
<p><span><br /></span>No action is required in the onHTTPStatus() method above. As long as you are listening for the event, you will always receive a response.</p>
Posted in ActionScript, AIR, Flex Tagged: code, development <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/userflex.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/userflex.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/userflex.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/userflex.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/userflex.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/userflex.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/userflex.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/userflex.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/userflex.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/userflex.wordpress.com/314/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=userflex.wordpress.com&blog=2607426&post=314&subd=userflex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://userflex.wordpress.com/2009/01/08/io-stream-errors-in-air/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8818c04436c5e8590d842b521c3626d1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nick</media:title>
		</media:content>
	</item>
	</channel>
</rss>