<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Juan develops in AS 3.0</title>
	<atom:link href="http://juandevelops.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://juandevelops.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 23 Sep 2010 18:01:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='juandevelops.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Juan develops in AS 3.0</title>
		<link>http://juandevelops.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://juandevelops.wordpress.com/osd.xml" title="Juan develops in AS 3.0" />
	<atom:link rel='hub' href='http://juandevelops.wordpress.com/?pushpress=hub'/>
		<item>
		<title>simple way to resize height of TextArea based on htmlText or Text, for Flex 3 and for Flex 4</title>
		<link>http://juandevelops.wordpress.com/2010/09/23/simple-way-to-resize-height-of-textarea-based-on-htmltext-or-text-for-flex-3-and-for-flex-4/</link>
		<comments>http://juandevelops.wordpress.com/2010/09/23/simple-way-to-resize-height-of-textarea-based-on-htmltext-or-text-for-flex-3-and-for-flex-4/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 16:20:32 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/?p=183</guid>
		<description><![CDATA[i went looking for a way for my TextArea component to resize its height using a fixed width. i realized that there were many trying to solve the problem such as this one http://idletogether.com/automatically-resize-texttextarea-based-on-content-autosize-in-flex/ there were others who solved the problem but a few people were having a few issues still.. http://cookbooks.adobe.com/post_Creating_a_dynamically_resizing_TextArea_without_s-13628.html this is my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=183&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>i went looking for a way for my TextArea component to resize its height using a fixed width. i realized that there were many trying to solve the problem such as this one</p>
<p><a href="http://idletogether.com/automatically-resize-texttextarea-based-on-content-autosize-in-flex/">http://idletogether.com/automatically-resize-texttextarea-based-on-content-autosize-in-flex/</a></p>
<p>there were others who solved the problem but a few people were having a few issues still..</p>
<p><a href="http://cookbooks.adobe.com/post_Creating_a_dynamically_resizing_TextArea_without_s-13628.html">http://cookbooks.adobe.com/post_Creating_a_dynamically_resizing_TextArea_without_s-13628.html</a></p>
<p>this is my approach, no need to use a TextArea, instead create a UIComponent and embed a TextField. Simple, and<br />
you can still apply stylesheet, htmltext, text to the component, so it is treated like an actual TextArea. Why battle and try to go into all the things that make up your TextArea, in fact, you don&#8217;t even have to think about scrollbars anymore, because simply there are no scrollbars in UIComponent!!  You can update a few ways of declarations in this component if you need to make it work for Flex 4</p>
<div id="_mcePaste">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</div>
<div id="_mcePaste">&lt;mx:UIComponent xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; &gt;</div>
<div id="_mcePaste">&lt;mx:Script&gt;</div>
<div id="_mcePaste">&lt;![CDATA[</div>
<div id="_mcePaste">private var _text:String;</div>
<div id="_mcePaste">private var _styleSheet:StyleSheet;</div>
<div id="_mcePaste">private var tf:TextField;</div>
<div>public function get styleSheet():StyleSheet</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">return _styleSheet;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">public function set styleSheet(value:StyleSheet):void</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">_styleSheet = value;</div>
<div id="_mcePaste">tf.styleSheet = _styleSheet;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">public function set htmlText(value:String):void</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">this._text = value;</div>
<div id="_mcePaste">tf.htmlText = value;</div>
<div id="_mcePaste">this.height = tf.height;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">public function get htmlText():String</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">return this._text;</div>
<div id="_mcePaste">}</div>
<div>//same as htmlText setter.. except textfield gets assigned the string in its text property.</div>
<div id="_mcePaste">public function set text(value:String):void</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">this._text = value;</div>
<div id="_mcePaste">tf.text = value;</div>
<div id="_mcePaste">this.height = tf.height;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">public function get text():String</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">return this._text;</div>
<div id="_mcePaste">}</div>
<div>
<div>override protected function measure():void</div>
<div>{</div>
<div><span style="white-space:pre;"> </span>super.measure();</div>
<div><span style="white-space:pre;"> </span></div>
<div><span style="white-space:pre;"> </span>if( tf )</div>
<div><span style="white-space:pre;"> </span>{</div>
<div><span style="white-space:pre;"> </span>tf.width = this.getExplicitOrMeasuredWidth();</div>
<div><span style="white-space:pre;"> </span>this.measuredHeight = tf.height;</div>
<div><span style="white-space:pre;"> </span>}</div>
<div>}<span style="white-space:pre;"> </span></div>
</div>
<div id="_mcePaste">//make any changes here, like in my case to prove it worked, i set a border</div>
<div id="_mcePaste">//which you don't need...</div>
<div id="_mcePaste">override protected function createChildren():void</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">this.tf = new TextField();</div>
<div id="_mcePaste">this.tf.autoSize = TextFieldAutoSize.LEFT;</div>
<div id="_mcePaste">this.tf.border = true;</div>
<div id="_mcePaste">this.tf.multiline = true;</div>
<div id="_mcePaste">this.tf.wordWrap = true;</div>
<div id="_mcePaste">this.addChild( this.tf );</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">]]&gt;</div>
<div id="_mcePaste">&lt;/mx:Script&gt;</div>
<div id="_mcePaste">&lt;/mx:UIComponent&gt;</div>
<p>In my application</p>
<p>&lt;view:ResizeTextArea id=&#8221;txt&#8221; y=&#8221;52&#8243; width=&#8221;200&#8243;  /&gt;</p>
<p>the scripting..</p>
<p>this.txt.styleSheet = StyleFactory.createStyleSheet( [ "p", "h1" ] ); /*check my blog how i get the stylesheet from StyleManager */<br />
this.txt.htmlText =  someHTMLContent;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=183&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2010/09/23/simple-way-to-resize-height-of-textarea-based-on-htmltext-or-text-for-flex-3-and-for-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>
	</item>
		<item>
		<title>Going from Flex directly to Android</title>
		<link>http://juandevelops.wordpress.com/2010/08/21/going-from-flex-to-android/</link>
		<comments>http://juandevelops.wordpress.com/2010/08/21/going-from-flex-to-android/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 15:30:44 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[air]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/?p=176</guid>
		<description><![CDATA[I am at a point where i decided instead to use Android for its apps instead of using Flash or Air to create them. I think if i go this way instead i will have a lot more flexibility and access to different resources. I already checked the documentation for Flash to do Android Apps [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=176&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am at a point where i decided instead to use Android for its apps instead of using Flash or Air to create them. I think if i go this way instead i will have a lot more flexibility and access to different resources. I already checked the documentation for Flash to do Android Apps and they list the life cycles of applications in the same way as from Android. I think if instead i get experience doing android apps this way i can switch or be more familiar what i can do and cannot do using Flash. I don&#8217;t know how other people relate to Android or how much time they have to learn but for me having lots of time gives me more opportunity to explore and learn with no pressure such as a real project. As i started to study Android, in my case, it reminds me a lot of Adobe AIR such as xml settings, but the life cycles remind me of the life cycles in Flex Applications.</p>
<p>I started studying Java previous to Android. I learned the basics from http://download.oracle.com/javase/tutorial/java/index.html, that brought me more confidence to go into Android. I am still learning Java and need to learn a few other important classes such as the use of  threads which i already saw it is being used when creating Android Applications.</p>
<p>My best suggestion for others who are Flex developers or just new to Android is to skim books about Android, see what topics you need to learn from Java if you just know the basics like me. And also look at examples, don&#8217;t do them, just pay attention of the process how applications are created. The book i am using is called Hello Android. It goes straight to android applications. I don&#8217;t like these examples as i see a lot of things they talk about while developing. They have an application too long to remember even the process of things, but just trying to understand helps. My next book will be Android 2 from Wrox. I looked at it, and like their examples. They look small and go from one short topic to another. Those are the books that help me put everything together while i practice each exercise. I try to avoid knowing the logic for example of a sudoku game from the current book because i don&#8217;t really care how the game works, i am more interested to find out what i need to use to make an application work and have menu options, etc.</p>
<p>One of the things that is really making me so excited about Android is a topic related to loading a web browser view in an application and it can interact with it. That is really exciting to know for example if the web page can retrieve your geocode, or you grant access to data saved from the application. The topic related to saving data reminded me of SharedObjects in Flash and SQL Lite as used in Adobe AIR.</p>
<p>My experience has been a lot greater with Android than Iphone Apps. I started to learn it but felt not happy how the IDE of such applications is a little slow or runs a debugger at the last minute while compiling. Besides that Objective-C was not a language i found myself excited to learn. I want to do applications in a way I feel happy to do the work, and I don&#8217;t care right now if Android is less popular than the Iphone, and if it will always be like that.</p>
<p>I like Android because it is open source, and that gives other technologies to create applications such as the case of Flash. In the case of Apple, it backfired the ability for flash to create iphone applications due to their restrictions in their market. I find it exciting to know there are tutorials how to run flash player in the iphone. Not everyone is convinced that Flash Player is not good for the iphone. I like that attitude of those users, they want to see things for themselves rather than being told what they can and cannot do. I wondering if there are other flex developers going straight for Android. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=176&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2010/08/21/going-from-flex-to-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>
	</item>
		<item>
		<title>issues with installing subversion for flash builder ( flex 4 )</title>
		<link>http://juandevelops.wordpress.com/2010/06/18/issues-with-installing-subversion-for-flash-builder-flex-4/</link>
		<comments>http://juandevelops.wordpress.com/2010/06/18/issues-with-installing-subversion-for-flash-builder-flex-4/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 17:04:49 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/?p=171</guid>
		<description><![CDATA[i followed these instructions http://www.flashmagazine.com/tutorials/detail/setting_up_subversion_with_adobe_flash_builder_4/ i kept having issues with bundles not able to be found. i close flash builder and opened it using a different workspace and finally subversion plugin was installed<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=171&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>i followed these instructions <a href="http://www.flashmagazine.com/tutorials/detail/setting_up_subversion_with_adobe_flash_builder_4/">http://www.flashmagazine.com/tutorials/detail/setting_up_subversion_with_adobe_flash_builder_4/</a></p>
<p>i kept having issues with bundles not able to be found.</p>
<p>i close flash builder and opened it using a different workspace and finally subversion plugin was installed <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/171/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=171&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2010/06/18/issues-with-installing-subversion-for-flash-builder-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>
	</item>
		<item>
		<title>fixing deep linking for browsers like chrome</title>
		<link>http://juandevelops.wordpress.com/2010/05/18/fixing-deep-linking-for-browsers-like-chrome/</link>
		<comments>http://juandevelops.wordpress.com/2010/05/18/fixing-deep-linking-for-browsers-like-chrome/#comments</comments>
		<pubDate>Tue, 18 May 2010 16:45:17 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[swfobject]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/?p=162</guid>
		<description><![CDATA[Please if you like what you read, i would like to hear from you and how this post is helping you. i went through a difficult time trying to use the anchor navigation in order to update a background and video in an application. As there are html calls to modify the anchoring and i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=162&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">Please if you like what you read, i would like to hear from you and how this post is helping you.</div>
<div id="_mcePaste">i went through a difficult time trying to use the anchor navigation in order to update a background and video in an application. As there are html calls to modify the anchoring and i didn&#8217;t want to make call to my flex application. I discovered from other blogs that i need to wrap my html object with the same id as the anchor value.  But my application doesn&#8217;t detect the changes unless i call that javascript function. Then i also discovered that it can happen that my application can handle browsermanager events related to the application but not the browser. I came up with the idea that i can set a timer,  the only way to ping the changes, and stop it if i detect that the application can listen to browser changes not just application.  So that saves a lot of drawbacks and waste of CPU.</div>
<div id="_mcePaste">So far i have tested my html page in IE 8, firefox and google chrome and it works.  What do you need besides my files? you need the history.js and history.css which are generated by default from flex. i also used swfobject, so that could be another part of the this article how to use swfobject with browsermanager succesfully.</div>
<div>Thanks</div>
<p>mxml file</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221;<br />
layout=&#8221;vertical&#8221;<br />
addedToStage=&#8221;this.onStageReady(event);&#8221;<br />
creationComplete=&#8221;this.onAppComplete(event);&#8221; width=&#8221;200&#8243; height=&#8221;200&#8243;<br />
&gt;<br />
&lt;mx:Script&gt;<br />
&lt;![CDATA[<br />
import mx.managers.BrowserManager;<br />
import mx.events.BrowserChangeEvent;<br />
import mx.events.FlexEvent;<br />
import mx.managers.IBrowserManager;</p>
<p>private var bm:IBrowserManager;<br />
private var hashTimer:Timer;<br />
private var hashValue:String = "";</p>
<p>private function onAppComplete( event:FlexEvent ):void<br />
{<br />
this.hashTimer = new Timer( 500 );<br />
this.hashTimer.addEventListener( TimerEvent.TIMER, this.onHashTimer );</p>
<p>this.bm = BrowserManager.getInstance();<br />
this.bm.init( "", "Site" );<br />
this.bm.addEventListener( BrowserChangeEvent.BROWSER_URL_CHANGE, this.onBrowserChange );<br />
this.bm.addEventListener( BrowserChangeEvent.APPLICATION_URL_CHANGE, this.onAppChange );<br />
}</p>
<p>private function onStageReady( event:Event ):void<br />
{<br />
this.setHash( this.bm.fragment );<br />
this.setHashTimer();<br />
}</p>
<p>private function setHashTimer():void<br />
{<br />
//inmediately call to detect if the anchor has a value.<br />
this.onHashTimer();</p>
<p>if( !this.hashTimer.running )<br />
this.hashTimer.start();<br />
}</p>
<p>private function setHash( value:String ):void<br />
{<br />
this.hashValue = value;<br />
txt.text = "hash value: " +  this.hashValue;<br />
}</p>
<p>private function getHash():void<br />
{<br />
var hash:String = ExternalInterface.call( "getHash" );<br />
ExternalInterface.call( "alert", "Javascript.getHash() returns " + hash );<br />
}</p>
<p>private function onBrowserChange( event:BrowserChangeEvent=null ):void<br />
{<br />
/**<br />
* i noticed that chrome on first chrome change was getting a null value<br />
* for browsermanager's fragment. so that was a good key for me to set the<br />
* timer and read the anchor value coming from javascript.<br />
*<br />
* if i am able to get the fragment, then it means the browser works fine<br />
* and i don't need to use my timer. but if the fragment value is null then<br />
* i can set it back to use the timer.<br />
*/</p>
<p>if( this.bm.fragment )<br />
{<br />
if( this.hashTimer.running )<br />
this.hashTimer.stop();</p>
<p>this.setHash( this.bm.fragment );<br />
}<br />
else<br />
{<br />
this.setHashTimer();<br />
}<br />
}</p>
<p>/**<br />
* if the application can handle browse changes by the browser, i wanted to keep this<br />
* functionality independent from the browser making the changes instead */</p>
<p>private function onAppChange( event:BrowserChangeEvent ):void<br />
{<br />
this.setHash( this.bm.fragment );<br />
}</p>
<p>/**<br />
* checkign if the hash value has changed, and making sure we have the JS function available<br />
* to retrieve the hash value **/<br />
private function onHashTimer( event:TimerEvent=null ):void<br />
{<br />
var hash:String = ExternalInterface.call( "getHash" );</p>
<p>if( hash != this.hashValue )<br />
{<br />
this.setHash( hash );<br />
}<br />
}</p>
<p>/**<br />
* this function was done in purpose to test what would happen in chrome if we<br />
* change the hash value from the application instead of the browser */<br />
private function linkHash():void<br />
{<br />
this.bm.setFragment( "1" );<br />
}<br />
]]&gt;<br />
&lt;/mx:Script&gt;<br />
&lt;mx:Text id=&#8221;txt&#8221; width=&#8221;100&#8243; height=&#8221;40&#8243; text=&#8221;hello&#8221; /&gt;<br />
&lt;mx:Button label=&#8221;getHash&#8221; click=&#8221;this.getHash();&#8221; /&gt;<br />
&lt;mx:Button label=&#8221;setHash(1)&#8221; click=&#8221;this.linkHash();&#8221; /&gt;<br />
&lt;/mx:Application&gt;</p>
<p>page</p>
<p>&lt;head&gt;<br />
&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/styles/history.css&#8221; /&gt;<br />
&lt;title&gt;&lt;/title&gt;</p>
<p>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=iso-8859-1&#8243; /&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;/scripts/swfobject.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;/scripts/history.js&#8221;&gt;&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;div id=&#8221;AppLayer&#8221;&gt;<br />
&lt;a href=&#8221;http://www.adobe.com/go/EN_US-H-GET-FLASH&#8221;&gt;Get Flash Player&lt;/a&gt; to view animation.</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>//function required for getting the current hash<br />
function getHash()<br />
{<br />
return unescape(self.document.location.hash.substring(1));<br />
}</p>
<p>var requiredMajorVersion = 9;<br />
var requiredMinorVersion = 0;<br />
var requiredRevision = 124;</p>
<p>//swfobject<br />
var flashvars = {};</p>
<p>var params = {};<br />
params.menu = &#8220;false&#8221;;<br />
params.quality = &#8220;best&#8221;;<br />
params.scale = &#8220;noscale&#8221;;<br />
params.salign = &#8220;tl&#8221;;<br />
params.bgcolor = &#8220;#FFFFFF&#8221;;<br />
params.allowscriptaccess = &#8220;always&#8221;;</p>
<p>var attributes = {};</p>
<p>swfobject.embedSWF(&#8220;/Main.swf&#8221;,<br />
&#8220;AppLayer&#8221;,<br />
&#8220;200&#8243;,<br />
&#8220;200&#8243;,<br />
&#8220;9&#8243;,<br />
&#8220;/common/swf/expressInstall.swf&#8221;,<br />
flashvars, params, attributes );<br />
&lt;/script&gt;<br />
&lt;/div&gt;</p>
<p>&lt;a href=&#8221;#2&#8243;&gt;&lt;p id=&#8221;2&#8243;&gt;hash 2&lt;/p&gt;&lt;/a&gt;<br />
&lt;a href=&#8221;#3&#8243;&gt;&lt;p id=&#8221;3&#8243;&gt;hash 3&lt;/p&gt;&lt;/a&gt;<br />
&lt;a href=&#8221;#4&#8243;&gt;&lt;p id=&#8221;4&#8243;&gt;hash 4&lt;/p&gt;&lt;/a&gt;<br />
&lt;a href=&#8221;#5&#8243;&gt;&lt;p id=&#8221;5&#8243;&gt;hash 5&lt;/p&gt;&lt;/a&gt;</p>
<p>&lt;/body&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/162/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=162&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2010/05/18/fixing-deep-linking-for-browsers-like-chrome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>
	</item>
		<item>
		<title>I got my Adobe&#8217;s Flex 3 Certification</title>
		<link>http://juandevelops.wordpress.com/2010/04/05/i-got-my-adobes-flex-3-certificate/</link>
		<comments>http://juandevelops.wordpress.com/2010/04/05/i-got-my-adobes-flex-3-certificate/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 22:02:58 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe Certificate]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/?p=149</guid>
		<description><![CDATA[Here is my Certification!! I took the test today, and was so glad to pass it. What i realize is that the test was indeed based everything in what is reviewed from Adobe&#8217;s ACE exam guide. So i am not blowing questions but to tell you what i saw from the test. I saw questions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=149&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://juan.dev03.newermedia.com/resources/images/personal/flexcertification.jpg">Here is my Certification!!</a></p>
<p>I took the test today, and was so glad to pass it. What i realize is that the test was indeed based everything in what is reviewed from Adobe&#8217;s ACE exam guide. So i am not blowing questions but to tell you what i saw from the test. I saw questions about RemoteObject, questions about Event and its phases, questions about working with Files and local Database. Several questions also applied to DataService class. Other questions regarding binding data. So if you think about it, it is nothing new or different from their guidelines.</p>
<p>I took before a flash 8 certificate and in that exam i was surprised as i felt many questions were not very relevant to it. In the case of this exam i felt very comfortable to see questions that were more obvious to be in a test. I studied a few times like for the LCDS just learning directly what Consumer, Producer, RemoteObject, and how to use HTTPService classes. as installing other features from LCDS were a lot of work like using DataService class.</p>
<p>What are some of the resources i used and found very helpful.</p>
<p>For LCDS i relied a lot on lynda&#8217;s using dataservices <a href="http://www.lynda.com/home/DisplayCourse.aspx?lpk2=335">http://www.lynda.com/home/DisplayCourse.aspx?lpk2=335</a></p>
<p>also another great source which i didn&#8217;t want to go too in depth as the book is from Wrox&#8217;s Flex 3 book four chapters in same material.</p>
<p>I really recommend O&#8217;reilly Flex 3 book and O&#8217;reilly Essential ActionScript 3 book. As they are east to learn and also very helpful.</p>
<p>I had in the past studied Adobe Flex 3 Training from the source but found it too wordly and felt lost looking line by line to do an application.</p>
<p>What i really recommend as a technique to study is to group three subjects together to practice. Like yesterday i did a simple exercise in AIR, where i created an application that dragged and drop files, and automatically save them in a local database, and using a datagrid update rows, or remove them, and even use transaction commit or rollback, and for update open a new AIR window showing a form to modify the values and returned them back to the parent window. Maybe this sounds more complex, but i find doing even simple exercises helpful to cover three subjects like a sample form which even mimics uploading a file and then practice in some way how to use an event and check with the different event phases or having formatters and validators. I hope you get the point to get creative studying.</p>
<p>In my case it took me more than a year because i was on and off in a constant basis. I was a little panic to take it as i imagined going through the same experience with the ridiculous questions in the Flash 8 exam. I thought what if they ask me some question related to something i had never ever done or was too deep in one subject. Most of the exam is fair so don&#8217;t panic like i did. It was bread and butter.  More questions or suggestions feel free to contact me.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=149&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2010/04/05/i-got-my-adobes-flex-3-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>
	</item>
		<item>
		<title>Command Pattern</title>
		<link>http://juandevelops.wordpress.com/2010/03/05/command-pattern/</link>
		<comments>http://juandevelops.wordpress.com/2010/03/05/command-pattern/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 18:26:48 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/2010/03/05/command-pattern/</guid>
		<description><![CDATA[Here is an example of using the Command Pattern created by me  ;) http://juan.dev03.newermedia.com/content/designPatterns/command/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=147&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is an example of using the Command Pattern created by me  ;)</p>
<p><a href="http://juan.dev03.newermedia.com/content/designPatterns/command/">http://juan.dev03.newermedia.com/content/designPatterns/command/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=147&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2010/03/05/command-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>
	</item>
		<item>
		<title>Making sure papervision acknowledges Flex of its dimensions</title>
		<link>http://juandevelops.wordpress.com/2009/10/21/making-sure-papervision-acknowledges-flex-of-its-dimensions/</link>
		<comments>http://juandevelops.wordpress.com/2009/10/21/making-sure-papervision-acknowledges-flex-of-its-dimensions/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 16:02:28 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Papervision]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/2009/10/21/making-sure-papervision-acknowledges-flex-of-its-dimensions/</guid>
		<description><![CDATA[This is an effective way to load papervison into Flex. In application include a UIComponent instance &#60;box:PaperVisionBoxid=&#8221;ppv&#8220;/&#62; This is the UIComponent instance. Here we are getting feedback from mc to know the dimensions of its papervision content and in order to resize this UIComponent. In this way the application gets noticed of the new dimensions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=143&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p style="margin-bottom:0;">This is an effective way to load papervison into Flex.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">In application include a UIComponent instance</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;box:PaperVisionBox</span><span style="color:#000000;">id=&#8221;</span><span style="color:#990000;">ppv</span><span style="color:#000000;">&#8220;</span><span style="color:#0000ff;">/&gt;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0000ff;">This is the UIComponent instance. Here we are getting feedback from mc to know the dimensions of its papervision content and in order to resize this UIComponent. In this way the application gets noticed of the new dimensions and pushes down or left depending of its layout.</span></span></span></p>
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0000ff;">//PaperVisionBox</span></span></span></p>
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#000000;">&lt;</span><span style="color:#000000;">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;mx:UIComponent</span><span style="color:#000000;">xmlns:mx=&#8221;</span><span style="color:#990000;">http://www.adobe.com/2006/mxml</span><span style="color:#000000;">&#8221; xmlns:box=&#8221;</span><span style="color:#990000;">com.juandevelops.ppv.box.*</span><span style="color:#000000;">&#8220;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#000000;">preinitialize=&#8221;</span><span style="color:#0033ff;"><strong>this</strong></span><span style="color:#000000;">.onFlexEvent( event );&#8221;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#000000;">addedToStage=&#8221;</span><span style="color:#0033ff;"><strong>this</strong></span><span style="color:#000000;">.onFlexEvent(event);&#8221;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#000000;">resize=&#8221;</span><span style="color:#0033ff;"><strong>this</strong></span><span style="color:#000000;">.onFlexEvent(event);&#8221;</span><span style="color:#0000ff;">&gt;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#006633;">&lt;mx:Script&gt;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">&lt;![CDATA[</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>import </strong></span><span style="color:#000000;">com.juandevelops.flesh.stage.StageEvent;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#000000;"><span style="color:#0033ff;"><strong>import com.juandevelops</strong></span></span><span style="color:#000000;">.flesh.stage.StageListener;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#000000;"><span style="color:#0033ff;"><strong>import com.juandevelops</strong></span></span><span style="color:#000000;">.ppv.cube.MotherCube;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>import </strong></span><span style="color:#000000;">mx.events.FlexEvent;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>private </strong></span><span style="color:#6699cc;"><strong>var </strong></span><span style="color:#000000;">mc:MotherCube</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>private </strong></span><span style="color:#339966;"><strong>function </strong></span><span style="color:#000000;">onFlexEvent( event:Event ):</span><span style="color:#0033ff;"><strong>void</strong></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">{</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>if</strong></span><span style="color:#000000;">( event.type == FlexEvent.PREINITIALIZE )</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">{</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#000000;">mc =</span><span style="color:#0033ff;"><strong>new </strong></span><span style="color:#000000;">MotherCube();</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>this</strong></span><span style="color:#000000;">.addChild( mc );</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">}</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>else</strong></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>if</strong></span><span style="color:#000000;">( event.type == Event.ADDED_TO_STAGE || event.type == Event.RESIZE )</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">{</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>this</strong></span><span style="color:#000000;">.invalidateSize();</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">}</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">}</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>override </strong></span><span style="color:#0033ff;"><strong>protected </strong></span><span style="color:#339966;"><strong>function </strong></span><span style="color:#000000;">measure():</span><span style="color:#0033ff;"><strong>void</strong></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">{</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>super</strong></span><span style="color:#000000;">.measure();</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>if</strong></span><span style="color:#000000;">( mc )</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">{</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>this</strong></span><span style="color:#000000;">.measuredWidth = mc.width;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0033ff;"><strong>this</strong></span><span style="color:#000000;">.measuredHeight = mc.height;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">}</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">}</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">]]&gt;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#006633;">&lt;/mx:Script&gt;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#0000ff;">&lt;/mx:UIComponent&gt;</span></span></span></p>
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">Now it&#8217;s time to see the work done in MotherCube which is an instance os Sprite and is loading papervision, and in papervision we include a cube.</span></span></span></p>
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">We can ignore most of the code and just pay attention to getters width and height.</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">Also important, not to include any other content but just papervision.</span></span></span></p>
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">//MotherCube</span></span></span></p>
<p style="margin-bottom:0;text-align:left;">
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>package</strong> icom.juandevelops.ppv.cube</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>{</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> flash.display.Sprite;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> flash.events.Event;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> flash.events.MouseEvent;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> flash.geom.Rectangle;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> org.papervision3d.cameras.CameraType;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> org.papervision3d.materials.ColorMaterial;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> org.papervision3d.materials.MovieMaterial;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> org.papervision3d.materials.utils.MaterialsList;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> org.papervision3d.objects.primitives.Cube;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> org.papervision3d.render.BasicRenderEngine;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>import</strong> org.papervision3d.view.BasicView;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>public</strong><strong>class</strong> MotherCube  <strong>extends</strong> Sprite</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>{</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>private</strong><strong>var</strong> view:BasicView;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>private</strong><strong>var</strong> _cube:Cube;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>private</strong><strong>var</strong> list:MaterialsList;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>private</strong><strong>var</strong> cm:ClipMaterial;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>private</strong><strong>var</strong> mm:MovieMaterial;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>public</strong><strong>function</strong> MotherCube()</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>{</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>view =  <strong>new</strong> BasicView(600, 600,  <strong>false</strong>,  <strong>false</strong>, CameraType.FREE);</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>view.renderer =  <strong>new</strong> BasicRenderEngine(); addChild(view);</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>view.viewport.interactive =  <strong>true</strong>;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>view.camera.z = -540;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>list =  <strong>new</strong> MaterialsList();</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>list.addMaterial(  <strong>new</strong> ColorMaterial( 0xFFFFFF,  <strong>&#8220;back&#8221;</strong> );</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>list.addMaterial(  <strong>new</strong> ColorMaterial( 0x0099FF, 1,  <strong>false</strong> ),  <strong>&#8220;front&#8221;</strong> );</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>list.addMaterial(  <strong>new</strong> ColorMaterial( 0xFF0000, 1,  <strong>false</strong> ),  <strong>&#8220;left&#8221;</strong> );</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>list.addMaterial(  <strong>new</strong> ColorMaterial( 0xFFCC00, 1,  <strong>false</strong> ),  <strong>&#8220;right&#8221;</strong> );</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>list.addMaterial(  <strong>new</strong> ColorMaterial( 0x93A070, 1,  <strong>false</strong> ),  <strong>&#8220;top&#8221;</strong> );</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>list.addMaterial(  <strong>new</strong> ColorMaterial( 0&#215;999999, 1,  <strong>false</strong> ),  <strong>&#8220;bottom&#8221;</strong> );</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>_cube =  <strong>new</strong> Cube( list, 400, 400, 400 );</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>view.scene.addChild( _cube );</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>this</strong>.addEventListener( Event.ENTER_FRAME, onRenderViewport);</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>}</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>private</strong><strong>function</strong> onRenderViewport(e:Event): <strong>void</strong></em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>{</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>view.singleRender();</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>}</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><span style="color:#000000;"><span style="font-style:normal;"><strong>override</strong></span></span><span style="color:#000000;"><span style="font-style:normal;"><strong>public</strong></span></span><span style="color:#000000;"><span style="font-style:normal;"><strong>function</strong></span></span><span style="color:#000000;"><span style="font-style:normal;"><strong>get</strong></span></span><span style="color:#000000;"><span style="font-style:normal;">width():Number</span></span></span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">{</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><strong>if</strong>( view )</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><strong>return</strong> view.viewport.viewportWidth;</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><strong>return</strong> 0;</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">}</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><strong>override</strong><strong>public</strong><strong>function</strong><strong>get</strong> height():Number</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">{</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><strong>if</strong>( view )</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><strong>return</strong> view.viewport.viewportWidth;</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><strong>return</strong> 0;</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">}</span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>public</strong><strong>function</strong><strong>get</strong> cube():Cube</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>{</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em><strong>return</strong><strong>this</strong>._cube;</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>}</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>}</em></span></span></span></p>
<p style="margin-bottom:0;text-align:left;"><span style="color:#666666;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;"><em>}</em></span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;">
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">In my appliation I included the box below having the scrollers, and they are pushed down as the content in PaperVisionBox found out the dimensions of MotherCube</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;">
<p style="margin-bottom:0;font-style:normal;text-align:left;"><img style="text-align:left;" src="http://juandevelops.files.wordpress.com/2009/10/sbres_1256140723_0__.jpg?w=632&#038;h=860" border="0" alt="" width="632" height="860" /></p>
<p style="margin-bottom:0;font-style:normal;text-align:left;">
<p style="margin-bottom:0;font-style:normal;text-align:left;"><span style="color:#000000;"><span style="font-family:'Courier New', monospace;"><span style="font-size:x-small;">I Hope this helps, please let me know.. I am try to share my work knowledge and I never get any comments.</span></span></span></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=143&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2009/10/21/making-sure-papervision-acknowledges-flex-of-its-dimensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>

		<media:content url="http://juandevelops.files.wordpress.com/2009/10/sbres_1256140723_0__.jpg" medium="image" />
	</item>
		<item>
		<title>Shortcut to include NativeMenu in desktop</title>
		<link>http://juandevelops.wordpress.com/2009/10/12/shortcut-to-include-nativemenu-in-desktop-2/</link>
		<comments>http://juandevelops.wordpress.com/2009/10/12/shortcut-to-include-nativemenu-in-desktop-2/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 15:36:14 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/2009/10/12/shortcut-to-include-nativemenu-in-desktop-2/</guid>
		<description><![CDATA[I like the idea of writing code that will save me from thinking more than i want.. in this case appending a NativeMenu required to set a condition when adding one to a windows or mac computer. So i wrote a class and also noticed there was an issue with Mac not able to display [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=140&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p> <a id="ThanksMister" name="ThanksMister"></a>I like the idea of writing code that will save me from thinking more than i want.. in this case appending a NativeMenu required to set a condition when adding one to a windows or mac computer. So i wrote a class and also noticed there was an issue with Mac not able to display the NativeMenu; fortunately,  <a href="http://www.thanksmister.com/" id="ThanksMister" name="ThanksMister">ThanksMister</a> found a solution.. <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and what i did here is follow his suggestion..</p>
</p>
<p>Here is how simple i write my code and include the NativeMenu using my class NativeMenuUtil, which requires first for you to set stage to it, and then it takes care of the rest..</p>
</p>
<p>NativeMenuUtil.stage = this.stage;</p>
</p>
<p>var nativeMenu:NativeMenu = new NativeMenu();</p>
<p>var item:NativeMenuItem;</p>
</p>
<p>item = new NativeMenuItem( &#8220;Menu 1&#8243; );</p>
<p>nativeMenu.addItem( item );</p>
</p>
<p>item = new NativeMenuItem( &#8220;Menu 2&#8243; );</p>
<p>nativeMenu.addItem( item );</p>
</p>
<p>NativeMenuUtil.applicationMenu = nativeMenu;</p>
</p>
<p>//here is the code&#8230;</p>
</p>
<p> <font color="#9900CC"><font face="Courier New, serif"><font size="2"><b>package</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">com.juandevelops.air.menu</font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">{</font></font> </p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>import</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">flash.desktop.NativeApplication;</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>import</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">flash.display.NativeMenu;</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>import</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">flash.display.NativeMenuItem;</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>import</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">flash.display.NativeWindow;</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>import</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">flash.display.Stage;</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>public</b></font></font></font>  <font color="#9900CC"><font face="Courier New, serif"><font size="2"><b>class</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">NativeMenuUtil</font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">{</font></font> </p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>private</b></font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>static</b></font></font></font>  <font color="#6699CC"><font face="Courier New, serif"><font size="2"><b>var</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">_stage:Stage;</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>public</b></font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>static</b></font></font></font>  <font color="#339966"><font face="Courier New, serif"><font size="2"><b>function</b></font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>set</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">stage( stage:Stage ):</font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>void</b></font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">{</font></font> </p>
<p> <font face="Courier New, serif"><font size="2">_stage = stage;</font></font> </p>
<p> <font face="Courier New, serif"><font size="2">}</font></font> </p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>public</b></font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>static</b></font></font></font>  <font color="#339966"><font face="Courier New, serif"><font size="2"><b>function</b></font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>get</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">applicationMenu():NativeMenu</font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">{</font></font> </p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>return</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">getNativeMenu();</font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">}</font></font> </p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>public</b></font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>static</b></font></font></font>  <font color="#339966"><font face="Courier New, serif"><font size="2"><b>function</b></font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>set</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">applicationMenu( nativeMenu:NativeMenu ):</font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>void</b></font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">{</font></font> </p>
<p> <font color="#6699CC"><font face="Courier New, serif"><font size="2"><b>var</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">myNativeMenu:NativeMenu = getNativeMenu();</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>if</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">( NativeWindow.supportsMenu )</font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">{</font></font> </p>
<p> <font face="Courier New, serif"><font size="2">myNativeMenu = nativeMenu;</font></font> </p>
<p> <font face="Courier New, serif"><font size="2">}</font></font> </p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>else</b></font></font></font> </p>
<p> <font face="Courier New, serif"><font size="2">{</font></font> </p>
<p> <font color="#009900"><font face="Courier New, serif"><font size="2"><i>//sample helped me so much, i was going nuts why i couldn&#8217;t display menu on a mac.</i></font></font></font> </p>
<p> <font color="#009900"><font face="Courier New, serif"><font size="2"><i>//http://thanksmister.com/index.php/archive/air-nativemenu-issue-on-mac/comment-page-1/#comment-16493</i></font></font></font> </p>
<p> <font color="#6699CC"><font face="Courier New, serif"><font size="2"><b>var</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">menuItem:NativeMenuItem =</font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>new</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">NativeMenuItem(</font></font></font>  <font color="#990000"><font face="Courier New, serif"><font size="2"><b>&#8220;Application Menu&#8221;</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">);</font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">menuItem.submenu = nativeMenu;</font></font> </p>
<p> <font face="Courier New, serif"><font size="2">myNativeMenu.addItem(menuItem);</font></font> </p>
<p> <font face="Courier New, serif"><font size="2">}</font></font> </p>
<p> <font face="Courier New, serif"><font size="2">}</font></font> </p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>private</b></font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>static</b></font></font></font>  <font color="#339966"><font face="Courier New, serif"><font size="2"><b>function</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">getNativeMenu():NativeMenu</font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">{</font></font> </p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>if</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">( NativeWindow.supportsMenu )</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>return</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">_stage.nativeWindow.menu</font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>as</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">NativeMenu;</font></font></font></p>
<p> <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>return</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">NativeApplication.nativeApplication.menu</font></font></font>  <font color="#0033FF"><font face="Courier New, serif"><font size="2"><b>as</b></font></font></font>  <font color="#000000"><font face="Courier New, serif"><font size="2">NativeMenu;</font></font></font></p>
<p> <font face="Courier New, serif"><font size="2">}</font></font> </p>
</p>
<p> <font face="Courier New, serif"><font size="2">}</font></font> </p>
<p> <font face="Courier New, serif"><font size="2">}</font></font> </p>
</p>
<p>Here is what it looks like when I run the application</p>
</p>
<p> <img border="0" height="431" src="http://juandevelops.files.wordpress.com/2009/10/sbres_1255361476_0__.png?w=484&#038;h=431" style="text-align:bottom;" width="484"> </p>
<p style="margin-bottom:0;"> </p>
<p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=140&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2009/10/12/shortcut-to-include-nativemenu-in-desktop-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>

		<media:content url="http://juandevelops.files.wordpress.com/2009/10/sbres_1255361476_0__.png" medium="image" />
	</item>
		<item>
		<title>Getting the screen dimensions for Air Windows.</title>
		<link>http://juandevelops.wordpress.com/2009/10/02/getting-the-screen-dimensions-for-air-windows/</link>
		<comments>http://juandevelops.wordpress.com/2009/10/02/getting-the-screen-dimensions-for-air-windows/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 01:38:58 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[air]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/?p=132</guid>
		<description><![CDATA[I want just to make it easier to get the screen dimensions found under the screen. I used the code found here: http://cookbooks.adobe.com/index.cfm?event=showdetails&#38;postId=10823 So i just created a class that is static, and gives me the rectangle dimensions just when i need it and saving me writing the code.. package com.juandevelops.air.utils { import flash.display.NativeWindow; import [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=132&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I want just to make it easier to get the screen dimensions found under the screen. I used the code found here: http://cookbooks.adobe.com/index.cfm?event=showdetails&amp;postId=10823</p>
<p>So i just created a class that is static, and gives me the rectangle dimensions just when i need it and saving me writing the code..</p>
<p>package com.juandevelops.air.utils<br />
{<br />
import flash.display.NativeWindow;<br />
import flash.display.NativeWindowInitOptions;<br />
import flash.display.NativeWindowSystemChrome;<br />
import flash.display.StageDisplayState;<br />
import flash.events.EventDispatcher;<br />
import flash.geom.Rectangle;</p>
<p>public class ScreenUtils<br />
{<br />
public static function getScreenRectangle():Rectangle<br />
{<br />
//set the window options before creating the window&#8230;<br />
var options:NativeWindowInitOptions = new NativeWindowInitOptions()<br />
options.systemChrome=NativeWindowSystemChrome.NONE;<br />
options.transparent=true;</p>
<p>var tmpWindow:NativeWindow = new NativeWindow( options );</p>
<p>//blow up the window to take up the full size of the monitor&#8230;<br />
tmpWindow.stage.displayState = StageDisplayState.FULL_SCREEN;</p>
<p>var rect:Rectangle = tmpWindow.bounds.clone();</p>
<p>//get rid of invisible window<br />
tmpWindow.close();</p>
<p>return rect;<br />
}<br />
}<br />
}</p>
<p>so it will be easier to use ScreenUtils.getScreenRectangle() anywhere else.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=132&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2009/10/02/getting-the-screen-dimensions-for-air-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>
	</item>
		<item>
		<title>Clipboard set and get data from a custom object.</title>
		<link>http://juandevelops.wordpress.com/2009/08/29/clipboard-set-and-get-data-from-a-custom-object/</link>
		<comments>http://juandevelops.wordpress.com/2009/08/29/clipboard-set-and-get-data-from-a-custom-object/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 18:42:12 +0000</pubDate>
		<dc:creator>juandevelops</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[air]]></category>

		<guid isPermaLink="false">http://juandevelops.wordpress.com/?p=128</guid>
		<description><![CDATA[In Air, using ClipBoard allows for different object types to be copy and paste from one air application into another, from a non-air application into an air application, or viceversa. As i  looked into lynda.com air tutorials: http://www.lynda.com/home/DisplayCourse.aspx?lpk2=596 I learned that from an air application i can copy data items in the following formats text, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=128&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In Air, using ClipBoard allows for different object types to be copy and paste from one air application into another, from a non-air application into an air application, or viceversa.</p>
<p>As i  looked into lynda.com air tutorials: http://www.lynda.com/home/DisplayCourse.aspx?lpk2=596<br />
I learned that from an air application i can copy data items in the following formats text, bitmap, html text. Those formats work well if i paste the clipboard data to a non-air application such as copying bitmap data to fireworks.</p>
<p>Their tutorial explained the possibility to also disguise an instance of a custom class as a regular object, and use that datatype to paste it into another air application.</p>
<p>There are instances of classes in AIR which can be transparently copy and paste from one app to another such as the case of ArrayCollection.<br />
The secret behind is their classes implement IExternalizable.</p>
<p>Here is my first atttempt making use of accessing the copied data in clipboard as a simple object</p>
<p>//- my class</p>
<p>package model<br />
{<br />
public class Lifter<br />
{<br />
public static const FORMAT:String = &#8220;model.Lifter&#8221;;<br />
public var name:String;<br />
public var age:uint;<br />
public var weight:uint;</p>
<p>public function Lifter()<br />
{<br />
}</p>
<p>public function toString():String<br />
{<br />
return &#8220;Lifter[ " + this.name +", " + this.age + ", "+ this.weight + " ]&#8220;;<br />
}<br />
}<br />
}</p>
<p>//app A</p>
<p>var l:Lifter = new Lifter(  );<br />
l.name = &#8220;Juan&#8221;;<br />
l.age = 34;<br />
l.weight = 10;</p>
<p>var c:Clipboard = Clipboard.generalClipboard;<br />
c.clear();<br />
c.setData( Lifter.FORMAT, l  );</p>
<p>//app B</p>
<p>var c:Clipboard = Clipboard.generalClipboard;</p>
<p>if( c.hasFormat( Lifter.FORMAT ) )<br />
{<br />
var l:Object<br />
l = c.getData( Lifter.FORMAT ) as Object;<br />
trace( l.name  );<br />
}<br />
else<br />
{<br />
trace( &#8220;we are sorry format is not included.. &#8221; );<br />
}</p>
<p>The first attempted worked, but the data is no longer of type Lifter instead just a simple object.</p>
<p>Second attempt make the data in clipboard be copied an instance of type Lifter and be able to get the data back as of type Lifter.</p>
<p>I follow David Tucker&#8217;s advice of using registerClassAlias in both sides of the coin for the object to appear transparent as being of its class type. It is great to read his <a href="http://www.davidtucker.net/2008/02/08/air-tip-8-serializing-objects/" target="_blank">blog</a>, and helped me to have this example</p>
<p>Well, i had to make the changes to my Lifter class, implementing IExternalizable, in the adobe livedocs, they describe members of the class not being public but in my example i have my members public, in the same way as in David&#8217;s example.</p>
<p>package model<br />
{<br />
import flash.utils.IDataInput;<br />
import flash.utils.IDataOutput;<br />
import flash.utils.IExternalizable;</p>
<p>public class Lifter implements IExternalizable<br />
{<br />
public static const FORMAT:String = &#8220;model.Lifter&#8221;;<br />
public var name:String;<br />
public var age:uint;<br />
public var weight:uint;</p>
<p>//in my first attempt i set the members above as private, and set parameters in the constructor to assign them to the class<br />
//when i tried to get this instance from the clipboard, i had argument errors as i was missing those arguments.<br />
//best advice, make your constructor have no parameters, and you can set your members as private, and use setters and getters<br />
//to read and write to them.</p>
<p>public function Lifter(  )<br />
{<br />
}</p>
<p>public function toString():String<br />
{<br />
return &#8220;Lifter[ " + this.name +", " + this.age + ", "+ this.weight + " ]&#8220;;<br />
}</p>
<p>public function writeExternal(output:IDataOutput):void<br />
{</p>
<p>output.writeUTF( this.name );<br />
output.writeUnsignedInt( this.age );<br />
output.writeUnsignedInt( this.weight );<br />
}</p>
<p>public function readExternal(input:IDataInput):void<br />
{</p>
<p>this.name = input.readUTF();<br />
this.age = input.readUnsignedInt();<br />
this.weight = input.readUnsignedInt();<br />
}<br />
}<br />
}</p>
<p>//now here is my app A</p>
<p>var l:Lifter = new Lifter(  );<br />
l.name = &#8220;Juan&#8221;;<br />
l.age = 34;<br />
l.weight = 204;</p>
<p><strong>registerClassAlias( &#8220;Lifter&#8221;, Lifter );</strong></p>
<p>var c:Clipboard = Clipboard.generalClipboard;<br />
c.clear();<br />
c.setData( Lifter.FORMAT,  l );</p>
<p>//now here is my app B</p>
<p>var c:Clipboard = Clipboard.generalClipboard;<br />
<strong>registerClassAlias( &#8220;Lifter&#8221;, Lifter );</strong></p>
<p>if( c.hasFormat( Lifter.FORMAT ) )<br />
{</p>
<p>var l:Lifter;<br />
l = c.getData( Lifter.FORMAT, ClipboardTransferMode.CLONE_PREFERRED ) as Lifter;<br />
trace( l ); //output: Lifter[ Juan, 34, 10 ]<br />
}<br />
else<br />
{<br />
trace( &#8220;we are sorry format is not included.. &#8221; );<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/juandevelops.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/juandevelops.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/juandevelops.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/juandevelops.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/juandevelops.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/juandevelops.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/juandevelops.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/juandevelops.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/juandevelops.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/juandevelops.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/juandevelops.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/juandevelops.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/juandevelops.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/juandevelops.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=juandevelops.wordpress.com&amp;blog=4297035&amp;post=128&amp;subd=juandevelops&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://juandevelops.wordpress.com/2009/08/29/clipboard-set-and-get-data-from-a-custom-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/70e350ac6efda2d24690b9182070093d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">juandevelops</media:title>
		</media:content>
	</item>
	</channel>
</rss>
