<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3459153375291857548</id><updated>2011-08-01T17:40:54.806-07:00</updated><category term='FMS'/><category term='actionscript project'/><category term='width'/><category term='amfphp'/><category term='Initialize'/><category term='FormItem'/><category term='嘗試個體化非建構函式'/><category term='1007'/><category term='StyleManager'/><category term='Memory Leak'/><category term='Instantiation attempted on a non-constructor'/><category term='Modular'/><category term='SWF'/><category term='TypeError'/><category term='Flex Case Study'/><category term='validateNow()'/><category term='Module'/><category term='Cairngorm'/><category term='Scrollbar Position'/><category term='ImageProxy'/><category term='height'/><category term='Flex'/><category term='Error #1007'/><category term='Hang'/><category term='Flash Media Server'/><category term='Error'/><category term='Flex General'/><category term='FMS3'/><category term='DragManager'/><category term='Style'/><title type='text'>hk.lawfui - Camus's Flex Journal</title><subtitle type='html'>A Jounrnal records my Flex Learning Path</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-440344256269934511</id><published>2010-01-05T17:47:00.000-08:00</published><updated>2010-01-05T17:56:01.829-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Error'/><category scheme='http://www.blogger.com/atom/ns#' term='1007'/><category scheme='http://www.blogger.com/atom/ns#' term='嘗試個體化非建構函式'/><category scheme='http://www.blogger.com/atom/ns#' term='Instantiation attempted on a non-constructor'/><category scheme='http://www.blogger.com/atom/ns#' term='Error #1007'/><category scheme='http://www.blogger.com/atom/ns#' term='TypeError'/><title type='text'>Flash Embed getting "TypeError: Error #1007: Instantiation attempted on a non-constructor"</title><content type='html'>When use the actionscript developed in Flex, I got the following error:&lt;br /&gt;TypeError: Error #1007: Instantiation attempted on a non-constructor&lt;br /&gt;TypeError: Error #1007: 嘗試個體化非建構函式。&lt;br /&gt;&lt;br /&gt;Code as following:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package&lt;br /&gt;{&lt;br /&gt; import flash.display.MovieClip;&lt;br /&gt; &lt;br /&gt; public class SampleMovieClip extends MovieClip&lt;br /&gt; {&lt;br /&gt;   [Embed(source="main_visual.png")]&lt;br /&gt;  private var _bmp:Class;&lt;br /&gt;  &lt;br /&gt;  public function SampleMovieClip() : void&lt;br /&gt;  {&lt;br /&gt;   addChild(new _bmp());&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;It is because Flash Actionscript doesn't support Metadata "Embed", refer to following page for a solution:&lt;br /&gt;http://blog.wezside.co.za/2008/04/everything-embe.html&lt;br /&gt;&lt;br /&gt;Quick snippet:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;[Embed(source="as3_pages_source.swf", mimeType="application/octet-stream")]&lt;br /&gt;private var SWFBytes:Class;&lt;br /&gt;&lt;br /&gt;private var applicationDomain:ApplicationDomain;&lt;br /&gt;  &lt;br /&gt;private function init(event:Event=null):void&lt;br /&gt;{&lt;br /&gt; this.loadApplicationDomain();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function loadApplicationDomain():void&lt;br /&gt;{&lt;br /&gt; var loader:Loader = new Loader();&lt;br /&gt; loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderLoaded);&lt;br /&gt; try{&lt;br /&gt;  loader.loadBytes(new SWFBytes() as ByteArray);&lt;br /&gt; } catch (err:Error)&lt;br /&gt; {&lt;br /&gt;  loader.removeEventListener(Event.INIT, onLoaderLoaded);&lt;br /&gt;  trace(err + ", \nLawfui noted: [Embed] is not allowed in Flash IDE, loadApplicationDomain_SWF is used instead");&lt;br /&gt;  loadApplicationDomain_SWF("as3_pages_source.swf");&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function loadApplicationDomain_SWF(url:String):void&lt;br /&gt;{&lt;br /&gt; var loader:Loader = new Loader();&lt;br /&gt; loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderLoaded);&lt;br /&gt; loader.load(new URLRequest(url));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function initPageFlipCore():void&lt;br /&gt;{&lt;br /&gt; core = new PageFlipCore( this.applicationDomain );&lt;br /&gt; core.x = 200;&lt;br /&gt; core.y += 150;&lt;br /&gt;     &lt;br /&gt; this.addChild(core);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onLoaderLoaded(event:Event):void&lt;br /&gt;{&lt;br /&gt; var loaderInfo:LoaderInfo = event.currentTarget as LoaderInfo;&lt;br /&gt; applicationDomain = loaderInfo.applicationDomain;&lt;br /&gt; initPageFlipCore();&lt;br /&gt; return;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-440344256269934511?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/440344256269934511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=440344256269934511' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/440344256269934511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/440344256269934511'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2010/01/flash-embed-getting-typeerror-error.html' title='Flash Embed getting &quot;TypeError: Error #1007: Instantiation attempted on a non-constructor&quot;'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-7545746953035079401</id><published>2010-01-05T17:22:00.000-08:00</published><updated>2010-01-05T17:46:54.923-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SWF'/><category scheme='http://www.blogger.com/atom/ns#' term='width'/><category scheme='http://www.blogger.com/atom/ns#' term='height'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript project'/><title type='text'>Starting a actionscript project with width and height set</title><content type='html'>When using Flex for a Actionscript project development, I always run into a situation that the testing movie doesn't have a prefered size, even I set the mc.width and mc.height in the script.&lt;br /&gt;&lt;br /&gt;The following is the solution:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;package&lt;br /&gt;{&lt;br /&gt;import flash.display.MovieClip;&lt;br /&gt;&lt;br /&gt;  [SWF(width="1000", height="628", backgroundColor="0x000000", frameRate="30")]&lt;br /&gt;  public class SampleMovieClip extends MovieClip&lt;br /&gt;  {&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-7545746953035079401?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/7545746953035079401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=7545746953035079401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/7545746953035079401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/7545746953035079401'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2010/01/starting-actionscript-project-with.html' title='Starting a actionscript project with width and height set'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-632391841705985264</id><published>2009-04-02T02:44:00.000-07:00</published><updated>2009-04-02T02:49:10.069-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='amfphp'/><title type='text'>Some find tunes for the amfphp settings</title><content type='html'>Trying to figure out how to sending/receiving strongly typed objects between ActionScript and AMFPHP&lt;br /&gt;&lt;br /&gt;some find tunes needed in the following files:&lt;br /&gt;&lt;br /&gt;globals.php&lt;br /&gt;&lt;code&gt;$voPath = "services/vo";&lt;br /&gt;$servicesPath = "services/";&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;gateway.php&lt;br /&gt;&lt;code&gt;$gateway-&gt;setCharsetHandler("utf8_decode", "UTF-8", "UTF-8"); &lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-632391841705985264?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/632391841705985264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=632391841705985264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/632391841705985264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/632391841705985264'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2009/04/some-find-tunes-for-amfphp-settings.html' title='Some find tunes for the amfphp settings'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-6300103519533511902</id><published>2008-04-17T01:03:00.000-07:00</published><updated>2008-04-17T01:08:06.810-07:00</updated><title type='text'>Rendering Performance</title><content type='html'>I like to set the props / layout of the component/application by overriding updateDisplayList();&lt;br /&gt;&lt;br /&gt;However, I experience a drop of rendering speed in Flex application when the application is developed into a larger size. And I discover that the key issue was using "setStyle" everytime when the updateDisplayList() is executed.&lt;br /&gt;&lt;br /&gt;Actually the setStyle just need to apply once after the application is initialized. So the problem can be solved after I added _init flag into the application and run the setStyle procedures only if the _init is true...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-6300103519533511902?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/6300103519533511902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=6300103519533511902' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/6300103519533511902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/6300103519533511902'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2008/04/rendering-performance.html' title='Rendering Performance'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-2185172472288123831</id><published>2008-04-14T02:52:00.000-07:00</published><updated>2008-04-14T02:57:37.768-07:00</updated><title type='text'>wmode on Firefox</title><content type='html'>when u set wmode in html, and the page is opened in Firefox, it will mess up your special chars input such as Chinese / German or whatever... so lame...&lt;br /&gt;&lt;br /&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=347185"&gt;https://bugzilla.mozilla.org/show_bug.cgi?id=347185&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://bugs.adobe.com/jira/browse/SDK-12420"&gt;https://bugs.adobe.com/jira/browse/SDK-12420&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.google.com/search?hl=zh-TW&amp;amp;rls=com.microsoft%3Azh-hk%3AIE-SearchBox&amp;amp;rlz=1I7GZAZ&amp;amp;q=firefox+wmode+bug&amp;amp;lr"&gt;http://www.google.com/search?hl=zh-TW&amp;amp;rls=com.microsoft%3Azh-hk%3AIE-SearchBox&amp;amp;rlz=1I7GZAZ&amp;amp;q=firefox+wmode+bug&amp;amp;lr&lt;/a&gt;=&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-2185172472288123831?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/2185172472288123831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=2185172472288123831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/2185172472288123831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/2185172472288123831'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2008/04/wmode-on-firefox.html' title='wmode on Firefox'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-1268568226137230864</id><published>2008-02-27T00:23:00.000-08:00</published><updated>2008-02-27T00:27:04.363-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cairngorm'/><category scheme='http://www.blogger.com/atom/ns#' term='Modular'/><category scheme='http://www.blogger.com/atom/ns#' term='Module'/><title type='text'>Cairngorm + Modules</title><content type='html'>There are a few notes to take care:&lt;br /&gt;&lt;br /&gt;1) For Singleton Class like DragManager which holds data, it is better to put in ApplicationDomain as RSL.&lt;br /&gt;&lt;br /&gt;2) While using Modules, the modulesInfo needs a differnet ID even the class is the same, i.e. new another ModuleInfo even the source is the same.&lt;br /&gt;&lt;br /&gt;3) The "Modular" Package is adopted.&lt;br /&gt;&lt;br /&gt;For now I didn't get ServiceLocator to work as I want. Will think of adopting the Prana framework anyway. We'll see.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-1268568226137230864?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/1268568226137230864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=1268568226137230864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/1268568226137230864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/1268568226137230864'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2008/02/cairngorm-modules.html' title='Cairngorm + Modules'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-7630540514865233562</id><published>2008-02-19T20:35:00.000-08:00</published><updated>2008-02-19T20:42:55.829-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FMS'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash Media Server'/><category scheme='http://www.blogger.com/atom/ns#' term='FMS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Module'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Modular Programming</title><content type='html'>Stopped flex programming for like 2 months, I am return finally.&lt;br /&gt;&lt;br /&gt;Well... I stopped the latest development of Flex Project: [Bast] becuz I found out the file size and codes will go eventually too large for the applicant to be efficient and fluent. I was thinking about making some component as smaller part application and load it into main application container whenever it is needed. But never figure it out... and finally I get to read part of the Modular Programming notes.&lt;br /&gt;&lt;br /&gt;And I plan to try out the following:&lt;br /&gt;1) Program modules &lt;-- can apply framework&lt;br /&gt;2) Link the Progress event against preloader of DisplayObjectContainer or ProgressBar Control&lt;br /&gt;&lt;br /&gt;Just a simple concept, let's see if it works or not.&lt;br /&gt;&lt;br /&gt;On the other hand, I participated in Adobe FMS3 seminar this week, seems the price of FMS3 is kinda cheap nowadays.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-7630540514865233562?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/7630540514865233562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=7630540514865233562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/7630540514865233562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/7630540514865233562'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2008/02/modular-programming.html' title='Modular Programming'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-2483048243779314385</id><published>2007-11-28T01:11:00.000-08:00</published><updated>2007-11-28T01:12:29.204-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hang'/><category scheme='http://www.blogger.com/atom/ns#' term='FormItem'/><title type='text'>Set width &amp; height in FormItem cause system freeze</title><content type='html'>&lt;a href="https://bugs.adobe.com/jira/browse/SDK-13527"&gt;https://bugs.adobe.com/jira/browse/SDK-13527&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-2483048243779314385?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/2483048243779314385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=2483048243779314385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/2483048243779314385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/2483048243779314385'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2007/11/set-width-height-in-formitem-cause.html' title='Set width &amp; height in FormItem cause system freeze'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-8529932912253354497</id><published>2007-11-07T18:29:00.001-08:00</published><updated>2007-11-07T18:31:23.655-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Style'/><category scheme='http://www.blogger.com/atom/ns#' term='Initialize'/><title type='text'>Use customize Style when initializing the app</title><content type='html'>&lt;span style="font-family:verdana;font-size:85%;"&gt;I read this somewhere, if you want to use your own style while the app is initializing, you need to use initialize='onInitialize()'; when the application is initializing...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-8529932912253354497?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/8529932912253354497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=8529932912253354497' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/8529932912253354497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/8529932912253354497'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2007/11/use-customize-style-when-initializing.html' title='Use customize Style when initializing the app'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-1283757973904653199</id><published>2007-11-06T19:29:00.000-08:00</published><updated>2007-11-06T19:35:22.738-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='StyleManager'/><title type='text'>Make sure your CSS stylesheet is loaded before using measureWidth</title><content type='html'>&lt;span style="font-family:verdana;font-size:85%;"&gt;I ran into a situation that when I apply a style class and need to retrieve the measuredWidth or textWidth for calculating component's properties.&lt;br /&gt;&lt;br /&gt;I figured out we need to use validateNow(); to update the component's properties.&lt;br /&gt;However, somehow the figures are kinda different on same component.&lt;br /&gt;&lt;br /&gt;When I look close at the debugger, I found this line which is suspective:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Execute event: [Event type="&lt;loadtagxmlevent&gt;" bubbles=false cancelable=false eventPhase=2]&lt;br /&gt;animals: 57,26&lt;br /&gt;[SWF] assets\css\main.swf - 3,196,972 bytes after decompression&lt;br /&gt;Execute event: [Event type="&lt;loadtagxmlevent&gt;" bubbles=false cancelable=false eventPhase=2]&lt;br /&gt;animals: 73,28&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;I found that the Style sheet are not loaded before I moved to next step for checking measuredWidth, and here is the official solution:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;var myEvent:IEventDispatcher =&lt;br /&gt;StyleManager.loadStyleDeclarations('assets/css/main.swf');&lt;br /&gt;myEvent.addEventListener(StyleEvent.COMPLETE, onLoadComplete);&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-1283757973904653199?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/1283757973904653199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=1283757973904653199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/1283757973904653199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/1283757973904653199'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2007/11/make-sure-your-css-stylesheet-is-loaded.html' title='Make sure your CSS stylesheet is loaded before using measureWidth'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-4950651482792399885</id><published>2007-10-26T01:38:00.000-07:00</published><updated>2007-10-26T01:51:04.939-07:00</updated><title type='text'>A filed weird behaviour - The component doesn't render correctly after adding to Stage</title><content type='html'>Apart from sharing Flex Programming experience, this blog also serve as a record or notes for some weird scenerios...&lt;br /&gt;&lt;br /&gt;There were once I working on a slide show project. Basically a container is moving along the y-axis and thumbnails are adding dynimatically to the container. But somehow the thumbnails are not rendered on screen. The codes are executed as I debug'd them and does show the lines.&lt;br /&gt;&lt;br /&gt;The thumbnails show up if I stopped the moving container. This is weird to me.&lt;br /&gt;&lt;br /&gt;Finally, I found a dirty solution, i.e. add the thumbnails container to rawChildren.&lt;br /&gt;&lt;br /&gt;It seems the issue is related to the render sequence of rendering...&lt;br /&gt;e.g. Initialize component -&gt; set properties -&gt; updateDisplayList -&gt; commitProperties and so on...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-4950651482792399885?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/4950651482792399885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=4950651482792399885' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/4950651482792399885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/4950651482792399885'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2007/10/filed-weird-behaviour-component-doesnt.html' title='A filed weird behaviour - The component doesn&apos;t render correctly after adding to Stage'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-3610510051429543342</id><published>2007-10-17T02:07:00.000-07:00</published><updated>2007-10-17T02:12:40.415-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scrollbar Position'/><category scheme='http://www.blogger.com/atom/ns#' term='validateNow()'/><title type='text'>Set the verticalScrollPosition</title><content type='html'>&lt;span style="font-family:verdana;font-size:85%;"&gt;Sometimes we want to set the scrollerbar position by actionscript, that can be easily achieved by:&lt;/span&gt;&lt;br /&gt;&lt;code&gt;verticalScrollPosition = maxVerticalScrollPosition;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;however, this won't work right after we added some childs to a container.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;The flash player need to refresh the changes in order to calculate the right position.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;To move to the right position, you may try this:&lt;/span&gt;&lt;br /&gt;&lt;code&gt;validateNow();&lt;br /&gt;verticalScrollPosition = maxVerticalScrollPosition;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-3610510051429543342?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/3610510051429543342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=3610510051429543342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/3610510051429543342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/3610510051429543342'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2007/10/set-verticalscrollposition.html' title='Set the verticalScrollPosition'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-5075771254959715579</id><published>2007-10-16T02:36:00.000-07:00</published><updated>2007-10-16T02:53:58.221-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DragManager'/><category scheme='http://www.blogger.com/atom/ns#' term='ImageProxy'/><title type='text'>Add Listeners to ImageProxy used in mx.managers.DragManager</title><content type='html'>&lt;span style="font-family:verdana;font-size:85%;"&gt;Ran into another problem on my "Houngan" Project.&lt;br /&gt;&lt;br /&gt;I want to drag an Image using DragManager.&lt;br /&gt;And I applied imageProxy in the doDrag function and it works fine.&lt;br /&gt;&lt;br /&gt;However, I want to hide the original image, which remains at the position it located, when I dragging the imageProxy.&lt;br /&gt;So I tried the following steps: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;ol&gt;&lt;li&gt;click on the original image, broadcast mouse down event &lt;/li&gt;&lt;li&gt;execute the onMouseDown function, hide the image. &lt;/li&gt;&lt;li&gt;make an imageProxy &lt;/li&gt;&lt;li&gt;&lt;div align="left"&gt;execute DragManager.doDrag function and move the imageProxy by following&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;code&gt;DragManager.doDrag(initiator, ds, event, imageProxy, 0, 0, 1, true);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Yes I can hide the original image and drag the imageProxy, but the release of imageProxy doesn't resume the original image's visible stage. There is no event broadcasted from DragManager on this as far as I know. (Please kindly tell me if you do know one ^^)&lt;br /&gt;&lt;br /&gt;I went over the source code of DragManager and discover there is a imageProxy variable in DragManagerImpl.as&lt;br /&gt;And whenever endDrag is called, the imageProxy is removed from the parent container. So there is a way: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;ol&gt;&lt;li&gt;click on the original image, broadcast mouse down event &lt;/li&gt;&lt;li&gt;execute the onMouseDown function, hide the image. &lt;/li&gt;&lt;li&gt;make an imageProxy and add event listener to it for the Event.REMOVED event. &lt;/li&gt;&lt;li&gt;execute DragManager.doDrag function &lt;/li&gt;&lt;li&gt;execute listener handler when Event.REMOVED is detected from imageProxy. &lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;So that's the trick =) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-5075771254959715579?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/5075771254959715579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=5075771254959715579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/5075771254959715579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/5075771254959715579'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2007/10/ran-into-another-problem-on-my-houngan.html' title='Add Listeners to ImageProxy used in mx.managers.DragManager'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-5931955431357677277</id><published>2007-10-12T00:02:00.000-07:00</published><updated>2007-10-12T00:27:46.928-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flex Case Study'/><category scheme='http://www.blogger.com/atom/ns#' term='Memory Leak'/><title type='text'>Memory Leak in Flex</title><content type='html'>&lt;span style="font-family:verdana;font-size:85%;"&gt;Here comes my first case study: Memory leak by using Bitmap &amp;amp; BitmapData.&lt;br /&gt;&lt;br /&gt;Currently I cope with a project which need to load external JPEGs into Flex and forming BitmapData objects. I will do some operations on the BitmapData, then put it into the Application.&lt;br /&gt;&lt;br /&gt;During the application runtime, I will remove those bitmap display objects, but I discover the garbage collection doesn't really release memory from the application, so there is a memory leak. (The memory used up to 350M after I afk 30mins)&lt;br /&gt;&lt;br /&gt;I study gskinner's &lt;/span&gt;&lt;a href="http://www.gskinner.com/blog/archives/2006/07/as3_resource_ma_1.html"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;AS3: Resource Management pt 2&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;, and carry out some test as following: &lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;private function onBitmapLoadComplete(event:Event):void&lt;br /&gt;{&lt;br /&gt;var bitmapDataProxy:BitmapDataProxy = event.currentTarget as BitmapDataProxy;&lt;br /&gt;bitmapDataProxy.removeEventListener(BitmapDataProxy.LOAD_COMPLETE, onBitmapLoadComplete);&lt;br /&gt;&lt;br /&gt;var bitmap:Bitmap = new Bitmap(bitmapDataProxy.result.clone(), "auto", true);&lt;br /&gt;&lt;br /&gt;var bitmapContainer:UIComponent = new UIComponent();&lt;br /&gt;bitmapContainer.addEventListener(MouseEvent.CLICK, onMouseClick, false, 0, true);&lt;br /&gt;bitmapContainer.addChild(bitmap);&lt;br /&gt;this.addChild(bitmapContainer);&lt;br /&gt;&lt;br /&gt;bitmapDataProxy.destroy();&lt;br /&gt;bitmapDataProxy = null;&lt;br /&gt;bitmap = null;&lt;br /&gt;bitmapContainer = null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onMouseClick(event:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;var bitmapContainer:UIComponent = event.currentTarget as UIComponent;&lt;br /&gt;bitmapContainer.removeEventListener(MouseEvent.CLICK, onMouseClick);&lt;br /&gt;&lt;br /&gt;bitmap.bitmapData.dispose();&lt;br /&gt;this.removeChild(bitmapContainer);&lt;br /&gt;bitmapContainer = null;&lt;br /&gt;&lt;br /&gt;bitmap=null;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Checked with Flex Profiler, the Memory usage up to 4279k at the loading of BitmapDataProxy.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;After the loading is complete, I have trashed the BitmapDataProxy after putting the BitmapData into a Bitmap. This can be observed by observed used memory dropped to 1666k after I press the garbage collection button in Profiler. However, weird stuff came...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;After I clicked on the image and removing the child. The used memory doesn't further drop down. And by observing Loitering Objects, I see there are still a bitmap object and BitmapData in the memory. So probably I can't clear it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;By further test, I found that The BitmapData left in memory is referring to the property of Bitmap, i.e. Bitmap.bitmapData. I have clear it, but I need to remove the reference in order to release the counter of reference to the object in memory.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;By adding the code, I further dropped the used memory to 1141k. And there are no more BitmapData instance in the memory. but there is still one Bitmap instance. so I guess the removeChild doesn't really remove all the childs in the Display List.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;bitmap.bitmapData.dispose();&lt;br /&gt;bitmap.bitmapData = null;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Finally I added following code to remove the unused Bitmap instance:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;bitmapContainer.removeChild(bitmap);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;I finally can remove all the Memory Leakage problem in this little revising practice. I think there are much more to go over my Album Project, with project coded "Houngan". &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Uhmmm, at least I see hope through this practice. And wish it helps you too.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;The Finalized code as following:&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;private function onBitmapLoadComplete(event:Event):void&lt;br /&gt;{&lt;br /&gt;var bitmapDataProxy:BitmapDataProxy = event.currentTarget as BitmapDataProxy;&lt;br /&gt;bitmapDataProxy.removeEventListener(BitmapDataProxy.LOAD_COMPLETE, onBitmapLoadComplete);&lt;br /&gt;&lt;br /&gt;var bitmap:Bitmap = new Bitmap(null, "auto", true);&lt;br /&gt;bitmap.bitmapData = bitmapDataProxy.result.clone();&lt;br /&gt;&lt;br /&gt;var bitmapContainer:UIComponent = new UIComponent();&lt;br /&gt;bitmapContainer.addEventListener(MouseEvent.CLICK, onMouseClick);//, false, 0, true);&lt;br /&gt;bitmapContainer.addChild(bitmap);&lt;br /&gt;this.addChild(bitmapContainer);&lt;br /&gt;&lt;br /&gt;bitmapDataProxy.destroy();&lt;br /&gt;bitmapDataProxy = null;&lt;br /&gt;bitmap = null;&lt;br /&gt;bitmapContainer = null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onMouseClick(event:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;var bitmapContainer:UIComponent = event.currentTarget as UIComponent;&lt;br /&gt;bitmapContainer.removeEventListener(MouseEvent.CLICK, onMouseClick);&lt;br /&gt;&lt;br /&gt;var bitmap:Bitmap = bitmapContainer.getChildAt(0) as Bitmap;&lt;br /&gt;&lt;br /&gt;bitmap.bitmapData.dispose();&lt;br /&gt;bitmap.bitmapData = null;&lt;br /&gt;&lt;br /&gt;bitmapContainer.removeChild(bitmap);&lt;br /&gt;&lt;br /&gt;this.removeChild(bitmapContainer);&lt;br /&gt;bitmapContainer = null;&lt;br /&gt;&lt;br /&gt;bitmap=null;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-5931955431357677277?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/5931955431357677277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=5931955431357677277' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/5931955431357677277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/5931955431357677277'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2007/10/memory-leak-in-flex_12.html' title='Memory Leak in Flex'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3459153375291857548.post-1316247659138525734</id><published>2007-10-11T01:56:00.000-07:00</published><updated>2007-10-11T09:29:16.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flex General'/><title type='text'>Finally ... my first post!</title><content type='html'>&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Hi all, I decided to register an account and make it up finally.&lt;br /&gt;The purpose of this blog is to record my Flex Learning Career, and share some of the experiences.&lt;br /&gt;&lt;br /&gt;I am a Multimedia Engineer and the company I worked starting to adopt Adobe Flex as the solution against various projects.&lt;br /&gt;&lt;br /&gt;Personally I start to study Adobe Flex when it is released at beta 2.0, and wrote some stock quoting program. The functions are simple but still somehow I feel good with it.&lt;br /&gt;&lt;br /&gt;When I go deeper with it, I started to find there are many problems to deploy corporate-wise solutions with Flex. So I started to study Cairngorm, which is a Micro Architecture Programming Framework initialized by Steven Webster and his colleagues.&lt;br /&gt;&lt;br /&gt;The Cairngorm improved my production speed a lot, with the help of Cairngen...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;I found that there are many place a Flex Engineer need to be careful, for example, memory leak, which may continously consume the resource of client's computer and eventually hang user's computer. I will post more in the coming days.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;haha... Got to go for lesson, bye~&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;//testing of posting code&lt;br /&gt;var foo:Object = new Object();&lt;br /&gt;foo.name = 'camus';&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3459153375291857548-1316247659138525734?l=camusmiu.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camusmiu.blogspot.com/feeds/1316247659138525734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3459153375291857548&amp;postID=1316247659138525734' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/1316247659138525734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3459153375291857548/posts/default/1316247659138525734'/><link rel='alternate' type='text/html' href='http://camusmiu.blogspot.com/2007/10/finally-my-first-post.html' title='Finally ... my first post!'/><author><name>妙</name><uri>http://www.blogger.com/profile/03203154926100509425</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/__BorL_HZEfo/SdSI7AOtQPI/AAAAAAAAAAU/5XbbbU2DC-I/S220/DSCN6195m3.jpg'/></author><thr:total>1</thr:total></entry></feed>
