<?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>Mobile App Development</title>
	<atom:link href="http://myappsnippet.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://myappsnippet.com</link>
	<description>Mobile App Snippets</description>
	<lastBuildDate>Thu, 23 May 2013 10:48:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>File Browser Air Extension</title>
		<link>http://myappsnippet.com/file-browser-air-extension/</link>
		<comments>http://myappsnippet.com/file-browser-air-extension/#comments</comments>
		<pubDate>Mon, 06 May 2013 09:03:07 +0000</pubDate>
		<dc:creator>Hadi Tavakoli</dc:creator>
				<category><![CDATA[air]]></category>
		<category><![CDATA[air native extension]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[ane]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[file browse]]></category>
		<category><![CDATA[native extension]]></category>
		<category><![CDATA[sdcard]]></category>
		<category><![CDATA[select files from sdcard]]></category>
		<category><![CDATA[select multiple files]]></category>
		<category><![CDATA[single]]></category>

		<guid isPermaLink="false">http://myappsnippet.com/?post_type=portfolio_mod&#038;p=280</guid>
		<description><![CDATA[&#160; File Browser Air Native Extension for Adobe AIR developers Do you want to browse the sdcard from your Air mobile project? and let the user to pick one or some files to use inside your app? well, you don&#8217;t have to build the whole interface inside Air, instead, you can use this cool extension [...]]]></description>
				<content:encoded><![CDATA[<div class="columns two_third">
<span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/05/fileBrowser-adobe-air-extension_preview.jpg" alt="File browser Air native extension" style=" width:610px; height:330px;"/></span></p>
</div>
<div class="columns one_third last">
<table class="pricing_table" cellspacing="0">
<tbody>
<tr>
<td class="top_featured_green"></td>
</tr>
<tr class="price_head">
<td class="featured_green" valign="middle">
<h2>$13</h2>
</td>
</tr>
<tr class="price_body">
<td class="title" valign="middle">
Future updates are free<br />
Clean and clear Documentation
	</td>
</tr>
<tr class="price_body">
<td><object class="eStore_button_object"><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return ReadForm1(this, 2);"><input type="hidden" name="product_name_tmp1" value="File Browse air native extension" /><input type="hidden" name="price_tmp1" value="13" /><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="payments@premierweb.net.au" /><input type="hidden" name="item_name" value="File Browse air native extension" /><input type="hidden" name="amount" value="13" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="item_number" value="12" /><input type="hidden" name="no_shipping" value='1' /><input type="hidden" name="notify_url" value="http://myappsnippet.com/wp-content/plugins/wp-cart-for-digital-products/paypal.php" /><input type="hidden" name="return" value="http://myappsnippet.com/thank-you/" /><input type="hidden" name="mrb" value="3FWGC6LFTMTUG" /><input type="hidden" name="cbt" value="" /><input type="hidden" name="page_style" value="" /><input type="hidden" name="custom" value="ip=54.234.126.92" id="eStore_custom_values" /><input type="submit" class="eStore_buy_now_button" value="Buy Now" /></form>
<p></object></td>
</tr>
</tbody>
</table>
<p><img src="http://myappsnippet.com/wp-content/uploads/2013/01/gcm_ic.png" alt="" width="285" height="72" class="aligncenter size-full wp-image-156" />
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<div class="columns one_half">
<a href="http://myappsnippet.com/instruction-extensions-ides/" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/02/extensions-how-to-on-different-IDEs.png" alt="Click to get the instruction on how to use extensions on different IDEs" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="columns one_half last">
<a href="https://play.google.com/store/apps/details?id=air.com.doitflash.exFileBrowser" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/05/adobe-air-extension_demo-app_file-browser.png" alt="Click or scan to checkout the demo app" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="Introduction" name="Introduction">&nbsp;</a></p>
<h2>File Browser Air Native Extension for Adobe AIR developers</h2>
<p>Do you want to <strong>browse the sdcard</strong> from your Air mobile project? and let the user to pick one or some files to use inside your app? well, you don&#8217;t have to build the whole interface inside Air, instead, you can use this cool extension to easily open a file browser dialog window and browse through files and folders in your sdcard and touch to pick the files you want.</p>
<ul>
<li>Easily call and open a browser dialog</li>
<li>select <strong>multiple files</strong></li>
<li><strong>search</strong> files and folders</li>
<li>preview icon for popular files</li>
<li>get full path to selected files</li>
</ul>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:0px;"></span></p>
<p>Below is a usage sample code: you may also check out the sample FLashDevelop project below. (to run the sample project, you should copy the .ane into the lib folder and of course set the path to Flex and Android locations from bat/SetupSDK.bat)</p>
<div><a href="http://myappsnippet.com/downloads/AIR_EXTENSIONS/fileBrowse/fileBrowse_AIR.zip" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Click to download the sample FlashDevelop project</span></span></span></a></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>fileBrowse<span style="color: #339933;">.</span>FileBrowser<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>fileBrowse<span style="color: #339933;">.</span>BrowseEvent<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>FileBrowser <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FileBrowser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>BrowseEvent<span style="color: #339933;">.</span>FILE_SELECT<span style="color: #339933;">,</span> onFileSelected<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>BrowseEvent<span style="color: #339933;">.</span>SELECT_CANCELED<span style="color: #339933;">,</span> onBrowseCanceled<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>showHiddenFiles <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>labels <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;SELECT&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;CANCEL&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>mode <span style="color: #339933;">=</span> FileBrowser<span style="color: #339933;">.</span>MULTIPLE<span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>open<span style="color: #009900;">&#40;</span><a href="http://www.php.net/file"><span style="color: #990000;">File</span></a><span style="color: #339933;">.</span>documentsDirectory<span style="color: #339933;">.</span>resolvePath<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// path to the root of your sdcard</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onBrowseCanceled<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>BrowseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Browsing canceled&quot;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onFileSelected<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>BrowseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>int <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> e<span style="color: #339933;">.</span>param<span style="color: #339933;">.</span>length<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">.</span>param<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span></p>
<p>don&#8217;t forget to include the necessary permissions in the android manifest file <span style="color: #993300">application.xml</span></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.READ_EXTERNAL_STORAGE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>Regards,<br />
MyFlashLab Team</p>
]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/file-browser-air-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading Dialog Air Extension</title>
		<link>http://myappsnippet.com/loading-dialog-air-extension/</link>
		<comments>http://myappsnippet.com/loading-dialog-air-extension/#comments</comments>
		<pubDate>Sun, 05 May 2013 07:24:21 +0000</pubDate>
		<dc:creator>Hadi Tavakoli</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[air native extension]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Android loading dialog]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[custom icon]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[loading]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[percentage]]></category>
		<category><![CDATA[progressive]]></category>

		<guid isPermaLink="false">http://myappsnippet.com/?post_type=portfolio_mod&#038;p=272</guid>
		<description><![CDATA[&#160; Android Loading dialog native extension for Adobe AIR developers With android loading dialog extension you can easily create loading dialogs and control them from your Air project. you can create the dialog and decide if it is cancelable by device back button or not you can optionally create a BitmapData in your project and [...]]]></description>
				<content:encoded><![CDATA[<div class="columns two_third">
<span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/05/loading-adobe-air-extension_preview.jpg" alt="Android loading dialog air native extension" style=" width:610px; height:330px;"/></span></p>
</div>
<div class="columns one_third last">
<table class="pricing_table" cellspacing="0">
<tbody>
<tr>
<td class="top_featured_green"></td>
</tr>
<tr class="price_head">
<td class="featured_green" valign="middle">
<h2>$9</h2>
</td>
</tr>
<tr class="price_body">
<td class="title" valign="middle">
Future updates are free<br />
Clean and clear Documentation
	</td>
</tr>
<tr class="price_body">
<td><object class="eStore_button_object"><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return ReadForm1(this, 2);"><input type="hidden" name="product_name_tmp1" value="Loading dialog air native extension" /><input type="hidden" name="price_tmp1" value="9" /><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="payments@premierweb.net.au" /><input type="hidden" name="item_name" value="Loading dialog air native extension" /><input type="hidden" name="amount" value="9" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="item_number" value="10" /><input type="hidden" name="no_shipping" value='1' /><input type="hidden" name="notify_url" value="http://myappsnippet.com/wp-content/plugins/wp-cart-for-digital-products/paypal.php" /><input type="hidden" name="return" value="http://myappsnippet.com/thank-you/" /><input type="hidden" name="mrb" value="3FWGC6LFTMTUG" /><input type="hidden" name="cbt" value="" /><input type="hidden" name="page_style" value="" /><input type="hidden" name="custom" value="ip=54.234.126.92" id="eStore_custom_values" /><input type="submit" class="eStore_buy_now_button" value="Buy Now" /></form>
<p></object></td>
</tr>
</tbody>
</table>
<p><img src="http://myappsnippet.com/wp-content/uploads/2013/01/gcm_ic.png" alt="" width="285" height="72" class="aligncenter size-full wp-image-156" />
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<div class="columns one_half">
<a href="http://myappsnippet.com/instruction-extensions-ides/" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/02/extensions-how-to-on-different-IDEs.png" alt="Click to get the instruction on how to use extensions on different IDEs" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="columns one_half last">
<a href="https://play.google.com/store/apps/details?id=air.com.doitflash.exLoading" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/05/adobe-air-extension_demo-app_loading.png" alt="Click or scan to checkout the demo app" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="Introduction" name="Introduction">&nbsp;</a></p>
<h2>Android Loading dialog native extension for Adobe AIR developers</h2>
<p>With android loading dialog extension you can easily create loading dialogs and control them from your Air project.</p>
<ul>
<li>you can create the dialog and decide if it is cancelable by device back button or not</li>
<li>you can optionally create a BitmapData in your project and send to the extension to show on the dialog</li>
<li>you can create <strong>classic</strong> or <strong>progressive</strong> dialogs</li>
<li>you can <strong>set the position of the dialog</strong> on your screen</li>
<li><strong>custom title and message</strong></li>
</ul>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:0px;"></span></p>
<p>Please check out the sample FLashDevelop project below. (to run the sample project, you should copy the .ane into the lib folder and of course set the path to Flex and Android locations from bat/SetupSDK.bat)</p>
<div><a href="http://myappsnippet.com/downloads/AIR_EXTENSIONS/loading/loading_AIR.zip" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Click to download the sample FlashDevelop project</span></span></span></a></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span><br />
The following example shows how you can create a classic loading dialog window</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>loading<span style="color: #339933;">.</span>Loading<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>loading<span style="color: #339933;">.</span>LoadingEvent<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>Loading <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Loading<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// optionally set a listener to see when the dialog is closed!</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>LoadingEvent<span style="color: #339933;">.</span>DIALOG_CANCELED<span style="color: #339933;">,</span> onDialogClosed<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// check doc files to see how you can set the position of the dialog and even set a custom BitmapData!</span><br />
_ex<span style="color: #339933;">.</span>showLoading<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;loading message...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<br />
<span style="color: #666666; font-style: italic;">// close the dialog when you don't need it with the following method</span><br />
<span style="color: #666666; font-style: italic;">// _ex.hideLoading();</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onDialogClosed<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>LoadingEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dialog closed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span><br />
The folloiwng example shows how to create a progressive loading dialog and how to update its value</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>loading<span style="color: #339933;">.</span>Loading<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>Loading <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Loading<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// check doc files to see how you can set the position of the dialog and even set a custom BitmapData!</span><br />
<span style="color: #666666; font-style: italic;">// in this example we have set 100 as the max value and 10 as the current value</span><br />
_ex<span style="color: #339933;">.</span>showProgressiveLoading<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;loading message...&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<br />
<span style="color: #666666; font-style: italic;">// if you want to change the value, add value to the current value</span><br />
<span style="color: #666666; font-style: italic;">// _ex.updateProgressiveLoading(10); // this value will be added to the previuse value the new value will be 10 + 10 = 20</span></div></td></tr></tbody></table></div>
<p>don&#8217;t forget to include the necessary activity in the android manifest file <span style="color: #993300">application.xml</span></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activity</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;com.doitflash.loading.ProgressBars&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">android:theme</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.Translucent&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>Regards,<br />
MyFlashLab Team</p>
]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/loading-dialog-air-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Like Menu Air Extension</title>
		<link>http://myappsnippet.com/android-menu-air-extension/</link>
		<comments>http://myappsnippet.com/android-menu-air-extension/#comments</comments>
		<pubDate>Sat, 04 May 2013 08:27:59 +0000</pubDate>
		<dc:creator>Hadi Tavakoli</dc:creator>
				<category><![CDATA[adnroid menu bar]]></category>
		<category><![CDATA[Air Extension]]></category>
		<category><![CDATA[air native extension]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[android menu]]></category>
		<category><![CDATA[android native menu]]></category>
		<category><![CDATA[android naviagtion]]></category>
		<category><![CDATA[ane]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[menu with icons]]></category>
		<category><![CDATA[setting]]></category>

		<guid isPermaLink="false">http://myappsnippet.com/?post_type=portfolio_mod&#038;p=270</guid>
		<description><![CDATA[&#160; Android like menu Air Native Extension for Adobe AIR developers Using AS3 and Air for developing mobile apps is very cool but I&#8217;m sure you always wanted to be able to build an android like menu in your projects to avoid writing many lines of code to create your own menu! now with this [...]]]></description>
				<content:encoded><![CDATA[<div class="columns two_third">
<span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/05/androidMenu-adobe-air-extension_preview.jpg" alt="Android like menu Air native extension" style=" width:610px; height:330px;"/></span></p>
</div>
<div class="columns one_third last">
<table class="pricing_table" cellspacing="0">
<tbody>
<tr>
<td class="top_featured_green"></td>
</tr>
<tr class="price_head">
<td class="featured_green" valign="middle">
<h2>$10</h2>
</td>
</tr>
<tr class="price_body">
<td class="title" valign="middle">
Future updates are free<br />
Clean and clear Documentation
	</td>
</tr>
<tr class="price_body">
<td><object class="eStore_button_object"><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return ReadForm1(this, 2);"><input type="hidden" name="product_name_tmp1" value="Android like menu air native extension" /><input type="hidden" name="price_tmp1" value="10" /><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="payments@premierweb.net.au" /><input type="hidden" name="item_name" value="Android like menu air native extension" /><input type="hidden" name="amount" value="10" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="item_number" value="9" /><input type="hidden" name="no_shipping" value='1' /><input type="hidden" name="notify_url" value="http://myappsnippet.com/wp-content/plugins/wp-cart-for-digital-products/paypal.php" /><input type="hidden" name="return" value="http://myappsnippet.com/thank-you/" /><input type="hidden" name="mrb" value="3FWGC6LFTMTUG" /><input type="hidden" name="cbt" value="" /><input type="hidden" name="page_style" value="" /><input type="hidden" name="custom" value="ip=54.234.126.92" id="eStore_custom_values" /><input type="submit" class="eStore_buy_now_button" value="Buy Now" /></form>
<p></object></td>
</tr>
</tbody>
</table>
<p><img src="http://myappsnippet.com/wp-content/uploads/2013/01/gcm_ic.png" alt="" width="285" height="72" class="aligncenter size-full wp-image-156" />
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<div class="columns one_half">
<a href="http://myappsnippet.com/instruction-extensions-ides/" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/02/extensions-how-to-on-different-IDEs.png" alt="Click to get the instruction on how to use extensions on different IDEs" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="columns one_half last">
<a href="https://play.google.com/store/apps/details?id=air.com.doitflash.exAndroidMenu" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/05/adobe-air-extension_demo-app_android-menu.png" alt="Click or scan to checkout the demo app" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="Introduction" name="Introduction">&nbsp;</a></p>
<h2>Android like menu Air Native Extension for Adobe AIR developers</h2>
<p>Using AS3 and Air for developing mobile apps is very cool but I&#8217;m sure you always wanted to be able to build an android like menu in your projects to avoid writing many lines of code to create your own menu! now with this extension, you can create a native extension which looks and works similar to how menus work in android.</p>
<ul>
<li>modify colors</li>
<li>insert as many buttons as you like</li>
<li>custom icon and label</li>
<li>custom arrangment</li>
<li>modify animation effect</li>
</ul>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:0px;"></span></p>
<p>Below is a usage sample code: you may also check out the sample FLashDevelop project below. (to run the sample project, you should copy the .ane into the lib folder and of course set the path to Flex and Android locations from bat/SetupSDK.bat)</p>
<div><a href="http://myappsnippet.com/downloads/AIR_EXTENSIONS/menu/androidMenu_AIR.zip" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Click to download the sample FlashDevelop project</span></span></span></a></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>androidMenu<span style="color: #339933;">.</span>AndroidMenu<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>androidMenu<span style="color: #339933;">.</span>AndroidMenuEvent<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>AndroidMenu <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AndroidMenu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>AndroidMenuEvent<span style="color: #339933;">.</span>SELECT<span style="color: #339933;">,</span> onSelect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>numColumns <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>labelColor <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #208080;">0x666666</span><span style="color: #339933;">,</span> <span style="color: #208080;">0xFFFFFF</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>menuColor <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #208080;">0x111111</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x333333</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>speed <span style="color: #339933;">=</span> <span style="color: #cc66cc;">500</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
_ex<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span> id<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">,</span> icon<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;menu/icon3.png&quot;</span><span style="color: #339933;">,</span> name<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;BUTTON 1&quot;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span> id<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">,</span> icon<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;menu/icon4.png&quot;</span><span style="color: #339933;">,</span> name<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;BUTTON 2&quot;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span> id<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #339933;">,</span> icon<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;menu/icon1.png&quot;</span><span style="color: #339933;">,</span> name<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;BUTTON 3&quot;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span> id<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">,</span> icon<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;menu/icon0.png&quot;</span><span style="color: #339933;">,</span> name<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;BUTTON 4&quot;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span> id<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #339933;">,</span> icon<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;menu/icon5.png&quot;</span><span style="color: #339933;">,</span> name<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;BUTTON 5&quot;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#123;</span> id<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #339933;">,</span> icon<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;menu/icon2.png&quot;</span><span style="color: #339933;">,</span> name<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;BUTTON 6&quot;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
_ex<span style="color: #339933;">.</span>prepare<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>open<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">// _ex.close();</span><br />
<span style="color: #666666; font-style: italic;">// _ex.isOpen;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onSelect<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>AndroidMenuEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id of the selected menu: &quot;</span> <span style="color: #339933;">+</span> e<span style="color: #339933;">.</span>param<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span></p>
<p>don&#8217;t forget to include the necessary permissions in the android manifest file <span style="color: #993300">application.xml</span></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.READ_EXTERNAL_STORAGE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>Regards,<br />
MyFlashLab Team</p>
]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/android-menu-air-extension/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PDF Reader Air Native Extension</title>
		<link>http://myappsnippet.com/pdf-reader-air-native-extensions/</link>
		<comments>http://myappsnippet.com/pdf-reader-air-native-extensions/#comments</comments>
		<pubDate>Wed, 01 May 2013 05:12:04 +0000</pubDate>
		<dc:creator>Hadi Tavakoli</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[air native extension]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[open pdf file]]></category>
		<category><![CDATA[pdf reader]]></category>
		<category><![CDATA[sdcard]]></category>

		<guid isPermaLink="false">http://myappsnippet.com/?post_type=portfolio_mod&#038;p=265</guid>
		<description><![CDATA[&#160; PDF Reader Extension for Adobe AIR developers Opening pdf files, something useful but impossible for an AIR app developer. Now it&#8217;s easy and possible If you have ever wanted to be able to open pdf files from your Air app, this extension can do the job easily for you! 12345678910111213141516171819202122232425import com.doitflash.air.extensions.pdf.PdfViewer; import com.doitflash.air.extensions.pdf.PdfViewerEvent; import [...]]]></description>
				<content:encoded><![CDATA[<div class="columns two_third">
<span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/05/pdfViewer-adobe-air-extension_preview.jpg" alt="Speech API adobe air extension" style=" width:610px; height:330px;"/></span></p>
</div>
<div class="columns one_third last">
<table class="pricing_table" cellspacing="0">
<tbody>
<tr>
<td class="top_featured_green"></td>
</tr>
<tr class="price_head">
<td class="featured_green" valign="middle">
<h2>$5</h2>
</td>
</tr>
<tr class="price_body">
<td class="title" valign="middle">
Future updates are free<br />
Clean and clear Documentation
	</td>
</tr>
<tr class="price_body">
<td><object class="eStore_button_object"><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return ReadForm1(this, 2);"><input type="hidden" name="product_name_tmp1" value="PDF reader air native extension" /><input type="hidden" name="price_tmp1" value="5" /><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="payments@premierweb.net.au" /><input type="hidden" name="item_name" value="PDF reader air native extension" /><input type="hidden" name="amount" value="5" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="item_number" value="8" /><input type="hidden" name="no_shipping" value='1' /><input type="hidden" name="notify_url" value="http://myappsnippet.com/wp-content/plugins/wp-cart-for-digital-products/paypal.php" /><input type="hidden" name="return" value="http://myappsnippet.com/thank-you/" /><input type="hidden" name="mrb" value="3FWGC6LFTMTUG" /><input type="hidden" name="cbt" value="" /><input type="hidden" name="page_style" value="" /><input type="hidden" name="custom" value="ip=54.234.126.92" id="eStore_custom_values" /><input type="submit" class="eStore_buy_now_button" value="Buy Now" /></form>
<p></object></td>
</tr>
</tbody>
</table>
<p><img src="http://myappsnippet.com/wp-content/uploads/2013/01/gcm_ic.png" alt="" width="285" height="72" class="aligncenter size-full wp-image-156" />
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<div class="columns one_half">
<a href="http://myappsnippet.com/instruction-extensions-ides/" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/02/extensions-how-to-on-different-IDEs.png" alt="Click to get the instruction on how to use extensions on different IDEs" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="columns one_half last">
<a href="https://play.google.com/store/apps/details?id=air.com.doitflash.exPdfViewer" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/05/adobe-air-extension_demo-app_pdf-viewer.png" alt="Click or scan to checkout the demo app" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="Introduction" name="Introduction">&nbsp;</a></p>
<h2>PDF Reader Extension for Adobe AIR developers</h2>
<p>Opening pdf files, something useful but impossible for an AIR app developer. Now it&#8217;s easy and possible <img src='http://myappsnippet.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you have ever wanted to be able to open pdf files from your Air app, this extension can do the job easily for you!</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>pdf<span style="color: #339933;">.</span>PdfViewer<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>pdf<span style="color: #339933;">.</span>PdfViewerEvent<span style="color: #339933;">;</span><br />
import flash<span style="color: #339933;">.</span>filesystem<span style="color: #339933;">.</span><a href="http://www.php.net/file"><span style="color: #990000;">File</span></a><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>PdfViewer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PdfViewer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>PdfViewerEvent<span style="color: #339933;">.</span>ERROR<span style="color: #339933;">,</span> onError<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>PdfViewerEvent<span style="color: #339933;">.</span>OPEN<span style="color: #339933;">,</span> onOpen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>PdfViewerEvent<span style="color: #339933;">.</span>CLOSE<span style="color: #339933;">,</span> onClose<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
_ex<span style="color: #339933;">.</span>read<span style="color: #009900;">&#40;</span><a href="http://www.php.net/file"><span style="color: #990000;">File</span></a><span style="color: #339933;">.</span>documentsDirectory<span style="color: #339933;">.</span>resolvePath<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;file.pdf&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onOpen<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>PdfViewerEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pdf opened&quot;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onClose<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>PdfViewerEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pdf closed&quot;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onError<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>PdfViewerEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ERROR: &quot;</span><span style="color: #339933;">,</span> e<span style="color: #339933;">.</span>param<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span></p>
<div><a href="http://myappsnippet.com/downloads/AIR_EXTENSIONS/pdf/pdfViewer_AIR.zip" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Click to download the sample FlashDevelop project</span></span></span></a></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:1px;"></span><br />
To run the sample project, you should copy the .ane into the lib folder and of course set the path to Flex and Android locations from bat/SetupSDK.bat<br />
<span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span><br />
don&#8217;t forget to include the necessary activity in the android manifest file <span style="color: #993300">application.xml</span></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activity</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;com.doitflash.pdfViewer.Cargo&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">android:theme</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.Black.NoTitleBar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>Regards,<br />
MyFlashLab Team</p>
]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/pdf-reader-air-native-extensions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google speech API Air Extension</title>
		<link>http://myappsnippet.com/google-speech-api-air-native-extension/</link>
		<comments>http://myappsnippet.com/google-speech-api-air-native-extension/#comments</comments>
		<pubDate>Wed, 24 Apr 2013 08:24:11 +0000</pubDate>
		<dc:creator>Hadi Tavakoli</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[android activity]]></category>
		<category><![CDATA[ane]]></category>
		<category><![CDATA[convert text to voice]]></category>
		<category><![CDATA[convert voice to text]]></category>
		<category><![CDATA[Google speech API]]></category>
		<category><![CDATA[speech api]]></category>
		<category><![CDATA[TTS]]></category>

		<guid isPermaLink="false">http://myappsnippet.com/?post_type=portfolio_mod&#038;p=259</guid>
		<description><![CDATA[&#160; Google speech API Extension for Adobe AIR developers The Google speech recognition tech on Android is very cool and enables developers to build many different apps but air developers couldn&#8217;t use this library as it was written in native java! but now, you can use this light Air extension, only 79kb, and simply convert [...]]]></description>
				<content:encoded><![CDATA[<div class="columns two_third">
<span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/04/speechApi-adobe-air-extension_preview.jpg" alt="Speech API adobe air extension" style=" width:610px; height:330px;"/></span></p>
</div>
<div class="columns one_third last">
<table class="pricing_table" cellspacing="0">
<tbody>
<tr>
<td class="top_featured_green"></td>
</tr>
<tr class="price_head">
<td class="featured_green" valign="middle">
<h2>$15</h2>
</td>
</tr>
<tr class="price_body">
<td class="title" valign="middle">
Future updates are free<br />
Clean and clear Documentation
	</td>
</tr>
<tr class="price_body">
<td><object class="eStore_button_object"><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return ReadForm1(this, 2);"><input type="hidden" name="product_name_tmp1" value="speechAPI air native extension" /><input type="hidden" name="price_tmp1" value="15" /><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="payments@premierweb.net.au" /><input type="hidden" name="item_name" value="speechAPI air native extension" /><input type="hidden" name="amount" value="15" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="item_number" value="7" /><input type="hidden" name="no_shipping" value='1' /><input type="hidden" name="notify_url" value="http://myappsnippet.com/wp-content/plugins/wp-cart-for-digital-products/paypal.php" /><input type="hidden" name="return" value="http://myappsnippet.com/thank-you/" /><input type="hidden" name="mrb" value="3FWGC6LFTMTUG" /><input type="hidden" name="cbt" value="" /><input type="hidden" name="page_style" value="" /><input type="hidden" name="custom" value="ip=54.234.126.92" id="eStore_custom_values" /><input type="submit" class="eStore_buy_now_button" value="Buy Now" /></form>
<p></object></td>
</tr>
</tbody>
</table>
<p><img src="http://myappsnippet.com/wp-content/uploads/2013/01/gcm_ic.png" alt="" width="285" height="72" class="aligncenter size-full wp-image-156" />
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<div class="columns one_half">
<a href="http://myappsnippet.com/instruction-extensions-ides/" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/02/extensions-how-to-on-different-IDEs.png" alt="Click to get the instruction on how to use extensions on different IDEs" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="columns one_half last">
<a href="https://play.google.com/store/apps/details?id=air.com.doitflash.exSpeech" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/04/adobe-air-extension_demo-app_speech-api.png" alt="Click or scan to checkout the demo app" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="Introduction" name="Introduction">&nbsp;</a></p>
<h2>Google speech API Extension for Adobe AIR developers</h2>
<p>The Google speech recognition tech on Android is very cool and enables developers to build many different apps but air developers couldn&#8217;t use this library as it was written in native java! but now, you can use this light Air extension, only 79kb, and simply convert text strings into sound objects to play in your air app and also convert voice messages into text words or sentences!</p>
<p>Did you ever liked to develop an AIR app that uses voice commands or wished to create a beautiful AIR dictionary or something like that? Google Speech API Extension now makes things easy for you <img src='http://myappsnippet.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ul>
<li><strong>different languages supported</strong> (all of the languages that Google Speech API supports)</li>
<li>Text to speech</li>
<li>Speech to text</li>
<li>say something, Extension lists anything that understood from your voice. <strong>handy when creating voice commands</strong></li>
</ul>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:0px;"></span></p>
<p><strong>using the extension is very straight forward</strong>. below are two sample codes to get you going: you may also check out the sample FLashDevelop project below. (to run the sample project, you should copy the .ane into the lib folder and of course set the path to Flex and Android locations from bat/SetupSDK.bat)</p>
<div><a href="http://myappsnippet.com/downloads/AIR_EXTENSIONS/speechApi/speechApi_AIR.zip" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Click to download the sample FlashDevelop project</span></span></span></a></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span><br />
The folloiwng example shows how you can run the extension and enable the mic</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>speech<span style="color: #339933;">.</span>Speech<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>speech<span style="color: #339933;">.</span>SpeechEvent<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>Speech <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Speech<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>SpeechEvent<span style="color: #339933;">.</span>INITIALIZED<span style="color: #339933;">,</span> onInitialized<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>SpeechEvent<span style="color: #339933;">.</span>ERROR<span style="color: #339933;">,</span> onError<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>SpeechEvent<span style="color: #339933;">.</span>VOICE_TO_TEXT_WORKING<span style="color: #339933;">,</span> onVoiceToTextWorking<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>SpeechEvent<span style="color: #339933;">.</span>VOICE_TO_TEXT_READY<span style="color: #339933;">,</span> onVoiceToTextCompleted<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onInitialized<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>SpeechEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// change the language by changing the language index. check _ex.supportedLanguagesObject for index numbers</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>voiceToText<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onError<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>SpeechEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ERROR: &quot;</span><span style="color: #339933;">,</span> e<span style="color: #339933;">.</span>param<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onVoiceToTextWorking<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>SpeechEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;processing voice to text conversion...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onVoiceToTextCompleted<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>SpeechEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;here are the results of voice to text conversion&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>int <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> e<span style="color: #339933;">.</span>param<span style="color: #339933;">.</span>length<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">.</span>param<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;--------------------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:10px;"></span><br />
The folloiwng example shows how you can send a string to the extension and get the voice file to play back</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>speech<span style="color: #339933;">.</span>Speech<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>speech<span style="color: #339933;">.</span>SpeechEvent<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>Speech <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Speech<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>SpeechEvent<span style="color: #339933;">.</span>INITIALIZED<span style="color: #339933;">,</span> onInitialized<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>SpeechEvent<span style="color: #339933;">.</span>ERROR<span style="color: #339933;">,</span> onError<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>SpeechEvent<span style="color: #339933;">.</span>TEXT_TO_VOICE_WORKING<span style="color: #339933;">,</span> onTextToVoiceWorking<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>SpeechEvent<span style="color: #339933;">.</span>TEXT_TO_VOICE_READY<span style="color: #339933;">,</span> onTextToVoiceCompleted<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onInitialized<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>SpeechEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// pitch and speech rates are variable from 0.0 to 2.0</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// change the language by changing the language index. check _ex.supportedLanguagesObject for index numbers</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>textToVoice<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hello world!&quot;</span><span style="color: #339933;">,</span> <span style="color:#800080;">1.0</span><span style="color: #339933;">,</span> <span style="color:#800080;">1.0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;<br />
<span style="color: #000000; font-weight: bold;">function</span> onError<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>SpeechEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ERROR: &quot;</span><span style="color: #339933;">,</span> e<span style="color: #339933;">.</span>param<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> onTextToVoiceWorking<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>SpeechEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; trace<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;processing text to voice conversion...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;<br />
<span style="color: #000000; font-weight: bold;">function</span> onTextToVoiceCompleted<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>SpeechEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>play<span style="color: #009900;">&#40;</span>_ex<span style="color: #339933;">.</span>sounds<span style="color: #339933;">.</span>length <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// plays the last sound file in _ex.sounds</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>don&#8217;t forget to include the necessary permissions and activities in the android manifest file <span style="color: #993300">application.xml</span></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.INTERNET&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.ACCESS_NETWORK_STATE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activity</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;com.doitflash.speech.Speak&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">android:label</span>=<span style="color: #ff0000;">&quot;@string/title_activity_main&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">android:theme</span>=<span style="color: #ff0000;">&quot;@android:style/Theme.Dialog&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>Regards,<br />
MyFlashLab Team</p>
]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/google-speech-api-air-native-extension/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Rate App Air Native Extension</title>
		<link>http://myappsnippet.com/rate-app-air-native-extension/</link>
		<comments>http://myappsnippet.com/rate-app-air-native-extension/#comments</comments>
		<pubDate>Sun, 17 Mar 2013 12:55:20 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[app rating]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[google play]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[rate app]]></category>
		<category><![CDATA[rate box]]></category>
		<category><![CDATA[rateBox]]></category>

		<guid isPermaLink="false">http://myappsnippet.com/?post_type=portfolio_mod&#038;p=245</guid>
		<description><![CDATA[&#160; rateApp Extension for Adobe AIR developers Have created the best app or game ever but don&#8217;t know how to convince users to rate you? rateApp Extension helps you on this. you as an AS3 programmer let your users know to rate you after a period of time or after a specific times of launches&#8230; [...]]]></description>
				<content:encoded><![CDATA[<div class="columns two_third">
<span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2012/05/rateApp-adobe-air-extension_preview.png" alt="Rate app adobe air extension" style=" width:610px; height:330px;"/></span></p>
</div>
<div class="columns one_third last">
<table class="pricing_table" cellspacing="0">
<tbody>
<tr>
<td class="top_featured_green"></td>
</tr>
<tr class="price_head">
<td class="featured_green" valign="middle">
<h2>$9.00</h2>
</td>
</tr>
<tr class="price_body">
<td class="title" valign="middle">
Future updates are free<br />
Clean and clear Documentation
	</td>
</tr>
<tr class="price_body">
<td><object class="eStore_button_object"><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return ReadForm1(this, 2);"><input type="hidden" name="product_name_tmp1" value="rateApp air native extension" /><input type="hidden" name="price_tmp1" value="9.00" /><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="payments@premierweb.net.au" /><input type="hidden" name="item_name" value="rateApp air native extension" /><input type="hidden" name="amount" value="9.00" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="item_number" value="6" /><input type="hidden" name="no_shipping" value='1' /><input type="hidden" name="notify_url" value="http://myappsnippet.com/wp-content/plugins/wp-cart-for-digital-products/paypal.php" /><input type="hidden" name="return" value="http://myappsnippet.com/thank-you/" /><input type="hidden" name="mrb" value="3FWGC6LFTMTUG" /><input type="hidden" name="cbt" value="" /><input type="hidden" name="page_style" value="" /><input type="hidden" name="custom" value="ip=54.234.126.92" id="eStore_custom_values" /><input type="submit" class="eStore_buy_now_button" value="Buy Now" /></form>
<p></object></td>
</tr>
</tbody>
</table>
<p><img src="http://myappsnippet.com/wp-content/uploads/2013/01/gcm_ic.png" alt="" width="285" height="72" class="aligncenter size-full wp-image-156" />
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<div class="columns one_half">
<a href="http://myappsnippet.com/instruction-extensions-ides/" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/02/extensions-how-to-on-different-IDEs.png" alt="Click to get the instruction on how to use extensions on different IDEs" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="columns one_half last">
<a href="https://play.google.com/store/apps/details?id=air.com.doitflash.exRateApp" class="image_frame_effect"><span class=" image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/03/adobe-air-extension_demo-app_rate-app.png" alt="Click or scan to checkout the demo app" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="Introduction" name="Introduction">&nbsp;</a></p>
<h2>rateApp Extension for Adobe AIR developers</h2>
<p><strong>Have created the best app or game ever but don&#8217;t know how to convince users to rate you?</strong><br />
rateApp Extension helps you on this. you as an AS3 programmer let your users know to rate you after a period of time or after a specific times of launches&#8230;</p>
<p><span class="paddingdiv" style="padding-top:5px; padding-bottom:10px;"></span></p>
<ul>
<li>set after how many days show rating dialog box</li>
<li>set after how many launches show dialog box</li>
<li>set all of the rating parameters and texts</li>
<li>it&#8217;s all dynamic and so flexible</li>
</ul>
<p><span class="paddingdiv" style="padding-top:5px; padding-bottom:5px;"></span></p>
<p>Working with this extension is as easy as the following. Happy coding <img src='http://myappsnippet.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>rateApp<span style="color: #339933;">.</span>Rate<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>Rate<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set Extension var</span><br />
_ex <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Rate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>_ex<span style="color: #339933;">.</span>isGooglePlayInstalled<span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// NOTE: if Google Play was not installed on the user device, you can't set the Rating dialog box, to rate an app device needs to have access to Google Play... so just return</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>_ex<span style="color: #339933;">.</span>isAppRated<span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// NOTE: if user has already rated then there's no need to continue and set Rate dialog box parameters anymore... he has already rated your app!</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">// ok, user has started your app and has not rated your app yet, set the needed parameters</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>_ex<span style="color: #339933;">.</span>numLaunch <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> _ex<span style="color: #339933;">.</span>setInstallDate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// if this is the first time user has launched the app, then set the install date</span><br />
_ex<span style="color: #339933;">.</span>raiseLaunchCount<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// add one time to the app launches number</span><br />
<br />
_ex<span style="color: #339933;">.</span>daysToFireDialogBox <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// after how many days you want to fire the dialog box?</span><br />
_ex<span style="color: #339933;">.</span>launchesToFireDialogBox <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// after how many launches you want to fire the dialog box?</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">// ok, this if statment won't happen until the date that the Rating dialog box should be fired</span><br />
<span style="color: #666666; font-style: italic;">// and if the rating time has arrived, this if statment will happen again and again on app launches as far as user clicks &quot;Ask Later&quot; or doesn't rate your app...</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>_ex<span style="color: #339933;">.</span>isAppRated <span style="color: #339933;">&amp;&amp;</span> _ex<span style="color: #339933;">.</span>isRatingTime <span style="color: #339933;">&amp;&amp;</span> _ex<span style="color: #339933;">.</span>askForRating<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>setDialogBox<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Rate Us!&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Did you enjoy our app? We really appreciate if you rate us&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Rate&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Ask Later&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Never Ask&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>showDialogBox<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<div><a href="https://play.google.com/store/apps/details?id=air.com.doitflash.exRateApp" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Check out the demo APK here</span></span></span></a></div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="RunDemoAppToTest" name="RunDemoAppToTest">&nbsp;</a></p>
<h2>Run Demo App to Test rateApp Extension!</h2>
<div class="columns one_half">
<p>I have used <a href="http://www.flashdevelop.org/">FlashDevelop</a> for my demo app to show you how to use this extension but of course you can use <span style="color: #339966">Flash CS5.5</span> or <span style="color: #339966">CS6</span> or <span style="color: #339966">Flex builder</span>. As long as you know how to implement an extension in your mobile project, then you will have no problem working with this extension neither. So, here we go.</p>
<div><a href="http://myappsnippet.com/downloads/AIR_EXTENSIONS/rateApp/rateApp_AIR.zip" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Click to download the sample FlashDevelop project</span></span></span></a></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:1px;"></span></p>
<p>Now, copy the <span style="color: #993300">.ane</span> extension you have purchased, to the lib folder, right click on it and hit “<strong>Add To Library</strong>”.</p>
<p>Make sure the extension is added to the project by checking the manifest file, <span style="color: #993300">application.xml</span></p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.doitflash.air.extensions.rateApp<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>&nbsp;</p>
</div>
<div class="columns one_half last">
<p><span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/03/rateApp_extension-add-to-library.png" alt="rate app adobe air extension" style=" width:440px; height:345px;"/></span></p>
</div>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:10px;"></span></p>
<p>Or by checking the “<strong>Air App Properties</strong>” window:</p>
<p><span class="image_frame image_frame_center"><img src="http://myappsnippet.com/wp-content/uploads/2013/03/rateApp_app-properties.png" alt="rateApp adobe air extension" style=" width:693px; height:485px;"/></span></p>
<p>You should also make sure the path to the <span style="color: #339966">Flex SDK</span> is set to your computer. Open “<strong>bat/SetupSDK.bat</strong>” in your text editor and make sure the following paths are correct! Mine looks like below:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">::</span> <span style="color: #004000;">Path</span> to Flex SDK<br />
set FLEX_SDK<span style="color: #339933;">=</span>D<span style="color: #339933;">:</span>\Program Files\Adobe\flex_sdk_4<span style="color: #339933;">.</span>5<span style="color: #339933;">.</span>1<span style="color: #339933;">.</span>21328<br />
<br />
<span style="color: #339933;">::</span> <span style="color: #004000;">Path</span> to Android SDK<br />
set ANDROID_SDK<span style="color: #339933;">=</span>D<span style="color: #339933;">:</span>\Program Files\FlashDevelop\Tools\android</div></td></tr></tbody></table></div>
<p>&nbsp;<br />
When working with any extension, considering that each extension does a specific set of functions on device, there might be some manifest permission that must be configured correctly. The manifest permissions for this extension look like below:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;android<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manifestAdditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[&lt;manifest android:installLocation=&quot;auto&quot;&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &lt;application&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;activity&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;intent-filter&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/intent-filter&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;intent-filter&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/intent-filter&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/activity&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;activity android:name=&quot;com.doitflash.rateApp.DialogBox&quot; android:label=&quot;@string/title_activity_main&quot; android:theme=&quot;@android:style/Theme.Dialog&quot; /&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &lt;/application&gt;</span><br />
<span style="color: #339933;">&lt;/manifest&gt;]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/manifestAdditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/android<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>&nbsp;</p>
<p>I hope you enjoy the rateApp extension <img src='http://myappsnippet.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regards,<br />
MyFlashLab Team</p>
]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/rate-app-air-native-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>in-app billing with refund manager</title>
		<link>http://myappsnippet.com/in-app-billing-adobe-air-native-extension-refund-manager/</link>
		<comments>http://myappsnippet.com/in-app-billing-adobe-air-native-extension-refund-manager/#comments</comments>
		<pubDate>Sat, 16 Mar 2013 08:57:25 +0000</pubDate>
		<dc:creator>Hadi Tavakoli</dc:creator>
				<category><![CDATA[adobe]]></category>
		<category><![CDATA[adobe air native extension]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[ane]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[in-app billing]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[refund]]></category>
		<category><![CDATA[refund dialog]]></category>

		<guid isPermaLink="false">http://myappsnippet.com/?post_type=portfolio_mod&#038;p=239</guid>
		<description><![CDATA[&#160; PART 1) Introduction to In-app Billing for Adobe Air If you were an Android Developer or better to say a Java Developer you absolutely knew what is Google Play In-app Billing because you were completely familiar with Java Documentation Reference. It was a must for you! But most of our audiences here are Air [...]]]></description>
				<content:encoded><![CDATA[<div class="columns two_third">
<span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/03/inAppBilling_adobe-air-extension_preview.png" alt="in-app billing adobe air extension" style=" width:610px; height:330px;"/></span></p>
</div>
<div class="columns one_third last">
<table class="pricing_table" cellspacing="0">
<tbody>
<tr>
<td class="top_featured_green"></td>
</tr>
<tr class="price_head">
<td class="featured_green" valign="middle">
<h2>$30</h2>
</td>
</tr>
<tr class="price_body">
<td class="title" valign="middle">
Future updates are free<br />
Clean and clear Documentation
	</td>
</tr>
<tr class="price_body">
<td><object class="eStore_button_object"><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return ReadForm1(this, 2);"><input type="hidden" name="product_name_tmp1" value="in-app billing Extension" /><input type="hidden" name="price_tmp1" value="30.00" /><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="payments@premierweb.net.au" /><input type="hidden" name="item_name" value="in-app billing Extension" /><input type="hidden" name="amount" value="30.00" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="item_number" value="5" /><input type="hidden" name="no_shipping" value='1' /><input type="hidden" name="notify_url" value="http://myappsnippet.com/wp-content/plugins/wp-cart-for-digital-products/paypal.php" /><input type="hidden" name="return" value="http://myappsnippet.com/thank-you/" /><input type="hidden" name="mrb" value="3FWGC6LFTMTUG" /><input type="hidden" name="cbt" value="" /><input type="hidden" name="page_style" value="" /><input type="hidden" name="custom" value="ip=54.234.126.92" id="eStore_custom_values" /><input type="submit" class="eStore_buy_now_button" value="Buy Now" /></form>
<p></object></td>
</tr>
</tbody>
</table>
<p><img src="http://myappsnippet.com/wp-content/uploads/2013/01/gcm_ic.png" alt="" width="285" height="72" class="aligncenter size-full wp-image-156" />
</div>
<div class="divider_hr" style="padding-top:10px; margin-bottom:0px;">&nbsp;</div>
<div class="columns one_half">
<span class="paddingdiv" style="padding-top:20px; padding-bottom:20px;"></span></p>
<h4>1. <a href="#IntroductionToAdobeAirInappBilling">Introduction to In-app Billing for Adobe Air</a><br />
2. <a href="#BasicRequirements">What you should do before getting started</a><br />
3. <a href="#UploadingApkToGoogle">Uploading your apk to Google</a><br />
4. <a href="#HowDoesInappBillingAdobeAirExtensionWork">How In-app Billing for Adobe Air Extension works!</a></h4>
<div><a href="http://myappsnippet.com/downloads/AIR_EXTENSIONS/inAppBilling/inAppBilling_AIR.zip" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Click to download the sample FlashDevelop project</span></span></span></a></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:0px;"></span></p>
<div><a href="https://play.google.com/store/apps/details?id=air.com.doitflash.exInAppBilling" target=""><span class="small_buttons"><span class="green_l small_left"><span class="green_r small_right">Checkout demo APK in action in Google Play</span></span></span></a></div>
</div>
<div class="columns one_half last">
<a href="http://myappsnippet.com/instruction-extensions-ides/" class="image_frame_effect"><span class=" image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/02/extensions-how-to-on-different-IDEs.png" alt="Click to get the instruction on how to use extensions on different IDEs" style=" width:440px; height:200px;"/></span></a>
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="IntroductionToAdobeAirInappBilling" name="IntroductionToAdobeAirInappBilling">&nbsp;</a></p>
<h2>PART 1) Introduction to In-app Billing for Adobe Air</h2>
<p>If you were an Android Developer or better to say a Java Developer you absolutely knew what is Google Play In-app Billing because you were completely familiar with <a href="http://developer.android.com/index.html" title="Java Documentation">Java Documentation Reference</a>. It was a must for you! But most of our audiences here are Air Developers who really want to work with Android and Java! And I know that you are not a Java Developer and don&#8217;t expect you to know about In-app Billing or other Google Play services <img src='http://myappsnippet.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I myself as an Air Developer even hate to get close to Java Documentation Reference because I&#8217;ve really got into the habit of searching in Flash Documentation Reference. You know! I&#8217;ve grown up out there <img src='http://myappsnippet.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Ok let&#8217;s see what new we are offering you:</p>
<p>In-app Billing enables Java Developers, to easily use <a href="http://developer.android.com/google/play/billing/v2/api.html" title="Java Documentation" target="_blank"><strong>Google Play In-app Billing</strong></a> in their Projects. You as an Air Developer, can also easily use Google Play In-app Billing Service and will be able to interact with the Google Play purchase flow and payments system indirectly, by means of IPC communication with the Play Store app installed on the device using our <strong>In-app Billing Adobe Air Extension</strong>. We used In-app Billing Version 2 API in our Adobe Air Extension for it supports both unmanaged and managed products, as well as supports subscriptions, where In-app Billing Version 3 does not yet offer support for subscriptions.</p>
<p>So let&#8217;s clarify some important features of In-app Billing and find out more about it:</p>
<ul>
In-app Billing Version we used supports three different product types to give you flexibility in how you monetize your app. In all cases, you define your products using the Google Play Developer Console, including product type, SKU, price, description, and so on.</p>
<li><em>Managed per user account</em> — Items that can be purchased only once per user account on Google Play. When a user purchases an item that uses the &#8220;managed per user account&#8221; product type, Google Play permanently stores the transaction information for each item on a per-user basis. This enables you to later query Google Play to restore the state of the items a specific user has purchased. If a user attempts to purchase a managed item that has already been purchased, Google Play prevents the user from purchasing the item again and displays an &#8220;Item already purchased&#8221; error.
<p>    The &#8220;managed&#8221; product type is useful if you are selling items such as game levels or application features. These items are not transient and usually need to be restored whenever a user reinstalls your application, wipes the data on their device, or installs your application on a new device.</li>
<li><em>Unmanaged </em>— Items that do not have their transaction information stored on Google Play. This means that you cannot later query Google Play to retrieve transaction information for those items. For &#8220;unmanaged&#8221; purchases, you are responsible for managing the transaction information. Also, Google Play does not attempt to prevent the user from purchasing an item multiple times if it uses the &#8220;unmanaged&#8221; product type. It&#8217;s up to you to control how many times an unmanaged item can be purchased.
<p>    The &#8220;unmanaged&#8221; product type is useful if you are selling consumable items, such as fuel or magic spells. These items are consumed within your application and are usually purchased multiple times.
    </li>
<li><em>Subscriptions </em>— Items that are sold with a developer-specified, recurring billing interval. When a user purchases a subscription, Google Play and its payment processor automatically bill the user&#8217;s account at the specified interval and price, charging the amount to the original payment method. Once the user purchases a subscription, Google Play continues billing the account indefinitely, without requiring approval or action from the user. The user can cancel the subscription at any time<br />
Subscriptions can only be sold using the &#8220;managed per user account&#8221; purchase type. As with in-app products, once the user has purchased an in-app product there is no refund window. Users desiring refunds must contact the developer directly.
</ul>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:10px;"></span></p>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="BasicRequirements" name="WhatYouShouldKnow">&nbsp;</a></p>
<h2>PART 2) What you should do before getting started</h2>
<p>Before getting your hands dirty with coding, you need to perform a few administrative tasks, including setting up and maintaining your product list on the Google Play Developer Console, registering test accounts, and handling refunds when necessary.</p>
<p>To start, you should make sure you have a <span style="color: #993300">Google Play publisher account</span> where you can upload your app and create a product list. Of course you need to have a <span style="color: #993300">Google Checkout merchant account</span> if you want to collect the money, right?<br />
You can register as a Google Play developer and set up a publisher account at the <a href="https://accounts.google.com/ServiceLogin?service=androiddeveloper&amp;passive=true&amp;nui=1&amp;continue=https://play.google.com/apps/publish&amp;followup=https://play.google.com/apps/publish" target="_blank">Google Play Developer Console</a>. You can register for Google Checkout merchant account at the <a href="https://accounts.google.com/ServiceLogin?service=sierra&amp;continue=https://checkout.google.com/main?upgrade%3Dtrue&amp;hl=en_US&amp;nui=1&amp;ltmpl=default&amp;sacu=1" target="_blank">Google Checkout site</a>.</p>
<p>You do not need to register for any new accounts to support In-app Billing if you have already these important accounts.</p>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="UploadingApkToGoogle" name="UploadingApkToGoogle">&nbsp;</a></p>
<h2>PART 3) Uploading your apk to Google</h2>
<p>In the Google Play Developer Console which provides a product list for each of your published applications you can sell items using Google Play&#8217;s in-app billing feature.<br />
You can access your application&#8217;s product list by clicking the In-App Products link in applications listed in your developer account. Be careful! The In-App Products link appears only if you have a Google Checkout merchant account and the <span style="color: #993300">application&#8217;s manifest</span> includes the <span style="color: #339966">com.android.vending.BILLING</span> permission.<br />
<span class="info_boxes note_box" style="width:100%;"><span class="info_text">Application manifest is actually an XML file which is contained in Sample Project Download file and it includes some important information of your apk like permissions.</span></span></p>
<p>So you should add the billing permission in the manifest:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;com.android.vending.BILLING&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p>You must also add the following service to your manifest:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;service android:name=&quot;com.doitflash.inAppBilling.BillingService.BillingService&quot; /&gt;</div></td></tr></tbody></table></div>
<p>And also the following receiver should be added to your manifest:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;receiver android:name=&quot;com.doitflash.inAppBilling.BillingService.BillingReceiver&quot;&gt;<br />
&nbsp; &nbsp; &nbsp;&lt;intent-filter&gt;<br />
&nbsp; &nbsp; &nbsp;&lt;action android:name=&quot;com.android.vending.billing.IN_APP_NOTIFY&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp;&lt;action android:name=&quot;com.android.vending.billing.RESPONSE_CODE&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp;&lt;action android:name=&quot;com.android.vending.billing.PURCHASE_STATE_CHANGED&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp;&lt;/intent-filter&gt;<br />
&lt;/receiver&gt;</div></td></tr></tbody></table></div>
<p><span class="paddingdiv" style="padding-top:1px; padding-bottom:1px;"></span></p>
<p>Open the .xml file in the sample project you have downloaded and you will see them. You need to apply these modifications in your app manifest file for the extension to work properly.</p>
<p>So before you upload your apk remember to include your application&#8217;s manifest the permission (<span style="color: #339966">com.android.vending.BILLING</span>). Otherwise you will not be able to add new items to the list.</p>
<p>You will see that it is as easy as abc to upload your apk in the Google Play Developer Console so I refuse to explain it in details. The importance of this part was including permission in the application&#8217;s manifest.</p>
<p>Ok after uploading &#8220;APK&#8221; (you still have not implemented the extension in your project, that&#8217;s ok, we&#8217;ll get to that later! you just need to upload your apk so that you can add products for it) and finishing the &#8220;Store Listing&#8221; and &#8220;Pricing and Distribution&#8221; panels, please keep in mind that you should come to &#8220;Service &amp; APIs&#8221; panel. You don&#8217;t need to publish your apk yet.<br />
In this panel there is a <span style="color: #993300">License Key</span> or let&#8217;s say <span style="color: #993300">Public Key</span> which is very important and you should save it in a secure &amp; safe text file. You need <strong>Public Key</strong> to use it later in our <strong>In-app Billing Extension</strong>.</p>
<p>The Google Play Developer Console provides a Public Key for each app. The key for the app is available for copy/paste in License Key for this Application field, as shown in the following figure.</p>
<p><span class="image_frame image_frame_center"><img src="http://myappsnippet.com/wp-content/uploads/2013/03/in-app-billing-public-key.png" alt="in-app billing public key" style=" width:900px; height:600px;"/></span></p>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:10px;"></span></p>
<div class="columns one_half">
<p>Now you should come to &#8220;In-app Products&#8221; panel and click on the Add new product and provide details about the item you are selling like <span style="color: #993300">Product ID</span> and the type of the product ( Managed, Subscription, &#8230; ) then click continue. The Add New Product page lets you add items to an application&#8217;s product list.</p>
<p><span class="info_boxes note_box" style="width:100%;"><span class="info_text">Keep in mind that <strong>Product ID</strong> and <strong>Public Key</strong> are very important so that you need to use them in <span style="color: #339966">In-app Billing</span> Adobe Extension</span></span></p>
</div>
<div class="columns one_half last">
<p><span class="image_frame image_frame_right"><img src="http://myappsnippet.com/wp-content/uploads/2013/03/in-app-billing-product-id.png" alt="GCM adobe air extension" style=" width:440px; height:238px;"/></span></p>
</div>
<ul>
You must enter the following information for each item in a product list after you click on the Continue Button in the above figure:</p>
<li><strong>In-app Product ID</strong></li>
<p>    A product ID must start with a lowercase letter or a number, and must be composed using only lowercase letters (a-z), numbers (0-9), underlines (_), and dots (.). The product ID &#8220;android.test&#8221; is reserved, as are all product IDs that start with &#8220;android.test.&#8221;</p>
<li><strong>Product Type</strong></li>
<p>    The product type can be Managed per user account, Unmanaged, or Subscription. You can never change an item&#8217;s product type after you set it. In this Extension we are dealing with Managed and Subscription because Unmanaged type is no longer in use in In-app Billing Version 3.</p>
<li><strong>Publishing State</strong></li>
<p>    An item&#8217;s publishing state can be Published or Unpublished . To be visible to a user during checkout, an item&#8217;s publishing state must be set to Published and the item&#8217;s application must be published on Google Play.</p>
<p>    <span style="color: #993300"><strong>Note</strong></span>: This is not true for test accounts. An item is visible to a test account if the application is not published and the item is published. </p>
<p>    You can provide localized titles and descriptions for your in-app products using the Add Translations button. If you want Google Play to translate your title and description for you, based on the title and description in the default language, just click the languages that you want to offer. If you want to provide custom translations in specific languages, you can also do that. By default, an in-app product inherits its default language from the parent application.</p>
<li><strong>Title</strong></li>
<p>    The title is a short descriptor for the item. Every item must have a title. The title is visible to users during checkout. For optimum appearance, titles should be no longer than 25 characters; however, titles can be up to 55 characters in length.</p>
<li><strong>Description</strong></li>
<p>    The description is a long descriptor for the item. The description is visible to users during checkout. Descriptions can be up to 80 characters in length.</p>
<li><strong>Price</strong></li>
<p>    You must provide a default price in your home currency. You can also provide prices in other currencies, but you can do this only if a currency&#8217;s corresponding country is listed as a target country for your application. You can specify target countries on the Edit Application page in the Google Play developer console.
</ul>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:10px;"></span></p>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="HowDoesInappBillingAdobeAirExtensionWork" name="HowDoesInappBillingAdobeAirExtensionWork">&nbsp;</a></p>
<h2>PART 4) How In-app Billing for Adobe Air Extension works!</h2>
<p>Congratulation! You are now able to use In-app Billing service with all you have learnt till now.<br />
Well also thank you very much that you have tolerated us till this part. We appreciate your patience.<br />
Ok, let’s see how <strong><span style="color: #6eb90e">In-app Billing Adobe Extension</span></strong> really works. Our Extension is very easy to work with. You should just read this final part and follow our step by step Tutorial</p>
<p><strong>1</strong> – Well the first thing is to import the needed AS3 Classes to your project:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>payments<span style="color: #339933;">.</span>inAppBilling<span style="color: #339933;">.</span>Google<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>air<span style="color: #339933;">.</span>extensions<span style="color: #339933;">.</span>payments<span style="color: #339933;">.</span>inAppBilling<span style="color: #339933;">.</span>GoogleEvent<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>&nbsp;</p>
<p><strong>2</strong> – Next step is to make a Variable of the extenstion:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _ex<span style="color: #339933;">:</span>Google<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>&nbsp;</p>
<p><strong>3</strong> – Then we make a Button named “initialize” and give it a Listener:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn1<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;initialize&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn1<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> aa<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #000000; font-weight: bold;">function</span> aa<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>_ex <span style="color: #339933;">&amp;&amp;</span> _ex<span style="color: #339933;">.</span>isInitialized<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;you have already initialized the extension!&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #666666; font-style: italic;">// initialize in-app-billing extension</span><br />
C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;initializing... please wait...&quot;</span><span style="color: #009900;">&#41;</span><br />
_ex <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Google<span style="color: #009900;">&#40;</span>onInitSuccess<span style="color: #339933;">,</span> onInitFailed<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;M32iL+ykKpVz2/BS/mxI8OZITZfMh/AqfnQAB&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Well in the above snippet when the Button “initialize” is clicked <span style="color: #990099">if (_ex &amp;&amp; _ex.isInitialized)</span> happens. This command checks to print “you have already initialized the extension!” if this extension is initialized before. But if it is not initialized yet it initializes the extension:<br />
<span style="color: #990099">_ex = new Google(onInitSuccess, onInitFailed, “M32iL+ykKpVz2/BS/mxI8OZITZfMh/AqfnQAB”, true);</span><br />
Now, let’s see what we have in this line as inputs:<br />
1- If the extension initialization is successful the first function is called: <strong>function onInitSuccess()</strong><br />
2- If by any reasons the extension initialization is not successful the second function is called: <strong>function onInitFailed()</strong><br />
3- The third parameter if you remember is the Public Key you have saved before: <strong>“M32iL+ykKpVz2/BS/mxI8OZITZfMh/AqfnQAB”</strong><br />
4- The last parameter is called <em>Debug Mode</em> which is set to <strong>true</strong> (You as the Air Developer should set it to true so that you can debug. It enables you to work with fake purchase buttons in your App ).<br />
<span class="info_boxes note_box" style="width:100%;"><span class="info_text">Please remember to set this parameter to <strong>false </strong>when you want to release your app in Google Play.</span></span></p>
<p>to work with the in-app billing service, you should add some listeners in function onInitSuccess()</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>REFUND_WINDOW<span style="color: #339933;">,</span> onRefundWindow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>ERROR<span style="color: #339933;">,</span> onERROR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>RESULT_OK<span style="color: #339933;">,</span> onResultOk<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>RESULT_USER_CANCELED<span style="color: #339933;">,</span> onResultUserCanceled<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>RESULT_SERVICE_UNAVAILABLE<span style="color: #339933;">,</span> onResultServiceUnavailable<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>RESULT_BILLING_UNAVAILABLE<span style="color: #339933;">,</span> onResultBillingUnavailable<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>RESULT_ITEM_UNAVAILABLE<span style="color: #339933;">,</span> onResultItemUnavailable<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>RESULT_DEVELOPER_ERROR<span style="color: #339933;">,</span> onResultDeveloperError<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_ex<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>GoogleEvent<span style="color: #339933;">.</span>RESULT_ERROR<span style="color: #339933;">,</span> onResultError<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>&nbsp;</p>
<p><strong>4</strong> – Next we make another Button named “is initialized?”:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn2<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;is initialized?&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn2<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> bb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #000000; font-weight: bold;">function</span> bb<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// check if the extension is initialized</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;is initialized: &quot;</span><span style="color: #339933;">+</span> _ex<span style="color: #339933;">.</span>isInitialized<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>When it is clicked we actually have called the Getter “_ex.isInitialized”. This Getter returns true/false so we put it in C.log() to find out whether it is initialized or not. </p>
<p>&nbsp;</p>
<p><strong>5</strong> – Now another Button we make named “do a fake purchase for debugging reasons!”. You can guess what it is for by its name:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn3<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;do a fake purchase for debugging reasons!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn3<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> cc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn3<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> cc<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;requeste a fake purchase...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>requestPurchase<span style="color: #009900;">&#40;</span>Google<span style="color: #339933;">.</span>FAKE_PURCHASE<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;developerPayload &gt;&gt; fake purchase&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>In this snippet we call the method “requestPurchase” and give it two parameters as its inputs.<br />
The first parameter is FAKE_PURCHASE which is a <strong>Public Static Constent</strong> ( <strong>FAKE_PURCHASE, FAKE_REFUND, FAKE_UNAVAILABLE &amp; FAKE_CANCEL</strong> ) of Google Class.<br />
<span class="info_boxes note_box" style="width:100%;"><span class="info_text">This parameter should be replaced by <strong>Item ID</strong> for a real purchase.</span></span><br />
The second one is “developerPayload”. Hey Air Developer! Don’t worry for this is nothing but a string as raw data which is sent to Google Play when the “requestPurchase” is called. Then Google Play returns it. It is optional and can be replaced as an empty string or null. It totally depends on your application.</p>
<p>&nbsp;</p>
<p><strong>6</strong> – Another Button we make is “check if subscription is supported?”:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn4<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;check if subscription is supported?&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn4<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> dd<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn4<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> dd<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Is subscription supported? please wait...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span>onSubscriptionIsSupported<span style="color: #339933;">,</span> onSubscriptionIsNotSupported<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Before asking your app users to subscribe for a service in your app, it&#8217;s wise to check whether this subscription is supported in their environment or not! This environment depends on several things like:<br />
 •  In which country the user is living?<br />
 •  What mobile device does the person own?<br />
 •  What is the person’s mobile device IP?<br />
and several other things&#8230;</p>
<p>Ok, in order to check whether the subscription is supported or not, call the method “checkSubscriptionSupport”:<br />
<span style="color: #990099">_ex.checkSubscriptionSupport(onSubscriptionIsSupported, onSubscriptionIsNotSupported);</span><br />
In this line there are two functions as inputs:<br />
The first function “onSubscriptionIsSupported” is called if the subscription is supported.<br />
The second function “onSubscriptionIsNotSupported” is called if the subscription is not supported.</p>
<p>&nbsp;</p>
<p><strong>7</strong> – Now we make another Button named “do a fake refund behavior?”:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn5<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;do a fake refund behaviour&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn5<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> ee<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn5<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> ee<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;click <span style="color: #000099; font-weight: bold;">\&quot;</span>Accept &amp;amp; buy<span style="color: #000099; font-weight: bold;">\&quot;</span> to complete the fake-debugging process, then check your notification bar!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;_ex<span style="color: #339933;">.</span>requestPurchase<span style="color: #009900;">&#40;</span>Google<span style="color: #339933;">.</span>FAKE_REFUND<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>This enables you to test what happens when a refunding happens on a user&#8217;s device!<br />
Let’s talk more about the Refund before we go to explain this part.</p>
<p>As an example imagine that I have bought something from your app I am using but I did not like it and want to get back my money from you.<br />
Google Play does not allow me to directly request YOU for refund.<br />
So what should I do is to email you, give you the Order ID and ask you to refund my money.<br />
Then you go to your Google Wallet and “can refund” my Order ID&#8230;</p>
<p>We made this time consuming process very easy for you in this Extension:<br />
Well the above snippet is for a fake refund but When you really refund my money from your marchant account, the app throws a notification which tells me as the buyer that my money is refunded. Then the money is automatically refunded to my account. so in the app, you need to know that it has been refunded, so that you can stop the service from working, right? you should check the <strong>getPurchaseInfo()</strong> method.</p>
<p>There are other behaviors and Buttons. These work as just the fake behavior. Just consider the button name and what is given to &#8220;requestPurchase&#8221; method when calling:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn6<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;do a fake cancel behaviour&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn6<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> ff<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn6<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> ff<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;click <span style="color: #000099; font-weight: bold;">\&quot;</span>Accept &amp;amp; buy<span style="color: #000099; font-weight: bold;">\&quot;</span> to complete the fake-debugging process, then check your notification bar!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>requestPurchase<span style="color: #009900;">&#40;</span>Google<span style="color: #339933;">.</span>FAKE_CANCEL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #666666; font-style: italic;">// ----------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #000000; font-weight: bold;">var</span> btn7<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;do a fake unavailable behaviour&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn7<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> gg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn7<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> gg<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;This is a fake behavior showing that the item is not available!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>requestPurchase<span style="color: #009900;">&#40;</span>Google<span style="color: #339933;">.</span>FAKE_UNAVAILABLE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>&nbsp;</p>
<p><strong>8</strong> – There is another Button named “get list of made transactions!”. You can guess what it is for by its name:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn8<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;get list of made transactions!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn8<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> hh<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn8<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> hh<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <a href="http://www.php.net/list"><span style="color: #990000;">list</span></a><span style="color: #339933;">:</span><a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #339933;">=</span> _ex<span style="color: #339933;">.</span>getPurchaseInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-------------------------------------------&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Number of purchases done: &quot;</span> <span style="color: #339933;">+</span> <a href="http://www.php.net/list"><span style="color: #990000;">list</span></a><span style="color: #339933;">.</span>length<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>int <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <a href="http://www.php.net/list"><span style="color: #990000;">list</span></a><span style="color: #339933;">.</span>length<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> item<span style="color: #339933;">:</span>Object <span style="color: #339933;">=</span> <a href="http://www.php.net/list"><span style="color: #990000;">list</span></a><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> name<span style="color: #339933;">:</span>String in item<span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>name <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;purchaseTime&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span>name <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">+</span> item<span style="color: #009900;">&#91;</span>name<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>toString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span>name <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; = &quot;</span> <span style="color: #339933;">+</span> item<span style="color: #009900;">&#91;</span>name<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;---------------&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;-------------------------------------------&quot;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>In this snippet the method &#8220;getPurchaseInfo()&#8221; returns an Array containing all the transactions that a user has had with your app.</p>
<p>Transactions help users not to buy a product more than once! Imagine a user who has bought an in-app product from his mobile device logged in with his gmail account. If he logs in to another device with his gmail he does not need to buy that app again because Google Play has known his gmail account and the transactions in relation with that gmail account.<br />
You the Air Developer can use the information of transactions like name, order ID and the time of the purchased item.</p>
<p><strong>9</strong> – Ok all you got learnt till here was about testing. Now it is the time to really work with some real money:</p>
<p><strong>REAL $1 PURCHASE! Button</strong></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn9<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;REAL <span style="color: #006699; font-weight: bold;">$1</span> PURCHASE!&quot;</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x990000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn9<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> ii<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn9<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> ii<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;This is a real purchase! you will really pay <span style="color: #006699; font-weight: bold;">$1</span>!!!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>requestPurchase<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test01&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;real payment of a managed product&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>This snippet works as the fake purchase I told you above. It works with requsetPurchase method but instead of Google.FAKE_PURCHASE you should enter a real <strong>Item ID</strong> here: <strong>&#8220;test01&#8243;</strong></p>
<p><strong>REAL $1.20 monthly subscription! Button</strong></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn10<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;REAL <span style="color: #006699; font-weight: bold;">$1</span>.20 monthly subscription!&quot;</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x990000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn10<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> jj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn10<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> jj<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; C<span style="color: #339933;">.</span><a href="http://www.php.net/log"><span style="color: #990000;">log</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;This is a real monthly subscription!!!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>requestSubscription<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test03&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;real monthly subscription!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>This snippet works as the fake purchase I told you above. You should enter a real <strong>Item ID</strong> here: <strong>&#8220;test03&#8243;</strong></p>
<p><strong>Request a refund from app owner! Button</strong></p>
<div class="columns one_half">
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> btn11<span style="color: #339933;">:</span>MySprite <span style="color: #339933;">=</span> createBtn<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Request a refund from app owner!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
btn11<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>MouseEvent<span style="color: #339933;">.</span>CLICK<span style="color: #339933;">,</span> kk<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>btn11<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> kk<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>MouseEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// optional bitmapData to show in the refund dialog</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> bm<span style="color: #339933;">:</span>Bitmap <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Icon<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> Bitmap<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _ex<span style="color: #339933;">.</span>requestRefund<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://myappsnippet.com/downloads/AIR_EXTENSIONS/inAppBilling/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;test01&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;0123456789&quot;</span><span style="color: #339933;">,</span> bm<span style="color: #339933;">.</span>bitmapData<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>the <strong>requestRefund</strong> method performs a real refund procedure. There are some parameters in calling requestRefund method as inputs that I explain below:</p>
<p><strong>Gateway</strong>: It is an address to a php location which we made in sample project you have probably downloaded at the top of this page. So put that folder somewhere on your server and replace <span style="color: #3585b3">http://myappsnippet.com/downloads/AIR_EXTENSIONS/inAppBilling/&#8221;</span> with your own address. (notice the very last &#8220;/&#8221; at the end!)<br />
This php gateway sends an email to the app owner containing the message of any probable customers who have refunded for the app owner. So the app owner can decide whether to accept the customer&#8217;s refund request or send the customer an email to persuade him not to refund!</p>
</div>
<div class="columns one_half last"><span class="image_frame image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/03/in-app-billing-refund-manager.png" alt="" style=""/></span></div>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:10px;"></span></p>
<p><span class="info_boxes note_box" style="width:100%;"><span class="info_text">to make sure the refund email request is sent to you, please open &#8220;refund.php&#8221; and replace &#8220;define(&#8220;SENDTO&#8221;, &#8220;your@email.com&#8221;);&#8221; with your own email address. </span></span></p>
<div class="columns one_half">
<strong>ItemId</strong>: Which the id of the product you have set in the Google Play Console</p>
<p><strong>OrderId</strong>: Which can be found from transaction list, getPurchaseInfo()</p>
<p><strong>BitmapData</strong>: The last input is a BitmapData which is a picture or better to say an optional variable so if you decide not to put it here the app icon appears as the default.</p>
<p>there is one last small thing you should do to make the refund window work properly. if you have noticed, there is a folder in the bin folder of the sample FlashDevelop project. that folder contains the fonts that the refund window of the extension uses!
</p></div>
<div class="columns one_half last">
<span class="image_frame image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2013/03/in-app-billing-fonts-for-refund-manager.png" alt="" style=""/></span>
</div>
<p><span class="paddingdiv" style="padding-top:10px; padding-bottom:10px;"></span><br />
I hope you enjoy our little In-app Billing Extension.</p>
<p>Regards,<br />
MyFlashLab Team</p>
]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/in-app-billing-adobe-air-native-extension-refund-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scrolling Optimization for Mobile Air Projects</title>
		<link>http://myappsnippet.com/scrolling-optimization-mobile-air-projects/</link>
		<comments>http://myappsnippet.com/scrolling-optimization-mobile-air-projects/#comments</comments>
		<pubDate>Thu, 14 Mar 2013 11:48:00 +0000</pubDate>
		<dc:creator>Arash Majnoun</dc:creator>
				<category><![CDATA[android like scrolling]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[ease]]></category>
		<category><![CDATA[easing]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[greensocks]]></category>
		<category><![CDATA[high performance]]></category>
		<category><![CDATA[iphone like scrolling]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[optimise]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[optimized]]></category>
		<category><![CDATA[scrollbar]]></category>
		<category><![CDATA[scroller]]></category>
		<category><![CDATA[smooth]]></category>
		<category><![CDATA[starling]]></category>
		<category><![CDATA[touch scroller]]></category>
		<category><![CDATA[tween]]></category>
		<category><![CDATA[TweenMax]]></category>

		<guid isPermaLink="false">http://myappsnippet.com/?post_type=blog_mod&#038;p=236</guid>
		<description><![CDATA[&#160; This Optimization we are offering is Unique Heh, once again I should say Hello to all Air Developers in the Globe and how are you today? This time we are talking on how to optimize scrolling in Air Apps in the most Optimizing way you haven&#8217;t seen before. You&#8217;ve probably noticed a rough, slow, [...]]]></description>
				<content:encoded><![CDATA[<div class="columns two_third">
<p style="text-align: center;"><iframe width="560" height="315" src="http://www.youtube.com/embed/2yZYqViEl0g" frameborder="0" allowfullscreen></iframe></p>
</div>
<div class="columns one_third last">
<p><a href="http://myappsnippet.com/downloads/StarlingTouchScroll/starlingScroller.apk" class="image_frame_effect"><span class="image_frame image_frame_left"><img src="http://myappsnippet.com/wp-content/uploads/2012/10/qrcode_AS3StarlingTouchScroll.png" alt="" style=" width:75px; height:75px;"/></span></a><strong>Click or scan</strong> the QR Code to download the sample Android app to see how it works on your own mobile device! <strong>Of course the Starling Scroller is coded in AS3 and can be used in any AIR mobile apps for IOS/Apple devices too!</strong> I just created this file for the sake of an example.</p>
</div>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p><a id="Introduction" name="Introduction">&nbsp;</a></p>
<h2>This Optimization we are offering is Unique </h2>
<p>Heh, once again I should say Hello to all Air Developers in the Globe and how are you today?<br />
This time we are talking on how to optimize scrolling in Air Apps in the most Optimizing way you haven&#8217;t seen before.<br />
You&#8217;ve probably noticed a rough, slow, lazy and low performance when scrolling with a large amount of content in your Mobile Air Projects. Well this is natural to your device CPU for it can not handle the heavy operation caused by heavy and large amount of content!<br />
You as an experienced Air Developer absolutely know all of the issues related to Scrolling in Mobile Air Projects since the AS3 has stepped into the world of APP Development. You are sure that AS3 is amazing! Even it became more marvelous with introducing the Starling Framework with which you are familiar I am sure. It actually simplifies your development on all major mobile platforms out there with all its nice and unique features! We all know these features which help us for a better performance in Mobile AS3 APPs like Scrolling Performance Optimization.</p>
<p>But the more amazing and marvelous aspect of AS3 and Starling Framework is in our hands now. I mean the Ultimate Optimization we have developed for Scrolling in Mobile Air Projects. If you watched our <a href="http://www.youtube.com/watch?v=2yZYqViEl0g" target="_blank">video clip Demo</a> you would know what we are going to talk about.</p>
<p>Did you see how soft, smooth and flexible was the scrolling in the Video Clip? There was a huge content in the scrolling though!<br />
Got surprised or not? Have you seen such a Scrolling Optimization before?</p>
<p>We are going to let you know how we did it. We did show you this, but more surprisingly we  intend to make you Feel it in your own mobile air projects. We want to make you Feel this smoothness with your own finger tips.</p>
<p>Ok we told you this is unique but actually it&#8217;s nothing special we did. There are just some simple but delicate tricks we used to gain a high level of performance in our scrolling optimization.</p>
<p>So please stay with us in this tutorial:</p>
<p>&nbsp;</p>
<p><strong>1</strong> – Firstly, if you have downloaded our <a href="http://codecanyon.net/item/air-as3-starling-abstract-touch-scroll/4058167?ref=tahadaf" title=" AIR AS3 Starling abstract Touch Scroll " target="_blank">Scroller</a>  import these AS3 Classes in your project:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>starling<span style="color: #339933;">.</span>MyStarlingSprite<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>starling<span style="color: #339933;">.</span>MySprite<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>consts<span style="color: #339933;">.</span>Direction<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>consts<span style="color: #339933;">.</span>Orientation<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>consts<span style="color: #339933;">.</span>Easing<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>starling<span style="color: #339933;">.</span>utils<span style="color: #339933;">.</span>scroller<span style="color: #339933;">.</span>Scroller<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>events<span style="color: #339933;">.</span>ScrollEvent<span style="color: #339933;">;</span><br />
import com<span style="color: #339933;">.</span>doitflash<span style="color: #339933;">.</span>starling<span style="color: #339933;">.</span>utils<span style="color: #339933;">.</span><a href="http://www.php.net/list"><span style="color: #990000;">list</span></a><span style="color: #339933;">.</span><a href="http://www.php.net/list"><span style="color: #990000;">List</span></a><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>Note</strong>: The &#8220;MyStarlingSprite&#8221; &#038; &#8220;MySprite&#8221; are &#8220;Sprite&#8221; class of Starling Framework. But we extend them to be used more easily. You can use them too if you want.</p>
<p><strong>OK</strong> – Before we go to next step we set some variables of which the most important is named &#8220;_body&#8221;:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _body<span style="color: #339933;">:</span>ClippedSprite<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>As you see this variable is actually a ClippedSprite Variable ( <em>ClippedSprite </em> is an Extension of Starling Framework. You can search to read more about it if it&#8217;s necessary ).</p>
<p>Then you should initialize and addChild the variable &#8220;_body&#8221; wherever you want in your project:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">_body <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ClippedSprite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
this<span style="color: #339933;">.</span>addChild<span style="color: #009900;">&#40;</span>_body<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>&nbsp;</p>
<p><strong>2</strong> – Secondly, we set a mySprite variable and some properties from which we can make our texture:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">_tochTexture <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MySprite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_tochTexture<span style="color: #339933;">.</span>bgAlpha <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
_tochTexture<span style="color: #339933;">.</span>bgColor <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF9900</span><span style="color: #339933;">;</span><br />
_tochTexture<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span><br />
_tochTexture<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span><br />
_tochTexture<span style="color: #339933;">.</span>drawBg<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>You can even make your own texture if you don&#8217;t want to use mySprite.</p>
<p>Ok, now based on the dimension of the screen in different devices we define &#8220;ITEM_WIDTH&#8221; and &#8220;ITEM_SPACE&#8221; so that we can specify &#8220;_numRows&#8221;:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">_numRows <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span><a href="http://www.php.net/floor"><span style="color: #990000;">floor</span></a><span style="color: #009900;">&#40;</span>_width <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span>ITEM_WIDTH <span style="color: #339933;">+</span> ITEM_SPACE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_remainingSpace <span style="color: #339933;">=</span> _width <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span>_numRows <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span>ITEM_WIDTH <span style="color: #339933;">+</span> ITEM_SPACE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_extraWidth <span style="color: #339933;">=</span> _remainingSpace <span style="color: #339933;">/</span> _numRows<span style="color: #339933;">;</span><br />
_extraWidth <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span><a href="http://www.php.net/floor"><span style="color: #990000;">floor</span></a><span style="color: #009900;">&#40;</span>_extraWidth<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_extraHeight <span style="color: #339933;">=</span> Math<span style="color: #339933;">.</span><a href="http://www.php.net/floor"><span style="color: #990000;">floor</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>ITEM_HEIGHT <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span>_extraWidth <span style="color: #339933;">+</span> ITEM_WIDTH<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> ITEM_WIDTH<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> ITEM_HEIGHT<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<ul>
<li>ITEM_WIDTH:</li>
<p> The width if every item</p>
<li>ITEM_SPACE:</li>
<p> The vertical space between each item</p>
<li>_numRows:</li>
<p> The number of the rows or actually columns. It depends on different screen devices.
</ul>
<p>&nbsp;</p>
<p><strong>3</strong> – Thirdly, we should do some preparations to initialize our list just after providing the previous information:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> listHolder<span style="color: #339933;">:</span>MyStarlingSprite <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyStarlingSprite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
listHolder<span style="color: #339933;">.</span>defBgTexture <span style="color: #339933;">=</span> touchTexture<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
listHolder<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> _width<span style="color: #339933;">;</span><br />
listHolder<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> _height<span style="color: #339933;">;</span><br />
<br />
_body<span style="color: #339933;">.</span>x <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
_body<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
_body<span style="color: #339933;">.</span>addChild<span style="color: #009900;">&#40;</span>listHolder<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> touchTexture<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>Texture<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> _tochTexture<span style="color: #339933;">.</span>getTexture<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>&#8220;listHolder&#8221; should be addChilded to the &#8220;_body&#8221;.</p>
<p>Ok you see that We&#8217;ve set a list holder using <em>MyStarlingSprite()</em> and made a default background using <em>touchTexture()</em>.<br />
<em>touchTexture()</em> is a function which uses the previous information we have provided in step 2 ( a few lines above ) as our texture properties.</p>
<p><span class="info_boxes note_box" style="width:100%;"><span class="info_text"><br />
This is actually one of those tricks we have used: You know there is a heavy content we suppose to scroll! For example 500 different items as you can see in sample project file. So we <strong>made</strong> a default texture just once and we <strong>call </strong>it whenever we want!<br />
You know or don&#8217;t know but it&#8217;s worthy to alarm you that if you <strong>make a texture</strong> for many and many times it decreases the performance; on the other hand, you can <strong>use a texture</strong> for many and many times you want without decreasing the performance.<br />
</span></span></p>
<p>Now, we initialize our list:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">_list <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.php.net/list"><span style="color: #990000;">List</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>holder <span style="color: #339933;">=</span> listHolder<span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>itemsHolder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>orientation <span style="color: #339933;">=</span> Orientation<span style="color: #339933;">.</span>VERTICAL<span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>hDirection <span style="color: #339933;">=</span> Direction<span style="color: #339933;">.</span>LEFT_TO_RIGHT<span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>vDirection <span style="color: #339933;">=</span> Direction<span style="color: #339933;">.</span>TOP_TO_BOTTOM<span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>row <span style="color: #339933;">=</span> _numRows<span style="color: #339933;">;</span><br />
_list<span style="color: #339933;">.</span>space <span style="color: #339933;">=</span> ITEM_SPACE<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>This list is fully an abstract class that arranges your items.<br />
<em>new Sprite()</em> is that Sprite of Starling Framework.</p>
<p>As you can see in line 2 of this snippet our list have a property named &#8220;holder&#8221; that should be equal to &#8220;listHolder&#8221; that we defined a few lines above.<br />
Another property is named &#8220;itemsHolder&#8221; which is actually a <em>new Sprite()</em>. ( itemsHolder contains our those 500 different items )</p>
<p>There are some other properties here that I&#8217;m sure you can guess what these are for! Of curse these are optional in this tutorial. You can use your own properties.</p>
<p>Then considering _body we call the <em>localToGlobal </em>method and give it a new point. We also initialize a <em>Rectangle </em>class to <em>_body.clipRect</em>  and give it the width and height of a place where our <em>_body</em> is addChilded to:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> globalPoint<span style="color: #339933;">:</span>Point <span style="color: #339933;">=</span> _body<span style="color: #339933;">.</span>localToGlobal<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #009900;">&#40;</span>_body<span style="color: #339933;">.</span>x<span style="color: #339933;">,</span> _body<span style="color: #339933;">.</span>y<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_body<span style="color: #339933;">.</span>clipRect <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #009900;">&#40;</span>globalPoint<span style="color: #339933;">.</span>x<span style="color: #339933;">,</span> globalPoint<span style="color: #339933;">.</span>y<span style="color: #339933;">,</span> _width<span style="color: #339933;">,</span> _height<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>These two lines are actually the settings that are needed for ClippedSprite.  </p>
<p>&nbsp;</p>
<p><strong>4</strong> – The forth step is to initialize our scrollbar:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">_scroll <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Scroller<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>addEventListener<span style="color: #009900;">&#40;</span>ScrollEvent<span style="color: #339933;">.</span>TOUCH_TWEEN_UPDATE<span style="color: #339933;">,</span> onScrollerUpdate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>boundWidth <span style="color: #339933;">=</span> _width<span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>boundHeight <span style="color: #339933;">=</span> _height <span style="color: #339933;">-</span> _body<span style="color: #339933;">.</span>y<span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>content <span style="color: #339933;">=</span> _list<span style="color: #339933;">.</span>holder<span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>orientation <span style="color: #339933;">=</span> Orientation<span style="color: #339933;">.</span>VERTICAL<span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>easeType <span style="color: #339933;">=</span> Easing<span style="color: #339933;">.</span>Expo_easeOut<span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>duration <span style="color: #339933;">=</span> <span style="color:#800080;">.3</span><span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>holdArea <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span><br />
_scroll<span style="color: #339933;">.</span>isStickTouch <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #000000; font-weight: bold;">function</span> onScrollerUpdate<span style="color: #009900;">&#40;</span>e<span style="color: #339933;">:</span>ScrollEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; optimizeScrolling<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Well our scrollbar have a Listener <em>addEventListener</em> which listens to this Event <em>ScrollEvent.TOUCH_TWEEN_UPDATE</em>. So when the scrollbar is Tweening, the function <em>onScrollerUpdate()</em> is called.<br />
There is no need to talk about the rest of this snippet here. You can refer to the our <a href="http://codecanyon.net/item/air-as3-starling-abstract-touch-scroll/4058167?ref=tahadaf" title=" AIR AS3 Starling abstract Touch Scroll " target="_blank">Scroller Documentation</a> you have downloaded.</p>
<p>But let me tell you what is <span style="color:#b30909">_scroll.holdArea = 10;</span>?<br />
Imagine you want to click on an item in the scrollbar. If you don&#8217;t define this property, as you touch the screen the scrollbar starts to scroll and you can not click that item. So you should set this item to 10 pixels or whatever you like to make the scrollbar not to move away when the probable movement is lower than 10 pixels. In this way the scrollbar knows that when the movement is more than 10 pixels then it is the time of scrolling.<br />
Are we clear enough? <img src='http://myappsnippet.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   </p>
<p><em>onScrollerUpdate()</em> calls an important function in case of our optimization that we tell you later in the last step.</p>
<p>&nbsp;</p>
<p><strong>5</strong> – We make two other textures, a texture for <em>mouseOut</em> and another one for <em>mouseOver</em>:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// build texture for mouseOut</span><br />
spOut <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MySprite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> ITEM_WIDTH <span style="color: #339933;">+</span> _extraWidth <span style="color: #339933;">-</span> _margin <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> ITEM_HEIGHT <span style="color: #339933;">+</span> _extraHeight<span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>bgAlpha <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>bgColor <span style="color: #339933;">=</span> <span style="color: #208080;">0xDFE4FF</span><span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>bgStrokeAlpha <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>bgStrokeColor <span style="color: #339933;">=</span> <span style="color: #208080;">0xCCCCCC</span><span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>drawBg<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// build texture for mouseOver</span><br />
spOver <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MySprite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
spOver<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> ITEM_WIDTH <span style="color: #339933;">+</span> _extraWidth <span style="color: #339933;">-</span> _margin <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
spOver<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> ITEM_HEIGHT <span style="color: #339933;">+</span> _extraHeight<span style="color: #339933;">;</span><br />
spOver<span style="color: #339933;">.</span>bgAlpha <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
spOver<span style="color: #339933;">.</span>bgColor <span style="color: #339933;">=</span> <span style="color: #208080;">0xFFDB48</span><span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>bgStrokeAlpha <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
spOut<span style="color: #339933;">.</span>bgStrokeColor <span style="color: #339933;">=</span> <span style="color: #208080;">0xCCCCCC</span><span style="color: #339933;">;</span><br />
spOver<span style="color: #339933;">.</span>drawBg<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
outT <span style="color: #339933;">=</span> Texture<span style="color: #339933;">.</span>fromTexture<span style="color: #009900;">&#40;</span>spOut<span style="color: #339933;">.</span>getTexture<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
overT <span style="color: #339933;">=</span> Texture<span style="color: #339933;">.</span>fromTexture<span style="color: #009900;">&#40;</span>spOver<span style="color: #339933;">.</span>getTexture<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>We make two textures and put them in &#8220;outT&#8221;  and &#8220;outT&#8221; variables.</p>
<p><span class="info_boxes note_box" style="width:100%;"><span class="info_text"><br />
Well we have 500 different items in our sample project file but we should not make 1000 textures ( 500 for mouseOut and 500 for mouseOver ).<br />
We just make these two textures once in the project and we can use them anytime we want so that it helps to gain a better optimization. This is another trick we used in our optimization!<br />
</span></span></p>
<p>&nbsp;<br />
&nbsp; </p>
<p><strong>6</strong> – Now we want to put our items in our list we made in previous steps, so we need to call the function  <em>addItems()</em> :</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> addItems<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>int<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">500</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> item<span style="color: #339933;">:</span>Item <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Item<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; item<span style="color: #339933;">.</span>atlas <span style="color: #339933;">=</span> atlas<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; item<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> ITEM_WIDTH <span style="color: #339933;">+</span> _extraWidth <span style="color: #339933;">-</span> _margin <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; item<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> ITEM_HEIGHT <span style="color: #339933;">+</span> _extraHeight<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; item<span style="color: #339933;">.</span>outTexture <span style="color: #339933;">=</span> outT<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; item<span style="color: #339933;">.</span>overTexture <span style="color: #339933;">=</span> overT<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; item<span style="color: #339933;">.</span>data<span style="color: #339933;">.</span>id <span style="color: #339933;">=</span> Number<span style="color: #009900;">&#40;</span>i <span style="color: #339933;">+</span> _numItems<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; _list<span style="color: #339933;">.</span>add<span style="color: #009900;">&#40;</span>item<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; _list<span style="color: #339933;">.</span>itemArrange<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _list<span style="color: #339933;">.</span>holder<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> _list<span style="color: #339933;">.</span>itemsHolder<span style="color: #339933;">.</span>height <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>_margin <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//_list.itemsHolder.x = _list.holder.width / 2 - _list.itemsHolder.width/ 2;</span><br />
&nbsp; &nbsp; _list<span style="color: #339933;">.</span>itemsHolder<span style="color: #339933;">.</span>x <span style="color: #339933;">=</span> _list<span style="color: #339933;">.</span>holder<span style="color: #339933;">.</span>width <span style="color: #339933;">-</span> _list<span style="color: #339933;">.</span>itemsHolder<span style="color: #339933;">.</span>width <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; _list<span style="color: #339933;">.</span>itemsHolder<span style="color: #339933;">.</span>y <span style="color: #339933;">=</span> _list<span style="color: #339933;">.</span>holder<span style="color: #339933;">.</span>height <span style="color: #339933;">-</span> _list<span style="color: #339933;">.</span>itemsHolder<span style="color: #339933;">.</span>height <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; _numItems <span style="color: #339933;">=</span> _list<span style="color: #339933;">.</span>items<span style="color: #339933;">.</span>length<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; optimizeScrolling<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Here you can see a For Loop <span style="color:#b30909"><br />
var i:int;<br />
	for (i = 0; i < 500; i++)</span><br />
which you could write it this way:<br />
<span style="color:#b30909">for (var i:int; i < 500; i++)</span><br />
But you as an Air App Developer should try not to force the mobile device RAM do extra operations. So do it like we did. It really affects the performance.</p>
<p>You know it is true that the app itself does Garbage Collect but you as an expert developer should work in such a way in that there won&#8217;t be any needs for the app to do Garbage Collect!</p>
<p>And please keep this line in mind  <span style="color:#b30909">_numItems = _list.items.length;</span>. There is a same story behind which I tell you later in the next step.</p>
<p>We avoid to explain the rest of these lines in this snippet for our main goal in this Tutorial is learning how to gain a higher optimization ( Full documentation regarding our Scrollbar is available in main file you have downloaded ).</p>
<p>But let me tell you for what we have called <span style="color:#b30909">_list.itemArrange();</span>:<br />
As we add the items in step 6 we should call this method to arrange the items based on the features we have defined in step 2.</p>
<p>Ok in order to align  <em>itemHolder</em> to center we divide  <em>_list.holder.width</em>  by 2 and then we subtract it by <em>_list.itemsHolder.width</em>  by 2. We do the same order for for the <em>height</em>.</p>
<p>The line 18 does the same operation as line 19 but again in order to gain a better performance we did our division in this way.</p>
<p>&nbsp;<br />
&nbsp;</p>
<p><strong>6</strong> – The final step is to call the function <em>optimizeScrolling()</em>. So let&#8217;s see what and how the function <em>optimizeScrolling()</em> really does:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> optimizeScrolling<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> item<span style="color: #339933;">:</span>Item<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> i<span style="color: #339933;">:</span>int<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> _numItems<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; item <span style="color: #339933;">=</span> _list<span style="color: #339933;">.</span>items<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>content <span style="color: #b1b100;">as</span> Item<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>item<span style="color: #339933;">.</span>globalPosition<span style="color: #339933;">.</span>y <span style="color: #339933;">&gt;</span> <span style="color: #339933;">-</span>ITEM_HEIGHT<span style="color: #339933;">-</span>_extraHeight <span style="color: #339933;">&amp;&amp;</span> item<span style="color: #339933;">.</span>globalPosition<span style="color: #339933;">.</span>y <span style="color: #339933;">&lt;</span> _height <span style="color: #339933;">+</span> this<span style="color: #339933;">.</span>y<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; item<span style="color: #339933;">.</span>visible <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; item<span style="color: #339933;">.</span>visible <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Ok do you remember <span style="color:#b30909">_numItems = _list.items.length;</span>?<br />
We make a For Loop considering the <em>_numItems</em>. But we don&#8217;t use <em> _list.items.length</em>  because it decrease the performance if you put it instead of <em>_numItems</em> in this For Loop.<br />
You know what I&#8217;m talking about man! You as an Air App Developer should observe all of these little tricks in order to gain a better optimization for any App you develop.</p>
<p><span class="info_boxes note_box" style="width:100%;"><span class="info_text"><br />
Well the Pivotal Trick we have used to gain a better optimization in our scrollbar is here!<br />
Our scrollbar does not show all of the so called 500 different items at once. It only shows the part of the content which can be seen in the device screen <img src='http://myappsnippet.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
</span></span></p>
<p>Yes, as you can see here is an  <em>if else statement</em>  that tells the scrollbar to make the items visible if and only if they are within the device screen dimensions. Otherwise the item visibility is set to false ( <span style="color:#b30909">item.visible = false;</span> ).  </p>
<div class="divider_hr" style="padding-top:20px; margin-bottom:20px;">&nbsp;</div>
<p>I hope that you enjoy this Tutorial and can create awesome Air Apps with Ultimate Optimization. If you do so, do send us a link, we’d love to see what you have created using these tricks.</p>
<p>Regards,<br />
MyFlashLab Team</p>
]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/scrolling-optimization-mobile-air-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://myappsnippet.com/211/</link>
		<comments>http://myappsnippet.com/211/#comments</comments>
		<pubDate>Sat, 02 Mar 2013 19:22:51 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
		
		<guid isPermaLink="false">http://myappsnippet.com/?p=211</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/211/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://myappsnippet.com/210/</link>
		<comments>http://myappsnippet.com/210/#comments</comments>
		<pubDate>Sat, 02 Mar 2013 19:22:51 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
		
		<guid isPermaLink="false">http://myappsnippet.com/?p=210</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://myappsnippet.com/210/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
