<?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:blogger='http://schemas.google.com/blogger/2008' 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-748348560604106246</id><updated>2024-09-08T15:21:30.093+05:30</updated><category term="ActionScript 3.0"/><category term="Flex"/><category term="Design Pattern"/><category term="Flash Player"/><category term="Flex Builder"/><category term="PureMVC"/><title type='text'>Gaurav Manoj Patel</title><subtitle type='html'>on Web Technologies, Adobe Flash Platform, Design Pattern, India…</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-3854895965332895357</id><published>2011-09-10T15:52:00.000+05:30</published><updated>2011-09-10T15:52:04.830+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><title type='text'>Flex :: Metadata tag - Event</title><content type='html'>&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;p&gt;The &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;0x0000FF&quot;&gt;Event&lt;/font&gt;]&lt;/font&gt; metadata tag is used to define the MXML property for an event and the data type of the event object that a component dispatches.&lt;/p&gt;&lt;p&gt;Following is the syntax for &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;0x0000FF&quot;&gt;Event&lt;/font&gt;]&lt;/font&gt; metadata tag&lt;/p&gt;&lt;table width=&quot;100%&quot; cellpadding=&quot;2&quot;&gt;&lt;tr bgcolor=&quot;#CCCCCC&quot;&gt;&lt;td&gt;&lt;font face=&quot;courier new&quot; color=&quot;0x000000&quot;&gt;[&lt;font color=&quot;0x0000FF&quot;&gt;Event&lt;/font&gt;(name=&quot;&lt;b&gt;eventName&lt;/b&gt;&quot;, type=&quot;&lt;b&gt;package.eventType&lt;/b&gt;&quot;)]&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;name property of metadata tag specifies the name of the event only.&lt;br /&gt;
type property of metadata tag specifies the class that defines the event including entire package.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;0x0000FF&quot;&gt;Event&lt;/font&gt;]&lt;/font&gt; metadata tag is inserted before class defination in an Action Script file or in &lt;font face=&quot;courier new&quot;&gt;&amp;lt;mx:Metadata&amp;gt;&lt;/font&gt; block ina n MXML file.&lt;/p&gt;&lt;p&gt;If the event is not identify using type and name property defined in &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;0x0000FF&quot;&gt;Event&lt;/font&gt;]&lt;/font&gt; metadata tag then MXML compiler generates an error.&lt;/p&gt;&lt;p&gt;Following is an example:&lt;br /&gt;
&lt;br /&gt;
ActionScript Class&lt;br /&gt;
&lt;table width=&quot;100%&quot; cellpadding=&quot;2&quot;&gt;&lt;tr bgcolor=&quot;#CCCCCC&quot;&gt;&lt;td&gt;&lt;font face=&quot;courier new&quot; color=&quot;0x000000&quot;&gt;[&lt;font color=&quot;0x0000FF&quot;&gt;Event&lt;/font&gt;(name=&quot;&lt;b&gt;custom_event&lt;/b&gt;&quot;, type=&quot;&lt;b&gt;myPackage.events&lt;/b&gt;&quot;)]&lt;br /&gt;
&lt;font color=&quot;0x0000FF&quot;&gt;public&lt;/font&gt; &lt;font color=&quot;0xFF0000&quot;&gt;class&lt;/font&gt; MyClass &lt;font color=&quot;0x0000FF&quot;&gt;extends UIComponent&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
}&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
MXML Document&lt;br /&gt;
&lt;br /&gt;
&lt;table width=&quot;100%&quot; cellpadding=&quot;2&quot;&gt;&lt;tr bgcolor=&quot;#CCCCCC&quot;&gt;&lt;td&gt;&lt;font face=&quot;courier new&quot; color=&quot;0x000000&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;mx:Canvas xmlns:mx=&amp;quot;http://www.adobe.com/2006/mxml&amp;quot;&amp;gt;&lt;/br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mx:Metadata&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;font color=&quot;0x0000FF&quot;&gt;Event&lt;/font&gt;(name=&quot;&lt;b&gt;custom_event&lt;/b&gt;&quot;, type=&quot;&lt;b&gt;myPackage.events&lt;/b&gt;&quot;)]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/mx:Metadata&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;lt;/mx:Canvas&amp;gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/3854895965332895357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2011/09/flex-metadata-tag-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/3854895965332895357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/3854895965332895357'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2011/09/flex-metadata-tag-event.html' title='Flex :: Metadata tag - Event'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-9051882991694713754</id><published>2011-09-05T22:51:00.002+05:30</published><updated>2011-09-05T22:53:32.276+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><title type='text'>Flex :: Metadata tag - Deprecated</title><content type='html'>&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;p&gt;The &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Deprecated&lt;/font&gt;]&lt;/font&gt; metadata tag marks class or class elements deprecated so that the compiler can recognize it and issue a warning when the element is used in an application.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Deprecated&lt;/font&gt;]&lt;/font&gt; metadata tag syntax is as follow&lt;/p&gt;&lt;table bgcolor=#CCCCCC width=&quot;100%&quot;&gt;&lt;tr &gt; &lt;td&gt;&lt;font face=&quot;courier new&quot; color=&quot;#000000&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Deprecated&lt;/font&gt;(&lt;font face=&quot;verdana&quot;&gt;&quot;&lt;b&gt;string_describing_deprecation&lt;/b&gt;&quot;&lt;/font&gt;)]&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;courier new&quot; color=&quot;#000000&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Deprecated&lt;/font&gt;(message=&lt;font face=&quot;verdana&quot;&gt;&quot;&lt;b&gt;string_describing_deprecation&lt;/b&gt;&quot;&lt;/font&gt;)]&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;courier new&quot; color=&quot;#000000&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Deprecated&lt;/font&gt;(replacement=&lt;font face=&quot;verdana&quot;&gt;&quot;&lt;b&gt;string_specifying_replaceent&lt;/b&gt;&quot;&lt;/font&gt;)]&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;courier new&quot; color=&quot;#000000&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Deprecated&lt;/font&gt;(replacement=&lt;font face=&quot;verdana&quot;&gt;&quot;&lt;b&gt;string_specifying_replaceent&lt;/b&gt;&quot;&lt;/font&gt;, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;since=&lt;font face=&quot;verdana&quot;&gt;&quot;&lt;b&gt;version_of_replacement&lt;/b&gt;&quot;&lt;/font&gt;)]&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;Insert the &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Deprecated&lt;/font&gt;]&lt;/font&gt; metadata tag before a property, method or class definition to mark that element as deprecated. &lt;/p&gt;&lt;table bgcolor=#CCCCCC width=&quot;100%&quot;&gt;&lt;tr&gt; &lt;td&gt;&lt;font face=&quot;courier new&quot; color=&quot;#000000&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Deprecated&lt;/font&gt;(replacement=&quot;mycomponent.label&quot;)]&lt;br /&gt;
&lt;font color=&quot;#0000FF&quot;&gt;public&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;function&lt;/font&gt; &lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt; text( val:&lt;font color=&quot;#0000FF&quot;&gt;String&lt;/font&gt; ):&lt;font color=&quot;#0000FF&quot;&gt;void&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
}&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;The &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Event&lt;/font&gt;]&lt;/font&gt;, &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Effect&lt;/font&gt;]&lt;/font&gt; and &lt;font face=&quot;courier new&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Style&lt;/font&gt;]&lt;/font&gt; metadata tag also support deprecation.&lt;br /&gt;
These metadata tags support the &lt;font face=&quot;courier new&quot;&gt;deprecatedReplacement&lt;/font&gt;, &lt;font face=&quot;courier new&quot;&gt;deprecatedSince&lt;/font&gt; and &lt;font face=&quot;courier new&quot;&gt;deprecatedMessage&lt;/font&gt; attributes to mark event, effect and style as deprecated.&lt;/p&gt;&lt;table bgcolor=#CCCCCC width=&quot;100%&quot;&gt;&lt;tr&gt; &lt;td&gt;&lt;font face=&quot;courier new&quot; color=&quot;#000000&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Event&lt;/font&gt;(... , deprecatedReplacement=&quot;&lt;b&gt;string_specifying_replacement&lt;/b&gt;&quot;, &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;deprecatedSince=&quot;&lt;b&gt;version_of_replacement&lt;/b&gt;&quot; )]&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: For a command line compiler use &lt;font face=&quot;courier new&quot;&gt;show-deprecation-warnings&lt;/font&gt; option and set it to &lt;font face=&quot;courier new&quot;&gt;true&lt;/font&gt;.&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/9051882991694713754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2011/09/flex-metadata-tag-deprecated.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/9051882991694713754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/9051882991694713754'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2011/09/flex-metadata-tag-deprecated.html' title='Flex :: Metadata tag - Deprecated'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-5207632966520090067</id><published>2011-09-03T18:43:00.000+05:30</published><updated>2011-09-03T18:43:31.291+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><title type='text'>Flex :: Metadata tag - Bindable</title><content type='html'>&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;The &lt;font face=&quot;Courier New&quot; &gt;[Bindable]&lt;/font&gt; metadata tag enables Flex to copy the value of source property to any destination property, when any changes are made to source property.&lt;br /&gt;
&lt;p&gt;The &lt;font face=&quot;Courier New&quot; &gt;[Bindable]&lt;/font&gt; metadata tag has following syntax:&lt;/p&gt;&lt;table width=&quot;100%&quot; cellpadding=&quot;2&quot;&gt;&lt;tr bgcolor=&quot;#CCCCCC&quot;&gt; &lt;td&gt;&lt;font face=&quot;Courier New, Courier, monospace&quot; color=&quot;#000000&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;Bindable&lt;/font&gt;]&lt;br /&gt;
[&lt;font color=&quot;#0000FF&quot;&gt;Bindable&lt;/font&gt; (&quot;&lt;b&gt;&lt;font color=&quot;#FF9900&quot;&gt;eventName&lt;/font&gt;&lt;/b&gt;&quot;)]&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;[Bindable (&quot;&lt;b&gt;eventName&lt;/b&gt;&quot;)]&lt;/font&gt; metadata tag register the source property with Flex and dispatches event &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;eventName&lt;/font&gt; when property is changed. If &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;eventName&lt;/font&gt; is omitted, Flex automatically creates an event named &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;propertyChange&lt;/font&gt; so that the property can be used as the source of a data binding expression&lt;/p&gt;&lt;p&gt;Example: &lt;/p&gt;&lt;table width=&quot;100%&quot; cellpadding=&quot;2&quot;&gt;&lt;tr bgcolor=&quot;#CCCCCC&quot;&gt; &lt;td&gt;&lt;font face=&quot;Courier New, Courier, monospace&quot; color=&quot;#000000&quot;&gt;&lt;br /&gt;
[&lt;font color=&quot;#0000FF&quot;&gt;Bindable&lt;/font&gt;]&lt;br /&gt;
&lt;font color=&quot;#FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;#0000FF&quot;&gt;var&lt;/font&gt; audioLevel:&lt;font color=&quot;#0000FF&quot;&gt;uint&lt;/font&gt; = 50;&lt;br /&gt;
&lt;br /&gt;
[&lt;font color=&quot;#0000FF&quot;&gt;Bindable&lt;/font&gt; (&quot;&lt;b&gt;&lt;font color=&quot;#FF9900&quot;&gt;nameChanged&lt;/font&gt;&lt;/b&gt;&quot;)]&lt;br /&gt;
&lt;font color=&quot;#FF0000&quot;&gt;public function &lt;/font&gt;&lt;font color=&quot;#0000FF&quot;&gt;get&lt;/font&gt; name():&lt;font color=&quot;#0000FF&quot;&gt;String&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#FF0000&quot;&gt;return&lt;/font&gt; myName;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#FF0000&quot;&gt;public function &lt;/font&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt; name( val:&lt;font color=&quot;#0000FF&quot;&gt;String&lt;/font&gt; ):&lt;font color=&quot;#0000FF&quot;&gt;void&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;myName = val;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#0000FF&quot;&gt;dispatchEvent&lt;/font&gt;(&lt;font color=&quot;#FF0000&quot;&gt;new&lt;/font&gt; &lt;font color=&quot;#0000FF&quot;&gt;Event&lt;/font&gt;( &quot;nameChanged&quot; ) );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;There are some situation where data binding does not execute automatically&lt;/p&gt;&lt;ul&gt;&lt;li&gt;When an item of &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;dataprovider&lt;/font&gt; is modified.&lt;/li&gt;
&lt;li&gt;When a sub-property of a property that have &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;[Bindable]&lt;/font&gt; metadata tag is modified.&lt;/li&gt;
&lt;li&gt;When a &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;[Bindable]&lt;/font&gt; metadata tag is associated with a property that Flash player updates automatically, such as &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;mouseY&lt;/font&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;There are some method that helps to execute binding that do not occur as expected.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;executeBindings()&lt;/font&gt; method of UIComponent class helps to execute all the binding for which UIComponent is destinated.&lt;/li&gt;
&lt;li&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;executeChildBindings()&lt;/font&gt; method of Container and Repeater classes of Flex executes all the binding for which child UIComponent of Container or Repeater class are destinated.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;executeChildBindings()&lt;/font&gt; method updates user interface after making changes that does not cause binding to execute.&lt;/p&gt;&lt;p&gt;However, it should be noted that above method should be called only when binding do not executed automatically.&lt;/p&gt;&lt;br&gt;&lt;br /&gt;
&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/5207632966520090067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2011/08/flex-metadata-tag-bindable.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/5207632966520090067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/5207632966520090067'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2011/08/flex-metadata-tag-bindable.html' title='Flex :: Metadata tag - Bindable'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-5808862756769413334</id><published>2011-09-02T11:46:00.000+05:30</published><updated>2011-09-02T11:46:51.869+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><title type='text'>Flex :: Metadata tag  - Array Element Type</title><content type='html'>&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;p&gt;In ActionScript language whenever we define an Array variable, we never specify data type of elements that Array will hold.&lt;/p&gt;&lt;p&gt;To allow Flex compiler to perform type checking on Array elements, we can use &lt;font face=&quot;Courier New, Courier&quot;&gt;[ArrayElementType]&lt;/font&gt; metadata tag. This metadata tag allow us to specify data type of Array element.&lt;/p&gt;&lt;p&gt;The tag has following syntax:&lt;/p&gt;&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt; &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;[&lt;font color=&quot;#0000FF&quot;&gt;ArrayElementType&lt;/font&gt;(&quot;&lt;font color=&quot;EA7500&quot;&gt;&lt;b&gt;elementType&lt;/b&gt;&lt;/font&gt;&quot;)]&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;The property &lt;b&gt;elementType&lt;/b&gt; of &lt;font face=&quot;Courier New&quot;&gt;[ArrayElementType]&lt;/font&gt; metadata tag specifies the data type of Array elements, and can be one of the ActionScript data types, such as &lt;font face=&quot;Courier New&quot;&gt;String&lt;/font&gt;, &lt;font face=&quot;Courier New&quot;&gt;Number&lt;/font&gt;, &lt;font face=&quot;Courier New&quot;&gt;uint&lt;/font&gt;, class or interface.&lt;/p&gt;&lt;p&gt;Incase of user defined class, fully qualified class name, including package detail is expected.&lt;/p&gt;&lt;p&gt;For Example:&lt;/p&gt;&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt;             &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;....&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#0000FF&quot;&gt;&amp;lt;&lt;b&gt;fx:Script&lt;/b&gt;&amp;gt;&lt;/font&gt;&lt;br /&gt;
&amp;lt;[!CDATA[&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;font color=&quot;#0000FF&quot;&gt;ArrayElementType&lt;/font&gt;(&quot;&lt;font color=&quot;EA7500&quot;&gt;&lt;b&gt;String&lt;/b&gt;&lt;/font&gt;&quot;]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#0000FF&quot;&gt;public var &lt;/font&gt; strProp:&lt;font color=&quot;#0000FF&quot;&gt;Array&lt;/font&gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;font color=&quot;#0000FF&quot;&gt;ArrayElementType&lt;/font&gt;(&quot;&lt;font color=&quot;EA7500&quot;&gt;&lt;b&gt;myPackage.valueObject.data&lt;/b&gt;&lt;/font&gt;&quot;]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#0000FF&quot;&gt;public var &lt;/font&gt; dataProp:&lt;font color=&quot;#0000FF&quot;&gt;Array&lt;/font&gt;;&lt;br /&gt;
...&lt;br /&gt;
]]&amp;gt;&lt;br /&gt;
&lt;font color=&quot;#0000FF&quot;&gt;&amp;lt;&lt;b&gt;/fx:Script&lt;/b&gt;&amp;gt;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; The MXML complier checks for proper usage of the Array elements only in MXML code; it does not checks Array usage in ActionScript code.&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/5808862756769413334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2011/08/flex-metadata-tag-array-element-type.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/5808862756769413334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/5808862756769413334'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2011/08/flex-metadata-tag-array-element-type.html' title='Flex :: Metadata tag  - Array Element Type'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-4922010348389872440</id><published>2011-08-30T14:41:00.001+05:30</published><updated>2011-08-31T14:04:02.800+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><title type='text'>Flex Component Life Cycle</title><content type='html'>&lt;font face=&quot;Verdana, Geneva, sans-serif&quot; size=&quot;3&quot;&gt;&lt;p&gt;A flex component life cycle can be broadly compartmentalized  into three distinct stages:&lt;/p&gt;&lt;ol type=&quot;a&quot;&gt;&lt;li&gt;Initialization&lt;/li&gt;
&lt;li&gt;Updating&lt;/li&gt;
&lt;li&gt;Destruction&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;This three stage bundles Six main phases  of flex component life cycle which are&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Construction&lt;/li&gt;
&lt;li&gt;Addition&lt;/li&gt;
&lt;li&gt;Initialization&lt;/li&gt;
&lt;li&gt;Invalidation&lt;/li&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;li&gt;Removal&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Following diagram shows the association of  7 different phase to their respective lifecycle stage&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCAcZlZACEG6tKBl5M3dTwxkt3OQ_ui8WvAG5WjQR5_X328n0EX8cUc7X2fjR_Fx56AAlP42_fSVUAtdZNOCf3QKO11-SDqbzPgOg426XyogFMRlN4-uxiWUoSC2GsdEeOnQ8FZ7G8DmxU/s1600/Flex_Component_LifeCycle.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCAcZlZACEG6tKBl5M3dTwxkt3OQ_ui8WvAG5WjQR5_X328n0EX8cUc7X2fjR_Fx56AAlP42_fSVUAtdZNOCf3QKO11-SDqbzPgOg426XyogFMRlN4-uxiWUoSC2GsdEeOnQ8FZ7G8DmxU/s320/Flex_Component_LifeCycle.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;font size=&quot;+1&quot;&gt;&lt;p&gt;&lt;b&gt;Description of Life Cycle Phases&lt;/b&gt;&lt;/p&gt;&lt;b&gt;Stage 1:&lt;/b&gt; Initialization&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;&lt;b&gt;Phase  1:&lt;/b&gt; Construction&lt;/p&gt;&lt;p&gt;Construction  phase is very first phase of component and is triggered when component is  instantiated.  For an example &lt;/p&gt;&lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;var  myComponent:CustomComponent = new CustomComponent();&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;It should be noted that constructor should  perform minimalist operation. Constructor should be zero argument constructors.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Phase  2:&lt;/b&gt; Addition&lt;/p&gt;&lt;p&gt;Addition  phase of component is triggered when component is added to a parent component.&lt;/p&gt;&lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;this.addChild( myComponent );&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;The process of adding component to its  parent component execute large amount of code. This is the phase where life  cycle of component actually gets started.   In granularity addChild method is further divided in to three method &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;addingChild&lt;/font&gt;, &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;$addChild&lt;/font&gt; and &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;childAdded&lt;/font&gt; method. &lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;addingchild&lt;/font&gt; method  initialize parent and document reference for component child object. Also it  performs style propagation and management for the component.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;$addChild&lt;/font&gt; method  actually add component to the display list.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;childAdded&lt;/font&gt; method calls  initialize method on the child.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Phase  3:&lt;/b&gt; Initialize&lt;/p&gt;&lt;p&gt;Initialize  phase is triggered by &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;childAdded&lt;/font&gt; method of Addition phase of component. The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;initialize&lt;/font&gt; method is  future broken down into four sub-methods &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;createChildren&lt;/font&gt;, &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;childrenCreated&lt;/font&gt;,  &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;initializeAccessibility&lt;/font&gt; and &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;initializationComplete&lt;/font&gt;. When initialize method of  the component is called first &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;FlextEvent.PREINITIALIZE&lt;/font&gt; event is dispatch first and then &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;createChildren&lt;/font&gt; method is called. &lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;createChildren&lt;/font&gt; method is responsible  for create any extended component and then adding that child component.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;childrenCreated&lt;/font&gt; method is responsible  for enabling first Invalidate-Validate cycle of flex component life cycle.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;initializeAccessibility&lt;/font&gt; method is  responsible to configure the component to use flash player accessibility  system.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;initializationComplete&lt;/font&gt; method is  responsible for dispatching &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;FlexEvent.INITIALIZED&lt;/font&gt; event. This method marks end  of &lt;b&gt;Stage 1&lt;/b&gt; of Flex Component Life cycle.&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font size=&quot;+1&quot;&gt;&lt;b&gt;Stage 2:&lt;/b&gt; Updating&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;&lt;b&gt;Phase  4:&lt;/b&gt; Invalidation&lt;/p&gt;&lt;p&gt;Invalidation  is the first phase of flex component life cycle that gets repeated throughout the  life of the component.  Invalidation  phase consist of three method &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;invalidateProperties&lt;/font&gt;, &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;invalidateSize&lt;/font&gt; and  &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;invalidateDisplayList&lt;/font&gt;&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;invalidateProperties&lt;/font&gt; method is called  whenever component property is changed and that require before component to  re-measure and laid out.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;invalidateSize&lt;/font&gt; method is called  whenever some action i.e. changes in property or user action which requires the  components to re-calculate its size and its children’s size.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;invalidateDisplayList&lt;/font&gt; method is called  whenever some changes that requires component display list to be updated. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Phase  5:&lt;/b&gt; Validation&lt;/p&gt;&lt;p&gt;Validation  phase consost of four methods &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;commitProperties&lt;/font&gt;, &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;measure&lt;/font&gt;, &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;layoutChrome&lt;/font&gt; and  &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;updateDisplayList&lt;/font&gt;. All this method of validate phase are executed in predefined  order which is &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;commitProperties&lt;/li&gt;
&lt;li&gt;measure&lt;/li&gt;
&lt;li&gt;layoutchrome&lt;/li&gt;
&lt;li&gt;updateDisplayList&lt;/li&gt;
&lt;/ol&gt;&lt;/font&gt;&lt;br /&gt;
Each of the invalidate phase method  correspond to validate phase method&lt;/p&gt;&lt;p&gt;invalidateProperties ---&gt; commitProperties&lt;br /&gt;
&lt;br /&gt;
invalidatesize&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;---&gt; measure&lt;br /&gt;
&lt;br /&gt;
invalidateDisplayList ---&gt;  updateDisplayList&lt;/p&gt;&lt;p&gt;Thus whenever invalidate method is called &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;LayoutManager&lt;/font&gt; of Flex Application keeps track of which invalidate method is called and only calls corresponding validate method during validate phase.&lt;/p&gt;&lt;p&gt;The fourth method of validate phase is &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;layoutChrome&lt;/font&gt;, this method is responsible for creating border or padding around  children content.&lt;/p&gt;&lt;p&gt;Thus once validate cycle of component is  executed &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;LayoutManager&lt;/font&gt; will make component dispatch &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;Event.UPDATE_COMPLETE&lt;/font&gt; event.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; The Invalidate - Validate cycle of component repeat itself as an when any changes are made to the component and component is not removed from its parent.&lt;/p&gt;&lt;br /&gt;
&lt;font size=&quot;+1&quot;&gt;&lt;b&gt;Stage 3:&lt;/b&gt; Destruction&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;&lt;b&gt;Phase  6:&lt;/b&gt; Removal&lt;/p&gt;&lt;p&gt;The last phase of a component life-cycle is removal phase. This phase is triggered when the component is no longer parented i.e., when &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;removeChild()&lt;/font&gt; method is called on the parent component, passing in the component to remove as a reference.&lt;/p&gt;&lt;p&gt;When &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;removeChild()&lt;/font&gt; method is called on parent component then three methods are fired, &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;removingChild()&lt;/font&gt;, &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;$removeChild()&lt;/font&gt; and &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;childRemoved()&lt;/font&gt;.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;removingChild()&lt;/font&gt; method does not perform any operation, this method can be overridden to execute tasks/operation that needs to be perform before component is removed from display stack &lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;$removeChild()&lt;/font&gt; method is actually a Flash Player level method that removes component from display stack.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New, Courier, monospace&quot;&gt;childRemoved()&lt;/font&gt; method removes references of component form its parents and document properties.&lt;/p&gt;&lt;p&gt;Once reference from component&#39;s parent is removed component can be re-parented or are available for garbage collection. Also removal of parent refrence of compoenent prevent component fromm entering the Invalidate-Validate cycle.&lt;/p&gt;&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/4922010348389872440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2011/08/flex-component-life-cycle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/4922010348389872440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/4922010348389872440'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2011/08/flex-component-life-cycle.html' title='Flex Component Life Cycle'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCAcZlZACEG6tKBl5M3dTwxkt3OQ_ui8WvAG5WjQR5_X328n0EX8cUc7X2fjR_Fx56AAlP42_fSVUAtdZNOCf3QKO11-SDqbzPgOg426XyogFMRlN4-uxiWUoSC2GsdEeOnQ8FZ7G8DmxU/s72-c/Flex_Component_LifeCycle.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-731519879546364252</id><published>2011-08-17T22:50:00.000+05:30</published><updated>2011-08-17T22:50:58.008+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern"/><category scheme="http://www.blogger.com/atom/ns#" term="PureMVC"/><title type='text'>Difference between Pure MVC Multicore vs Singlecore / Standard</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: small;&quot;&gt;Recently during interview, my interviewer asks me question &quot;What is difference between Pure MVC Multicore vs SingleCore?&quot; and I was not able to answer even after working on the framework for past 2 years. So after interview got over I set down to find the answer for the question and here are what I found.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: small;&quot;&gt;The Standard version of Pure MVC use Singletons to provide access to framework core actors (&lt;i&gt;Façade, Model, View and Controller&lt;/i&gt;). Access to all the actors is through standard &lt;span style=&quot;font-family: Courier New,Courier,monospace;&quot;&gt;getInstance&lt;/span&gt; method. Where as in Multicore version of Pure MVC, Multitons is use to allow multiple instances of framework actors. The access to the various core actors within the framework is provided by passing a unique instance key to the &lt;span style=&quot;font-family: Courier New,Courier,monospace;&quot;&gt;getInstance&lt;/span&gt; method. This implies that multiple instances of the core actors may co-exist without interfering with each other.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: small;&quot;&gt;The Multicore variation supports modular programming allowing the use of independent program modules each with their own independent Singlecore Pure MVC.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: small;&quot;&gt;For detail description on same topic please visit following link: &lt;span style=&quot;font-family: Courier New,Courier,monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier New,Courier,monospace;&quot;&gt;&lt;a href=&quot;http://lowpitch.com/blog/puremvc-multicore-vs-standard-singlecore/&quot;&gt;http://lowpitch.com/blog/puremvc-multicore-vs-standard-singlecore/&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/731519879546364252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2011/08/difference-between-pure-mvc-multicore.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/731519879546364252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/731519879546364252'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2011/08/difference-between-pure-mvc-multicore.html' title='Difference between Pure MVC Multicore vs Singlecore / Standard'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-5294184340734027523</id><published>2010-12-30T22:29:00.001+05:30</published><updated>2010-12-30T22:30:48.098+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><title type='text'>@Embed directive in Flex</title><content type='html'>&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
&lt;p&gt;&lt;font face=&quot;Courier New&quot; &gt;@Embed&lt;/font&gt; directive causes flex compiler to trasncode and include images (&lt;font face=&quot;Courier New&quot;&gt;JPG, PNG, GIF&lt;/font&gt;) in SWF file at compile time.&lt;br /&gt;
Use of this technique has following advantages&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Images are loaded at the start of the application, so that user doesn&#39;t have to wait for images to get loaded before displaying when it is needed.&lt;/li&gt;
&lt;li&gt;This technique is highly recommendate for offline application where appropriate images are included in SWF file and which will be displayed when needed instead of accessing Server for getting images&lt;/li&gt;
&lt;/ul&gt;Use of this technique has one major disadvantage&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;font face=&quot;Courier New&quot; &gt;@Embed&lt;/font&gt; directive increase size of SWF file.&lt;/li&gt;
&lt;/ul&gt;&lt;/br&gt;&lt;br /&gt;
&lt;p&gt;This technique is classical example of trade-off between file size and user experience. Wisely evelaue this techniue before using it.&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/5294184340734027523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/12/embed-directive-in-flex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/5294184340734027523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/5294184340734027523'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/12/embed-directive-in-flex.html' title='@Embed directive in Flex'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-1130403042297141849</id><published>2010-06-29T23:54:00.000+05:30</published><updated>2010-06-29T23:54:18.173+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern"/><title type='text'>Adapter Pattern</title><content type='html'>&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;p&gt;In computer programming, adapter/wrapper pattern is a design pattern that translates one interface or class into compatible interface. This pattern enables incompatible classes to work together by providing compatible interface of original class to its client, i.e. this pattern translate calls made by client to interface into a calls to the original class/interface. The adapter class is also responsible for converting data responded by original class/interface to be converted into form easily understandable by client. For example if interface evaluates a call into a Boolean which client expected it to be integer 1/0 then it is responsibility of adapter class to evaluate a call response into format that is understandable by client class.&lt;/p&gt;&lt;p&gt;There are two types of adapter pattern:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Object Adapter pattern&lt;/b&gt;: In this pattern, adapter class contain object of class it wraps, i.e., adapter class redirect calls from client class to the wrapped class.&lt;br&gt;It uses &lt;i&gt;Composition&lt;/i&gt; method for adapting Adaptee and this adaption can be extended to sub-class of Adaptee&lt;br&gt;Object Adapter class delegates execution of behaviour to Adaptee class&lt;/li&gt;&lt;li&gt;&lt;b&gt;Class Adapter pattern&lt;/b&gt;: In this pattern, multiple inheritance is used to address the issue. Interface of existing implementation as well as interface of expected implementation is inherited by the adapter class so that it behaves as an expected implementation. This type of implementation is used in situation where existing implementation provide some or all of the services expected but does not use expected interfaces.&lt;br&gt;It uses &lt;i&gt;Inheritance&lt;/i&gt; method for adapting Adaptee hence Adapter class doesn&#39;t requires to reimplement entire Adaptee class, but only needs to override the behaviour of Adaptee class that varies.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;Flow of control in Adapter pattern&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Client makes an request to Adapter class by invoking its method using Target interface.&lt;/li&gt;&lt;li&gt;Adapter object translate this request into single or series of method call to Adaptee object.&lt;/li&gt;&lt;li&gt;Client receive back the response, without knowing that translation is done by Adapter.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;b&gt;Object Adapter Pattern&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8S8kJPxsueuwb7azN6mlu0dNMeArwhb-ewfLl46ukRq9qW9P5U8fW6ZcDGxgf7qn5xqqqZbW5XqVZ_rKchBCuiwFdLa8hiMLhLHDbAcFL5dK48c9rkD0Gj6JYWni7cFfUrNV6YQtG2ac3/s1600/adapterPattern_Object.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8S8kJPxsueuwb7azN6mlu0dNMeArwhb-ewfLl46ukRq9qW9P5U8fW6ZcDGxgf7qn5xqqqZbW5XqVZ_rKchBCuiwFdLa8hiMLhLHDbAcFL5dK48c9rkD0Gj6JYWni7cFfUrNV6YQtG2ac3/s320/adapterPattern_Object.jpg&quot; alt=&quot;Object Adapter Pattern class diagram&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Class Adapter Pattern&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL2BKJMU9fFNfGdEe3FW0RTBNiI8p-xY-10XQuR1M6WRUK9fCIJmZDgsepFe59TkmHzLO9omPGX9jx-0Be3C5oRfoo7JSmXwwJqN5SK-4nEpcz8-3giGPvakxc0thaw1BwwI2hDMukQfMD/s1600/adapterPattern_Class.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL2BKJMU9fFNfGdEe3FW0RTBNiI8p-xY-10XQuR1M6WRUK9fCIJmZDgsepFe59TkmHzLO9omPGX9jx-0Be3C5oRfoo7JSmXwwJqN5SK-4nEpcz8-3giGPvakxc0thaw1BwwI2hDMukQfMD/s320/adapterPattern_Class.jpg&quot; alt=&quot;Class Adapter Pattern class diagram&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: Adapter pattern is never implemented when designing a new system but with the changing requirements we have deferring interfaces then adapter comes into picture.&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/1130403042297141849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/06/adapter-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/1130403042297141849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/1130403042297141849'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/06/adapter-pattern.html' title='Adapter Pattern'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8S8kJPxsueuwb7azN6mlu0dNMeArwhb-ewfLl46ukRq9qW9P5U8fW6ZcDGxgf7qn5xqqqZbW5XqVZ_rKchBCuiwFdLa8hiMLhLHDbAcFL5dK48c9rkD0Gj6JYWni7cFfUrNV6YQtG2ac3/s72-c/adapterPattern_Object.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-4858155117285557537</id><published>2010-06-21T20:52:00.001+05:30</published><updated>2010-06-21T20:58:21.777+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern"/><title type='text'>Object Pool Pattern</title><content type='html'>&lt;font face=&quot;verdana&quot; size=3&gt;&lt;p&gt;Performance can be sometimes the key issue during the software development and the object creation (class instantiation) is a costly step. While the Prototype pattern helps in improving the performance by cloning the objects, the Object Pool pattern offers a mechanism to reuse objects that are expensive to create.&lt;/p&gt;&lt;p&gt;The &lt;b&gt;Object Pool&lt;/b&gt; pattern offers mechanism to &lt;i&gt;reuse/recycle&lt;/i&gt; objects that are &lt;i&gt;expensive to create&lt;/i&gt; or are no longer need.&lt;/p&gt;&lt;p&gt;Object pool pattern is advisable to use in a situation where several client may need the &lt;i&gt;same stateless object&lt;/i&gt; which is expensive to create.&lt;/p&gt;&lt;p&gt;Benefits of using Object Pool pattern are:&lt;ul&gt;&lt;li&gt;Pattern can improve performance of application as it help in reducing time for creation of expensive object.&lt;/li&gt;&lt;li&gt;Pattern helps in sharing unused object between multiple clients thereby improving memory usage and can result I overall reduction in memory footprint of application.&lt;/li&gt;&lt;li&gt;Additional memory management routine will not be required as resource user will acquire and release resource transparently.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;The Consequences of this approach include:&lt;ul&gt;&lt;li&gt;In concurrent environment acquisition request for the resource needs t be synchronized in order to avoid race condition and possibility of corrupting associated state.&lt;/li&gt;&lt;li&gt;In case if resource users are involve in eager acquisition polling approach will fail.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/4858155117285557537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/06/object-pool-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/4858155117285557537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/4858155117285557537'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/06/object-pool-pattern.html' title='Object Pool Pattern'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-8628748694643532700</id><published>2010-06-03T22:29:00.004+05:30</published><updated>2010-06-03T22:38:56.710+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern"/><title type='text'>Eager Initialization Pattern</title><content type='html'>&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;p&gt;As name suggests Eager Initialization approach creates/initialize an object with anticipation, regardless of whether or not it will be required in program.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Definition&lt;/b&gt;: The Eager Initialization pattern describes how run-time acquisition and initialization of resources can be made predictable and fast by eagerly acquiring and initializing resources before their actual usage.&lt;/p&gt;&lt;p&gt;Eager initialization pattern at first glance seems an un-efficient pattern, but in situation where application is required to be reliable and predictable with no downtime this pattern comes handy.  As and when an object/variable is declared or when the object in which it lives is created [&lt;i&gt;declaration&lt;/i&gt; or &lt;i&gt;constructor&lt;/i&gt;] object/variable is initialized.&lt;/p&gt;&lt;p&gt;Eager initialization approach should only be used&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;When initialization of the instance variable would consume large amount of time and downtime of application is not acceptable.&lt;/li&gt;
&lt;li&gt;In pooling solution where it will require pre-acquire a number of resources in order to quickly serve first requests.&lt;/li&gt;
&lt;li&gt;A Hamster application. Like hamster which acquires as many fruits as possible before eating them in its cave, Hamster application will acquires as many resources before it’s actually execute application.&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;The benefits of this approach include:&lt;ul&gt;&lt;li&gt;Increase in predictability of application as user requests for resource acquisition are intercepted and served instantly.&lt;/li&gt;
&lt;li&gt;Application response time is very low as resources are pre acquired.&lt;/li&gt;
&lt;li&gt;Assurance of the variables been initialized before they are used.&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;The Consequences of this approach include:&lt;ul&gt;&lt;li&gt;As all the resources are eagerly acquired at the start of the application, the start-up time for the application is longer.&lt;/li&gt;
&lt;li&gt;Eager Initialization might initialize many objects upfront, which may not be required by system. This may introduce unnecessary exhaustion or overuse of memory resources.&lt;/li&gt;
&lt;li&gt;Management of eagerly initialized object becomes an important aspect as not all the resources might require immediately in application.&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/8628748694643532700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/06/eager-initialization-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/8628748694643532700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/8628748694643532700'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/06/eager-initialization-pattern.html' title='Eager Initialization Pattern'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-4099124533272933256</id><published>2010-05-28T00:45:00.002+05:30</published><updated>2010-06-03T22:42:07.533+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern"/><title type='text'>Lazy Initialization Pattern</title><content type='html'>&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;As name suggests &lt;i&gt;Lazy initialization&lt;/i&gt; pattern delays the creation of an object till it is requested for the first time in program.&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;Definition&lt;/b&gt;: The &lt;i&gt;Lazy initialization&lt;/i&gt; pattern defers resource acquisitions to the latest possible point in time during system execution in order to optimize resource usage.&amp;nbsp;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;i&gt;Lazy initialization&lt;/i&gt; is typically accompanied by a flag for indicating whether the initialization process is executed or not. As and when an object is requested, associated flag is first tested. If the object is created priory by another request then same is returned else it is initialized on the spot.&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;Lazy initialization approach should only be used&lt;/font&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;When initialization of the instance variable would consume a significant amount of &lt;b&gt;time&lt;/b&gt;.&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;When initialization of the instance variable would consume a significant amount of &lt;b&gt;resources&lt;/b&gt;.&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;When chance of the variable &lt;b&gt;not been used&lt;/b&gt; is very high&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;The benefits of this approach include:&lt;/font&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;Increase in performance&lt;/b&gt; of application due to avoiding unnecessary creation of an object.&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;Optimal utilization of memory&lt;/b&gt;, as creation of object is postponed till it actually required in application.&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;The stability of the applications&lt;/b&gt; is increased because resource exhaustion becomes less likely.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;The Consequences of this approach include:&lt;/font&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;The execution of the &lt;i&gt;Lazy Initialization&lt;/i&gt; can introduce a significant time &lt;b&gt;delay&lt;/b&gt; to the regular program execution. Especially for real-time systems such behavior is not advisable.&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;Lazy Initialization might introduce additional &lt;b&gt;complexity &lt;/b&gt;to the program, especially concerning the program logic and distribution of initialization code throughout class.&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;The behavior of a lazy Initialization pattern can become distinctly non-linear when certain thresholds are reached, e.g. virtual memory systems can end up thrashing. This disqualifies the pattern for usage in real-time systems.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;For example, consder a Tax calculation application where calculation of actual tax that need to be payed is posponded till user filled all information and clicked &#39;Calculate&#39; button.&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;#C0C0C0&quot; border=&quot;1&quot; cellpadding=&quot;3&quot; width=&quot;100%&quot;&gt;&lt;tr&gt; &lt;td&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;FF0000&quot;&gt;package&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;public class&lt;/font&gt; TaxCalculator()&lt;br /&gt;
&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;private &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;grossIncome:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;FF0000&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;private &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;taxAmount:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;monthlyBasic:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;monthlyDA:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;monthlyOther:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;yearlyInsurance:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;yearlyPPF:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;yearlyBonds:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;function &lt;/font&gt;TaxCalculator():&lt;font color=&quot;0000FF&quot;&gt;void&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;pulic &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;function &lt;/font&gt;&lt;font color=&quot;FF0000&quot;&gt;get &lt;/font&gt;gross():&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;// Evaluating user gross income as an when asked, not prior to that.&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; grossIncome = (monthlyBasic + monthlyDA + monthlyOther) * 12 - (yearlyInsurance + yearlyPPF + yearlyBonds);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;return &lt;/font&gt;grossIncome;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;function &lt;/font&gt;actualTaxAmount():&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Evaluating actual tax amount as an when asked,&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // not prior to that.&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;taxableAmount:&lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt; = (gross-150000);&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;if&lt;/font&gt;(taxableAmount &amp;lt; = 0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;taxAmount = 0&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;else&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;if&lt;/font&gt;(taxableAmount &amp;lt; = 350000)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taxAmount =&amp;nbsp;taxableAmount * 0.1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;else&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;taxableAmount =&amp;nbsp;taxableAmount - 350000;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;taxAmount += 35000;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;if&lt;/font&gt;(taxableAmount &amp;lt; = 300000)&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;taxAmount += taxableAmount * 0.2;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;else&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;taxableAmount = taxableAmount - 300000;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;taxAmount += 30000 + taxableAmount * 0.3;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;return&amp;nbsp;&lt;/font&gt;taxAmount;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/font&gt;&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;i&gt;&lt;font face=&quot;verdana&quot; size=&quot;2&quot;&gt;class 1: TaxCalculator&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;#C0C0C0&quot; border=&quot;1&quot; cellpadding=&quot;3&quot; width=&quot;100%&quot;&gt;&lt;tr&gt; &lt;td&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;FF0000&quot;&gt;package&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;public class&lt;/font&gt; TaxCalculatorManager&lt;br /&gt;
&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;private static &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;INSTANCE:TaxCalculator;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;function&amp;nbsp;&lt;/font&gt;TaxCalculatorManager(value:SingletomeEnforcer):&lt;font color=&quot;0000FF&quot;&gt;void&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public static&lt;/font&gt; &lt;font color=&quot;0000FF&quot;&gt;function &lt;/font&gt;getInstance():TaxCalculator&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;if&lt;/font&gt;(INSTANCE == &lt;font color=&quot;0000FF&quot;&gt;null&lt;/font&gt;)&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INSTANCE = &lt;font color=&quot;0000FF&quot;&gt;new &lt;/font&gt;TaxCalculator();&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;return &lt;/font&gt;INSTANCE&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt; }&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;/* Inline class to enforce singleton pattern */&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;FF0000&quot;&gt;class&lt;/font&gt; SingletonEnforcer&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;i&gt;&lt;font face=&quot;verdana&quot; size=&quot;2&quot;&gt;class 2: TaxCalculatorManager&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table bgcolor=&quot;#C0C0C0&quot; border=&quot;1&quot; cellpadding=&quot;3&quot; width = &quot;100%&quot;&gt;&lt;tr&gt; &lt;td&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;FF0000&quot;&gt;package&lt;/font&gt;&lt;br /&gt;
{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;import &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;flash.display.MovieClip&lt;/font&gt;;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;import &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;flash.events.MouseEvent&lt;/font&gt;;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;public class&lt;/font&gt; Client &lt;font color=&quot;FF0000&quot;&gt;extends &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;MovieClip&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; {&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;private &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;var &lt;/font&gt;taxCalculator:TaxCalculator;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;function&amp;nbsp;&lt;/font&gt;Client():&lt;font color=&quot;0000FF&quot;&gt;void&lt;/font&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;init();&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;calculateBtn.&lt;font color=&quot;0000FF&quot;&gt;addEventListener&lt;/font&gt;(&lt;font color=&quot;0000FF&quot;&gt;MouseEvent&lt;/font&gt;.&lt;font color=&quot;0000FF&quot;&gt;CLICK&lt;/font&gt;, calculateTax);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;private &lt;/font&gt;&lt;font color=&quot;0000FF&quot;&gt;function &lt;/font&gt;init():&lt;font color=&quot;0000FF&quot;&gt;void&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Initializing all on screen input text fields&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;0000FF&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;this&lt;/font&gt;.monthlyBasicTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt; = 0;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;0000FF&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;this&lt;/font&gt;.monthlyDATxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;&amp;nbsp;= 0;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;0000FF&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;this&lt;/font&gt;.monthlyOtherTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;&amp;nbsp;= 0;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;0000FF&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;this&lt;/font&gt;.yearlyInsuranceTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;&amp;nbsp;= 0;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;0000FF&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;this&lt;/font&gt;.yearlyPPFTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;&amp;nbsp;= 0;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;0000FF&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;this&lt;/font&gt;.yearlyBondsTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;&amp;nbsp;= 0;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;0000FF&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;this&lt;/font&gt;.grossAmountTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;&amp;nbsp;= 0;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;0000FF&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;this&lt;/font&gt;.taxAmountTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;&amp;nbsp;= 0;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;font color=&quot;FF0000&quot;&gt;public &lt;/font&gt;function&amp;nbsp;calculateTax(e:&lt;font color=&quot;0000FF&quot;&gt;MouseEvent&lt;/font&gt;):&lt;font color=&quot;0000FF&quot;&gt;void&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;FF0000&quot;&gt;if&lt;/font&gt;(taxCalculator == &lt;font color=&quot;0000FF&quot;&gt;null&lt;/font&gt;)&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Posponding initialization of TaxCalculator object&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//till it is first required;&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;taxCalculator = TaxCalculatorManager.getInstance();&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // setting user inputted income in TaxCalculator object&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taxCalculator.monthlyBasic&amp;nbsp;= &lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;(&lt;font color=&quot;0000FF&quot;&gt;this&lt;/font&gt;.monthlyBasicTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;);&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taxCalculator.monthlyDA&amp;nbsp;= &lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;(&lt;font color=&quot;0000FF&quot;&gt;this&lt;/font&gt;.monthlyDATxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;);&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taxCalculator.monthlyOther&amp;nbsp;= &lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;(&lt;font color=&quot;0000FF&quot;&gt;this&lt;/font&gt;.monthlyOtherTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;);&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taxCalculator.yearlyInsurance&amp;nbsp;= &lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;(&lt;font color=&quot;0000FF&quot;&gt;this&lt;/font&gt;.yearlyInsuranceTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;);&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taxCalculator.yearlyPPF&amp;nbsp;= &lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;(&lt;font color=&quot;0000FF&quot;&gt;this&lt;/font&gt;.yearlyPPFTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;);&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; taxCalculator.yearlyBonds&amp;nbsp;= &lt;font color=&quot;0000FF&quot;&gt;Number&lt;/font&gt;(&lt;font color=&quot;0000FF&quot;&gt;this&lt;/font&gt;.yearlyBondsTxt.&lt;font color=&quot;0000FF&quot;&gt;text&lt;/font&gt;);&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color= &quot;#b45f06&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //displaying user gross value along with actual tax value.&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;font color=&quot;0000FF&quot;&gt;this&lt;/font&gt;.grossAmountTxt.&lt;font color=&quot;0000FF&quot;&gt;text &amp;nbsp;&lt;/font&gt;=&amp;nbsp;taxCalculator.gross&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;font color=&quot;0000FF&quot;&gt;this&lt;/font&gt;.taxAmountTxt.&lt;font color=&quot;0000FF&quot;&gt;text &amp;nbsp;&lt;/font&gt;=&amp;nbsp;taxCalculator.actualTaxAmount();&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;br /&gt;
&lt;font face=&quot;Courier new&quot; size=&quot;3&quot;&gt; }&lt;/font&gt;&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;&lt;font face=&quot;verdana&quot; size=&quot;2&quot;&gt;&lt;i&gt;class 3: Client&lt;/i&gt;&lt;/font&gt;&lt;br&gt;&lt;br /&gt;
&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;i&gt;Lazy initialization&lt;/i&gt; is often used together with a &lt;i&gt;Factory Method Pattern&lt;/i&gt;. This combines three ideas:&lt;/font&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;Using a factory method to get instances of a class (&lt;i&gt;Factory Method Pattern&lt;/i&gt;)&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;Storing the instances in a variable mapped with a flag, so that same instance is referred when getter is fired with same parameter &amp;nbsp;(compare with a &lt;i&gt;Singleton Pattern&lt;/i&gt;)&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;Using lazy initialization to instantiate the object the first time it is requested (&lt;i&gt;Lazy Initialization Pattern&lt;/i&gt;).&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/4099124533272933256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/lazy-initialization-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/4099124533272933256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/4099124533272933256'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/lazy-initialization-pattern.html' title='Lazy Initialization Pattern'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-5155158206431448439</id><published>2010-05-24T21:21:00.000+05:30</published><updated>2010-05-24T21:22:29.714+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flash Player"/><title type='text'>Properties that can be set using mm.cfg file</title><content type='html'>&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;p&gt;&lt;font face=&quot;Courier new&quot;&gt;mm.cfg&lt;/font&gt; file is used to configure the debugger version of Flash Player. The Location where this file is available depends on the operating system also if this file is not available at the location then we can create this file.&lt;/p&gt;&lt;br&gt;&lt;table cellpadding=&quot;3&quot; width=&quot;100%&quot; border=&quot;1&quot;&gt;      &lt;tr bgcolor=&quot;#606060&quot;&gt;
            &lt;th&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Operating system&lt;/font&gt;&lt;/th&gt;
            &lt;th&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Location of &lt;font face=&quot;Courier new&quot;&gt;mm.cfg&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#B9B9B9&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;MS Window Vista&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;C:\Users\&amp;lt;user_name&amp;gt;\&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#9A9A9A&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;MS Windows 2000/XP&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;C:Document and Setting\&amp;lt;user_name&amp;gt;\&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#B9B9B9&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Macintosh OS X&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;MacHD:Library:Application Support:macromedia:&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#9A9A9A&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Linux&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;/home/&amp;lt;user_name&amp;gt;/&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;/table&gt;&lt;br&gt;&lt;p&gt;Following are the properties that can be set in mm.cfg file for debugging&lt;/p&gt;&lt;table cellpadding=&quot;3&quot; width=&quot;100%&quot; border=&quot;1&quot;&gt;      &lt;tr bgcolor=&quot;#606060&quot;&gt;
            &lt;th&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Properties&lt;/font&gt;&lt;/th&gt;
            &lt;th&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Description&lt;/font&gt;&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#B9B9B9&gt;
            &lt;td align=left valign=top&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;ErrorReportingEnable&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Enables/Disables logging of error messages.&lt;br&gt;&lt;b&gt;1&lt;/b&gt;: Enables debug Flash Player to write error messages to the log file.&lt;br&gt;&lt;b&gt;0&lt;/b&gt;: Disables debug Flash Player to write error messages to the log file.&lt;br&gt;Default value is &lt;b&gt;0&lt;/b&gt;(zero).&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#9A9A9A&gt;
            &lt;td align=left valign=top&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;MaxWarnings&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Number of flash warnings/error messages to be logged before stopping.&lt;br&gt;The default value of the &lt;font face=&quot;Courier new&quot;&gt;MaxWarning&lt;/font&gt; properties is &lt;b&gt;100&lt;/b&gt;.&lt;br&gt;After 100 warning/error messages are logged, the debug version of Flash Player writes &lt;i&gt;further error messages are suppressed in log file&lt;/i&gt;.&lt;br&gt;Setting the &lt;font face=&quot;Courier new&quot;&gt;MaxWarnings&lt;/font&gt; property will override he default messaging limit. For example if set to 500, the log file will record 500 warning / error messages.&lt;br&gt;If &lt;font face=&quot;Courier new&quot;&gt;MaxWarnings&lt;/font&gt; property is set to &lt;b&gt;0&lt;/b&gt; (zero), limit to record warning / error messages is removed and all the warning / error messages are recorded.&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#B9B9B9&gt;
            &lt;td align=left valign=top&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;TraceOutputFileEnable&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Enables/Disables logging of trace messages.&lt;br&gt;&lt;b&gt;1&lt;/b&gt;: Enables debug Flash Player to write trace messages to the log file.&lt;br&gt;&lt;b&gt;0&lt;/b&gt;: Disables debug Flash Player to write trace messages to the log file.&lt;br&gt;Default value is &lt;b&gt;0&lt;/b&gt;(zero).&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#9A9A9A&gt;
            &lt;td align=left valign=top&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;TraceOutputFileName&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;&lt;i&gt;Ignored form Flash Player 9&lt;/i&gt;.&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;/table&gt;&lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: Debug Flash Player writes all warning /error messages /trace statements to a file named &lt;font face=&quot;Courier new&quot;&gt;flashlog.txt&lt;/font&gt;, whose location depends on operating system.&lt;/p&gt;&lt;table cellpadding=&quot;3&quot; width=&quot;100%&quot; border=&quot;1&quot;&gt;      &lt;tr bgcolor=&quot;#606060&quot;&gt;
            &lt;th&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Operating system&lt;/font&gt;&lt;/th&gt;
            &lt;th&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Location of &lt;font face=&quot;Courier new&quot;&gt;flashlog.txt&lt;/font&gt;&lt;/font&gt;&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#B9B9B9&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;MS Window Vista&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;C:\Users\&amp;lt;user_name&amp;gt;\AppData\Roaming\Macromedia\Flash Player\Logs\&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#9A9A9A&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;MS Windows 2000/XP&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;C:Document and Setting\&amp;lt;user_name&amp;gt;\Application Data\Macromedia\Flash Player\Logs\&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#B9B9B9&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Macintosh OS X&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;MacHD:Users:&amp;lt;user_name&amp;gt;:Library:Preferences:Macromedia:Flash Player:Logs:&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=#9A9A9A&gt;
            &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Linux&lt;/font&gt;&lt;/td&gt;
            &lt;td&gt;&lt;font face=&quot;Courier new&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;/home/&amp;lt;user_name&amp;gt;/macromedia/Flash_Player/Logs/&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;/table&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/5155158206431448439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/properties-that-can-be-set-using-mmcfg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/5155158206431448439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/5155158206431448439'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/properties-that-can-be-set-using-mmcfg.html' title='Properties that can be set using mm.cfg file'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-483893125265576138</id><published>2010-05-22T01:04:00.010+05:30</published><updated>2010-05-22T01:18:42.346+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flash Player"/><title type='text'>Flash Output Log File</title><content type='html'>&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;p&gt;This post is just guide on where the flash log is situated and in case if not available then, how to make it available.&lt;/p&gt;&lt;p&gt;The &lt;b&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;flashlog.txt&lt;/font&gt;&lt;/b&gt; is a log file created by the Flash Player. Output of all trace statement along with error reports and warning messages which are generated during compilation and/or running of a flash application are written in this log file by flash player. Existing log file is deleted and new one is created, each time flash application is started.&lt;/p&gt;&lt;p&gt;The &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;flashlog.txt&lt;/font&gt; file is located at following location on machine&lt;/p&gt;&lt;table width=&quot;100%&quot; cellpadding=&quot;2&quot;&gt; &lt;tr&gt;
  &lt;td width=&quot;16%&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;Operating System&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td align=&quot;center&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;Path&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Window XP&lt;/font&gt;&lt;/td&gt;
  &lt;td&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;:&lt;/font&gt;&lt;/td&gt;
  &lt;td&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;C:/Documents and Settings/&amp;lt;user_name&amp;gt;/Application Data/Macromedia/Flash Player/Logs/flashlog.txt&lt;/font&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Window Vista&lt;/font&gt;&lt;/td&gt;
  &lt;td&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;:&lt;/font&gt;&lt;/td&gt;
  &lt;td&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;C:/Users/&amp;lt;user_name&amp;gt;/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt&lt;/font&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;In case if &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;&lt;b&gt;flashlog.txt&lt;/b&gt;&lt;/font&gt; file is not available at above mention location [based on operating system], follow below mention steps:&lt;ol&gt;&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Open command prompt&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Type &#39;&lt;b&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;echo %HOMEDRIVE%HOMEPATH%&lt;/font&gt;&lt;/b&gt;&#39; and then press &lt;b&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;enter&lt;/font&gt;&lt;/b&gt;.&lt;br&gt;Above line of code when executed will specify location where macromedia configuration file &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;[mm.cfg]&lt;/font&gt; will be found.&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Open &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;Window Explorer&lt;/font&gt; and traverse to the folder location displayed on command prompt.&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;If macromedia configuration file [&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;mm.cfg&lt;/font&gt;] file is missing at above location then open a &lt;i&gt;Notepad&lt;/i&gt; file type in below mention line of code as is and then save &lt;i&gt;Notepad&lt;/i&gt; file as &#39;&lt;b&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;mm.cfg&lt;/font&gt;&lt;/b&gt;&#39; at above location and close it.&lt;br&gt;&lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt; &lt;tr&gt;
  &lt;td&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;ErrorReportingEnable=1&lt;br&gt;TraceOutputFileEnable=1&lt;/font&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Close all open flash application [IDE, AIR application and Web Browsers].&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Now re-run flash application and all the &lt;i&gt;trace statement&lt;/i&gt; along with &lt;i&gt;error reports&lt;/i&gt; and &lt;i&gt;warning messages&lt;/i&gt; will be displayed in &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;flashlog.txt&lt;/font&gt; file available at location mention in table above.&lt;/font&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;The sets listed above will be useful for debugging and getting all flash logs in &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;flashlog.txt&lt;/font&gt; file when flash application is running in the standalone flash player. In order to get &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;trace&lt;/font&gt; statement for flash application running through web browser, you need to install Flash Debug Player for web browser.&lt;/p&gt;&lt;br /&gt;
&lt;b&gt;Steps to install Flash Debug Player&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Uninstall Flash player&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Install Flash Debug Player location [&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;&lt;a href=&quot;http://www.adobe.com/support/flashplayer/downloads.html&quot;&gt;http://www.adobe.com/support/flashplayer/downloads.html&lt;/a&gt;&lt;/font&gt;]&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Restart your browser and launch any website containing &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;SWF&lt;/font&gt;. &lt;i&gt;Right-click&lt;/i&gt; [&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;ctrl+click&lt;/font&gt;] on &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;SWF&lt;/font&gt;, it will display &#39;&lt;b&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot; color=&quot;#999999&quot;&gt;Debugger&lt;/font&gt;&lt;/b&gt;&#39; option in context menu.&lt;/font&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Once Flash Debug Player is installed, you will be able to view logs in &lt;font face=&quot;Courier New&quot; size=&quot;3&quot;&gt;flashlog.txt&lt;/font&gt; file even for flash application running from web browser.&lt;/p&gt;&lt;/font&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/483893125265576138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/flash-output-log-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/483893125265576138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/483893125265576138'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/flash-output-log-file.html' title='Flash Output Log File'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-8761515491682843117</id><published>2010-05-19T22:32:00.006+05:30</published><updated>2011-08-30T15:34:17.464+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><title type='text'>Constructor execution order in Actionscript 3.0</title><content type='html'>&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;While working on one of my project, I came across off the track behavior of flash player while executing class constructor. It was observed that flash player while compiling class checks whether the class constructor has explicit call to its super class constructor [anywhere from its constructor], if true flash player does not implicitly calls super class constructor else first statement to be executed in class is call to super class constructor. &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;To explain above statement, let’s take an example, Base class is the parent class for Child class and their structure is as follows&lt;/font&gt;&lt;/p&gt;&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt;             &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;#FF0000&quot;&gt;package&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#FF0000&quot;&gt;public class&lt;/font&gt; Base&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#FF0000&quot;&gt;protected var&lt;/font&gt; baseClassProperty:&lt;font color=&quot;#0000FF&quot;&gt;String&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#FF0000&quot;&gt;public function&lt;/font&gt; Base()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#0000FF&quot;&gt;trace&lt;/font&gt;(&lt;font color=&quot;#EA7500&quot;&gt;&amp;quot;Base Constructor is called&amp;quot;&lt;/font&gt;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;baseClassProperty = &lt;font color=&quot;#EA7500&quot;&gt;&amp;quot;Hello World from Base class&amp;quot;&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt;             &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;&lt;font color=&quot;#FF0000&quot;&gt;package&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#FF0000&quot;&gt;public class&lt;/font&gt; Child &lt;font color=&quot;#FF0000&quot;&gt;extends&lt;/font&gt; Base&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#FF0000&quot;&gt;public&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;function&lt;/font&gt; Child()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#0000FF&quot;&gt;trace&lt;/font&gt;(&lt;font color=&quot;#EA7500&quot;&gt;&amp;quot;Child Constructor is called&amp;quot;&lt;/font&gt;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;Now if we instantiate Child class as&lt;/font&gt;&lt;/p&gt;&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt;             &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot;  color=&quot;#000000&quot;&gt;&lt;font color=&quot;#0000FF&quot;&gt;var&lt;/font&gt; childObj:Child = &lt;font color=&quot;#0000FF&quot;&gt;new&lt;/font&gt; Child();&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;When above statement is executed, following will be the output&lt;/font&gt;&lt;/p&gt;&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt;             &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Base Constructor is called&lt;br /&gt;
Child Constructor is called&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;As expected Flash player will implicitly add call to super class constructor as first statement and hence we will have base class trace first statement and child class trace as second statement in output panel.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;In case if Child class implicitly add call to super class constructor &lt;/font&gt;&lt;/p&gt;&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt;             &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;#FF0000&quot;&gt;package&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#FF0000&quot;&gt;public&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;class&lt;/font&gt; Base&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#FF0000&quot;&gt;protected var&lt;/font&gt; baseClassProperty:&lt;font color=&quot;#0000FF&quot;&gt;String&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#FF0000&quot;&gt;public function &lt;/font&gt;Base()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#0000FF&quot;&gt;trace&lt;/font&gt;(&lt;font color=&quot;#EA7500&quot;&gt;&amp;quot;Base Constructor is called&amp;quot;&lt;/font&gt;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;baseClassProperty = &lt;font color=&quot;#EA7500&quot;&gt;&amp;quot;Hello World from Base class&amp;quot;&lt;/font&gt;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt;             &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;&lt;font color=&quot;#FF0000&quot;&gt;package&lt;/font&gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#FF0000&quot;&gt;public class&lt;/font&gt; Child &lt;font color=&quot;#FF0000&quot;&gt;extends&lt;/font&gt; Base&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#FF0000&quot;&gt;public function&lt;/font&gt; Child()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#0000FF&quot;&gt;trace&lt;/font&gt;(&lt;font color=&quot;#EA7500&quot;&gt;&amp;quot;Child Constructor is called&amp;quot;&lt;/font&gt;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#0000FF&quot;&gt;super&lt;/font&gt;();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;Now if we instantiate Child class, following statement will be displayed in out panel.&lt;/font&gt;&lt;/p&gt;&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;5&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;tr&gt;             &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;Child Constructor is called&lt;br /&gt;
Base Constructor is called&lt;/font&gt;&lt;/td&gt;       &lt;/tr&gt;
&lt;/table&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;As we have explicitly called super class constructor form Child class, Flash player will not implicitly add call to super class constructor as first statement and hence we will have child class trace as a first statement and base class trace as a second statement in output panel.&lt;/font&gt;&lt;/p&gt;&lt;hr&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;Accessing Base class variable from Child class.&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;verdana&quot; size=&quot;3&quot;&gt;While accessing Base class variable from Child class, where Base class is parent class of Child class, it is advisable to accessing variable only after explicit call to Base class constructor in Child class when Child class has explicit call to Base class constructor or can be access at any level if call to Base class constructor is implicit in Child class. In cases when Base class variable if access before implicitly/explicit call to Base class constructor may many time give unexpected result.&lt;/font&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/8761515491682843117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/constructor-execution-order-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/8761515491682843117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/8761515491682843117'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/constructor-execution-order-in.html' title='Constructor execution order in Actionscript 3.0'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-2920828131369314926</id><published>2010-05-19T21:59:00.002+05:30</published><updated>2010-06-03T22:42:27.631+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flash Player"/><title type='text'>Cross Domain Policy Files</title><content type='html'>&lt;p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;A cross-domain policy is a XML document file which is use to grant permission to web client like Adobe Flash Player to access data from different domain. When a client host an application on a domain and makes a request to access content from domain other than its own, the remote domain would required to host a cross-domain policy file which would define and grant access to application from client domain.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Policy file are also used with sockets to grant permission for socket-base connections. It is advisable, to host policy file for both same domain connection as well as connections made across domains.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Normally policy file are host on root directory of a server with file name &lt;font face=&quot;Courier New&quot;&gt;crossdomain.xml&lt;/font&gt;, this is the default location. The following is the example of a typical policy file.&lt;/font&gt;&lt;/p&gt;&lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt;      &lt;tr&gt;
            &lt;td&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot; color=&quot;#C00000&quot;&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;!DOCTYPE cross-domain-policy SYSTEM &lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&lt;/b&gt;&amp;quot;&lt;/font&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;cross-domain-policy&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;site-control permitted-cross-domain-policies&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;none&lt;/b&gt;&amp;quot;&lt;/font&gt;&lt;font color=&quot;#3121EF&quot;&gt;/&amp;gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;allow-access-from domain&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;*&lt;/b&gt;&amp;quot;&lt;/font&gt;&lt;font color=&quot;#3121EF&quot;&gt;/&amp;gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;allow-http-request-headers-from domain&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;0x000000&quot;&gt;&amp;quot;&lt;b&gt;*&lt;/b&gt;&amp;quot;&lt;/font&gt; headers&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;*&lt;/b&gt;&amp;quot;&lt;/font&gt; secure&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;false&lt;/b&gt;&amp;quot;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;/&lt;/font&gt;cross-domain-policy&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;/table&gt;&lt;br&gt;&lt;br /&gt;
&lt;p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;The parent tag for any &lt;font face=&quot;Courier New&quot;&gt;crossdomain.xml&lt;/font&gt; is &lt;b&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;cross-domain-policy&amp;gt;&lt;/font&gt;&lt;/b&gt;tag.&lt;/font&gt;&lt;/p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;cross-domain-policy&amp;gt;&lt;/font&gt;&lt;/b&gt; tag has following elements&lt;font face=&quot;verdana&quot;&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;site-control&amp;gt;&lt;/font&gt;: &lt;font face=&quot;Courier New&quot;&gt;&amp;lt;cross-domain-policy&amp;gt;&lt;/font&gt; tag can have only one &lt;font face=&quot;Courier New&quot;&gt;site-control &lt;/font&gt;element. This element defines the meta-policy for the current domain. In cases where client needs to have multiple policy file on the domain, master policy file [policy file residing on root directory of the domain] decide the acceptability of the policy files on the domain. This element is of importance only if policy file is master policy file else this element is ignored. If a flash application is instructed to use a policy file in a location other than that of the master policy file, the client must first check meta-policy of the master policy file to determine if the original policy file is allowed. &lt;font face=&quot;Courier New&quot;&gt;permitted-cross-domain-policies&lt;/font&gt; attribute of this elements meta-policies, it can hold following values&lt;br /&gt;
      &lt;ul&gt;            &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;none&lt;/font&gt;: No policy files are allowed anywhere on the server other then this file.&lt;/li&gt;
            &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;master-only&lt;/font&gt;: Only this master policy file is allowed on the server.&lt;/li&gt;
            &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;by-content-type&lt;/font&gt;: All policy files whose &lt;font face=&quot;Courier New&quot;&gt;Content-Type&lt;/font&gt; is &lt;font face=&quot;Courier New&quot;&gt;text/x-cross-domain-policy&lt;/font&gt; are only allowed. This meta-policy is only available for HTTP and HTTPS servers.&lt;/li&gt;
            &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;by-ftp-filename&lt;/font&gt;: Only policy files whose file names are &lt;font face=&quot;Courier New&quot;&gt;crossdomain.xml&lt;/font&gt; (i.e. with URLs ending in &lt;font face=&quot;Courier New&quot;&gt;/crossdomain.xml&lt;/font&gt;) are allowed. &lt;/li&gt;
            &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;none-this-response&lt;/font&gt;: This is a special meta-policy that can only be specified in an HTTP response header. It helps prevents this particular HTTP response from being interpreted as a policy file.&lt;/li&gt;
            &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;all&lt;/font&gt;: All policy files on this domain are allowed.&lt;/li&gt;
      &lt;/ul&gt;By default ‘none’ value is assign to this attribute of the element.&lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;allow-access-from-domain&amp;gt;&lt;/font&gt;:&amp;nbsp;&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;cross-domain-policy&amp;gt;&lt;/font&gt; tag can have any number [zero or more] of &lt;font face=&quot;Courier New&quot;&gt;allow-access-from&lt;/font&gt; elements. Each &lt;font face=&quot;Courier New&quot;&gt;allow-access-from&lt;/font&gt; element can be used to define a domain or IP address from which a Flash application can access the local resources. The attribute &lt;font face=&quot;Courier New&quot; color=&quot;#C00000&quot;&gt;domain&lt;/font&gt; specifies address of domain/IP address of Flash application which can access. If address specified is ‘&lt;b&gt;&lt;font face=&quot;Courier New&quot;&gt;*&lt;/font&gt;&lt;/b&gt;’ then it specifies that the local resource of the domain can be access by Flash application from any domain. In case if you want to grant access to your public resources by a specific domain(s), then that domain address need to be specified.&lt;br&gt;&lt;br /&gt;
            &lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt;                  &lt;tr&gt;
                        &lt;td&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#C00000&quot;&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;allow-access-from domain&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;www.mySite.com&lt;/b&gt;&amp;quot;&lt;/font&gt; &lt;font color=&quot;#3121EF&quot;&gt;/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
                  &lt;/tr&gt;
            &lt;/table&gt;   &lt;br&gt;The above example will give access to Flash application hosted on &lt;font face=&quot;Courier New&quot;&gt;www.example.com&lt;/font&gt; domain to access the public resources. Also wildcard ‘&lt;font face=&quot;Courier New&quot;&gt;*&lt;/font&gt;’ can be used to match domains that ends with the given suffix.&lt;br&gt;&lt;br /&gt;
            &lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt;                  &lt;tr&gt;
                        &lt;td&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#C00000&quot;&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;allow-access-from domain&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;*.mySite.com&lt;/b&gt;&amp;quot;&lt;/font&gt; &lt;font color=&quot;#3121EF&quot;&gt;/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
                  &lt;/tr&gt;
            &lt;/table&gt;            &lt;br&gt;IP address where Flash application is hosted can also be specified.&lt;br&gt;&lt;br /&gt;
            &lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt;                  &lt;tr&gt;
                        &lt;td&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#C00000&quot;&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;allow-access-from domain&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;127.0.0.1&lt;/b&gt;&amp;quot;&lt;/font&gt; &lt;font color=&quot;#3121EF&quot;&gt;/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
                  &lt;/tr&gt;
            &lt;/table&gt;            &lt;br&gt;By default a Flash application hosted on an &lt;font face=&quot;Courier New&quot;&gt;HTTPS&lt;/font&gt; server can only access resources on remote &lt;font face=&quot;Courier New&quot;&gt;HTTPS&lt;/font&gt; servers. So if &lt;font face=&quot;Courier New&quot; color=&quot;C00000&quot;&gt;secure&lt;/font&gt; attribute is set to &lt;font face=&quot;Courier New&quot;&gt;false&lt;/font&gt;, then a Flash application on an &lt;font face=&quot;Courier New&quot;&gt;HTTP&lt;/font&gt;  server can access resources from an &lt;font face=&quot;Courier New&quot;&gt;HTTPS&lt;/font&gt; server.&lt;br&gt;&lt;br /&gt;
            &lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt;                  &lt;tr&gt;
                        &lt;td&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#C00000&quot;&gt;&lt;font color=&quot;365F91&quot;&gt;&amp;lt;&lt;/font&gt;allow-access-from domain&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;*.mySite.com&lt;/b&gt;&amp;quot;&lt;/font&gt; secure&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;false&lt;/b&gt;&amp;quot;&lt;/font&gt; &lt;font color=&quot;#3121EF&quot;&gt;/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
                  &lt;/tr&gt;
            &lt;/table&gt;            &lt;br&gt;Policy file is also used while granting access to list/range of ports through which socket connection is allowed. Range of ports is specified through a dash (&lt;font face=&quot;Courier New&quot;&gt;&lt;b&gt;-&lt;/b&gt;&lt;/font&gt;)between two part numbers. List of ports are separated by comma (&lt;font face=&quot;Courier New&quot;&gt;&lt;b&gt;,&lt;/b&gt;&lt;/font&gt;). Wildcard character (&lt;font face=&quot;Courier New&quot;&gt;&lt;b&gt;*&lt;/b&gt;&lt;/font&gt;) can be used to allow all ports. The following is the example of socket-based policy file.&lt;br&gt;&lt;br /&gt;
            &lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt;                  &lt;tr&gt;
                        &lt;td&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#C00000&quot;&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;!DOCTYPE cross-domain-policy SYSTEM &lt;font color=&quot;#000000&quot;&gt;&amp;quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&amp;quot;&lt;/font&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;cross-domain-policy&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;allow-access-from domain&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;*.mySite.com&lt;/b&gt;&amp;quot;&lt;/font&gt; to-ports&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;507,516-523&lt;/b&gt;&amp;quot;&lt;/font&gt;&lt;font color=&quot;#3121EF&quot;&gt;/&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;/&lt;/font&gt;cross-domain-policy&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
                  &lt;/tr&gt;
            &lt;/table&gt;            &lt;br&gt;The above example will allow socket connections from domain &lt;font face=&quot;Courier New&quot;&gt;mySite.com&lt;/font&gt;, including sub-domains, to ports 507, 516, 517, 518, 519, 520, 521, 522 and 523.&lt;br /&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;allow-http-request-header-from&amp;gt;&lt;/font&gt;: &lt;font face=&quot;Courier New&quot;&gt;&amp;lt;cross-domain-policy&amp;gt;&lt;/font&gt; tag can have any number [zero or more] of &lt;font face=&quot;Courier New&quot;&gt;allow-http-request-headers-from&lt;/font&gt; elements. The &lt;font face=&quot;Courier New&quot;&gt;allow-http-request-headers-from&lt;/font&gt; element grants a client hosting content from another domain to send user-defined headers to the current domain, i.e., this tag grants permission to push data [in form of header] into current domain.&lt;br&gt;&lt;br /&gt;
            &lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt;                  &lt;tr&gt;
                        &lt;td&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#C00000&quot;&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;!DOCTYPE cross-domain-policy SYSTEM &lt;font color=&quot;#000000&quot;&gt;&amp;quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&amp;quot;&lt;/font&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;cross-domain-policy&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;allow-http-request-header-from domain&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;www.mySite.com&lt;/b&gt;&amp;quot;&lt;/font&gt; headers&lt;font color=&quot;#3121EF&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;quot;&lt;b&gt;X-My*&lt;/b&gt;&amp;quot;&lt;/font&gt;&lt;font color=&quot;#3121EF&quot;&gt;/&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;/&lt;/font&gt;cross-domain-policy&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;
                  &lt;/tr&gt;
            &lt;/table&gt;            &lt;br&gt;This policy file allows any header beginning with the characters &lt;font face=&quot;Courier New&quot;&gt;X-My&lt;/font&gt; from &lt;font face=&quot;Courier New&quot;&gt;www.mySite.com&lt;/font&gt; to be sent to this domain.&lt;br /&gt;
      &lt;/li&gt;
&lt;/ul&gt;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;&lt;u&gt;Making domain resources inaccessible from other domain&lt;/u&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;If you don’t want any Flash application to access your data/resources form your server then you can create a &lt;font face=&quot;Courier New&quot;&gt;crossdomain.xml&lt;/font&gt; file that does not include ant &lt;b&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;allow-access-from&amp;gt;&lt;/font&gt;&lt;/b&gt; tag&lt;/font&gt;&lt;/p&gt;&lt;table border=&quot;1&quot; bgcolor=&quot;#C0C0C0&quot; width=&quot;100%&quot;&gt;      &lt;tr&gt;
            &lt;td&gt;&lt;p&gt;&lt;font face=&quot;Courier New&quot; size=&quot;3&quot; color=&quot;#C00000&quot;&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;!DOCTYPE cross-domain-policy SYSTEM &lt;font color=&quot;#000000&quot;&gt;&amp;quot;http://www.adobe.com/xml/dtds/cross-domain-policy.dtd&amp;quot;&lt;/font&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;&lt;/font&gt;cross-domain-policy&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#3121EF&quot;&gt;&amp;lt;/&lt;/font&gt;cross-domain-policy&lt;font color=&quot;#3121EF&quot;&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;/table&gt;&lt;br&gt;&lt;br /&gt;
&lt;p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;b&gt;&lt;u&gt;Domain matching criteria followed by Flash Player&lt;/u&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;The following rules are used in determining if a value in the domain attribute of the &lt;font face=&quot;Courier New&quot;&gt;&lt;b&gt;&amp;lt;allow-access-from&amp;gt;&lt;/b&gt;&lt;/font&gt; or &lt;b&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;allow-http-request-headers-from&amp;gt;&lt;/font&gt;&lt;/b&gt; elements matches an actual domain name:&lt;/font&gt;&lt;font face=&quot;verdana&quot;&gt;&lt;br /&gt;
&lt;ul&gt;      &lt;li&gt;For named domains, top-level domain names (i.e. &lt;font face=&quot;Courier New&quot;&gt;com&lt;/font&gt; in &lt;font face=&quot;Courier New&quot;&gt;www.mySite.com&lt;/font&gt;), along with second-level domain names (i.e. &lt;font face=&quot;Courier New&quot;&gt;mySite&lt;/font&gt; in &lt;font face=&quot;Courier New&quot;&gt;www.mySite.com&lt;/font&gt;) and subdomains of a second-level domain (i.e. &lt;font face=&quot;Courier New&quot;&gt;www&lt;/font&gt; in &lt;font face=&quot;Courier New&quot;&gt;www.mySite.com&lt;/font&gt;) should match.&lt;/li&gt;
      &lt;li&gt;Any domain used without a subdomain, are considered separate domains.&lt;/li&gt;
      &lt;li&gt;Whenever a wildcard character (&lt;b&gt;&lt;font face=&quot;Courier New&quot;&gt;*&lt;/font&gt;&lt;/b&gt;) is used as a subdomain, it matches the domain without a subdomain.&lt;/li&gt;
      &lt;li&gt;Wildcard character (&lt;b&gt;&lt;font face=&quot;Courier New&quot;&gt;*&lt;/font&gt;&lt;/b&gt;) is always used in place of subdomain or as an entire domain [All domain access], otherwise domain is invalid.&lt;/li&gt;
      &lt;li&gt;IP addresses and named domains are considered separate domains, even if they refer to the same host.&lt;/li&gt;
      &lt;li&gt;Cross-domain redirects are not allowed and, if used, a domain is considered invalid.&lt;/li&gt;
&lt;/ul&gt;&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot;&gt;Examples:&lt;/font&gt;&lt;/p&gt;&lt;table bordercolor=#FFFFFF border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;4&quot; width=&quot;100%&quot;&gt;      &lt;tr bgcolor=#999999&gt;
            &lt;td valign=&quot;top&quot; align=center&gt;&lt;font face=&quot;verdana&quot; color=&quot;#000000&quot;&gt;&lt;b&gt;Domain Values&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot; align=center&gt;&lt;font face=&quot;verdana&quot; color=&quot;#000000&quot;&gt;&lt;b&gt;Match&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot; align=center&gt;&lt;font face=&quot;verdana&quot; color=&quot;#000000&quot;&gt;&lt;b&gt;Not Match&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=&quot;#E6E6E6&quot;&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;www.mySite.com&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;www.mySite.com&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;http://mySite.com&lt;br&gt;www.mySite.net&lt;br&gt;www.mysite.co.in&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=&quot;#FFFFFF&quot;&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;*.mySite.com&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;www.mySite.com&lt;br&gt;http://mySite.com&lt;br&gt;http://www.mySite.com&lt;br&gt;http://myExample.mySite.com&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;http://www.mySite.net&lt;br&gt;http://adobe.com&lt;br&gt;&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=&quot;#E6E6E6&quot;&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;127.0.0.1&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;http://127.0.0.1&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;http//localhost&lt;br&gt;http://127.0.0&lt;/font&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr bgcolor=&quot;#FFFFFF&quot;&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Courier New&quot; color=&quot;#000000&quot;&gt;www.mySite.*&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot;&gt;&lt;font face=&quot;Verdana&quot; color=&quot;#000000&quot;&gt;invalid domain&lt;/font&gt;&lt;/td&gt;
            &lt;td valign=&quot;top&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/2920828131369314926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/cross-domain-policy-is-xml-document.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/2920828131369314926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/2920828131369314926'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/cross-domain-policy-is-xml-document.html' title='Cross Domain Policy Files'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-7682097711095471049</id><published>2010-05-11T21:53:00.003+05:30</published><updated>2010-05-11T21:59:09.036+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flex Builder"/><title type='text'>Flex Builder 3: Optimizing Flex Builder Performance</title><content type='html'>&lt;p&gt;&lt;font face=&quot;Verdana&quot;&gt;Many time while developing large project using Flex Builder, performance of IDE is comparatively slow which always leads to frustration. While finding solution for this issue I came across few Eclipse environment tweaks, which along with certain workflow best practices improves performance of IDE.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;font face=&quot;Verdana&quot;&gt;Workflow best practice&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;      &lt;li&gt;&lt;font face=&quot;Verdana&quot;&gt;&lt;u&gt;&lt;i&gt;Turn-off &lt;b&gt;Build Automatically&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;: This feature is best suited for small project or for prototypes, as it save developers from pressing &lt;b&gt;Run&lt;/b&gt; button again and again. Developer just need to refresh browser after saving changes. But in case when project size is large, having flex builder to recompile for every small changes save is very taxing.&lt;/font&gt;&lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Verdana&quot;&gt;&lt;u&gt;&lt;i&gt;Having only required project open&lt;/i&gt;&lt;/u&gt;: Whenever Flex Builder create a build or perform copy-paste/rename operation, it refreshes entire document tree for every open project. Time taken for updating document tree of Flex Builder is directly proportionate to number of open project.&lt;/font&gt;&lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Verdana&quot;&gt;&lt;i&gt;&lt;u&gt;Don&#39;t embed too many assets&lt;/u&gt;&lt;/i&gt;: Project compilation time and size of project SWF file is directly proportionate to number of assets embedded for project. There are two ways to resolve this issues: &lt;ol&gt;&lt;li&gt;&lt;font face=&quot;Verdana&quot;&gt;Use resource bundled for embedded assets&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font face=&quot;Verdana&quot;&gt;Assets that need to be embedded for the application can be embedded into a module, which can be then loaded into application at runtime.&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/font&gt;&lt;/li&gt;
   &lt;li&gt;&lt;font face=&quot;Verdana&quot;&gt;&lt;i&gt;&lt;u&gt;Turn-off &lt;b&gt;Copy non-embedded file to output folder&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;: This option is available under Flex Compiler option of Properties panel. If turn-on Flex Builder will copy all files including one which will be never referenced into build folder of application. This action is waste of compilation time. &lt;/font&gt;&lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Verdana&quot;&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;Clean&lt;/b&gt; your project&lt;/u&gt;&lt;/i&gt;: When this command is executed for project Flex Builder will reset html-template folder of project along with erasing all the files in debug folder and cleaning cache code i.e., restarting entire project afresh.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;b&gt;&lt;font face=&quot;Verdana&quot;&gt;Eclipse environment tweaks&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Verdana&quot;&gt;Eclipse IDE has several optional command line argument that can used to improve IDE performance. All command line argument are executed when IDE is launched. This command are:&lt;/font&gt;&lt;/p&gt;&lt;ul&gt;      &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;-clean&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt;: This argument flushes the registry cache and clear Eclipse setting and framework.&lt;/font&gt;&lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;-refresh&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt;: This argument instruct Eclipse to refresh the file list in local workspace. This argument is useful if many file changes has occurred between Flex startups or if Flex has shutdown unexpectedly.&lt;/font&gt;&lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;-showlocation&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt;: This argument displays current location of the workspace in window title bar.&lt;/font&gt;&lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;-vmargs&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt;: This argument helps to customize the operation of Java Virtual Machine [JVM] that is use to run Eclipse. The following parameters associated with &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;vmargs&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; argument are used for tweaking memory allocation for JVM&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Courier New&quot;&gt;-Xms[memory]&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Courier New&quot;&gt;-Xmx[memory]&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana&quot;&gt;By default Eclipse will be allocated &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;256MB&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; of Java heap memory. This value can be modify/increase/decrease by assigning appropriate values. &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;-xms&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt;parameter determine minimum assigned memory. &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;-xmx&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt;parameter determine maximum assigned memory. It is advisable to allocate same value for &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;xms&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; and &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;xmx&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; to avoid memory resizing.&lt;/font&gt;&lt;/li&gt;
      &lt;li&gt;&lt;font face=&quot;Courier New&quot;&gt;-XX:MinPermSize=[memory]&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Courier New&quot;&gt;-XX:MaxPermSize=[memory]&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana&quot;&gt;The above arguments are use to set JVM&#39;s &lt;b&gt;PermSpace&lt;/b&gt;, which is the area of memory use to store data structure and class information in real-time. By default Eclipse will be allocated &lt;/font&gt; &lt;font face=&quot;Courier New&quot;&gt;64MB&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; of memory space. Setting &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;MinPermSize&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; and &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;MaxPermSize&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; to &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;128MB&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; or &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;256MB&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt; can solve &lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;OutOfMemoryException&lt;/font&gt;&lt;font face=&quot;Verdana&quot;&gt;.&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;font face=&quot;Verdana&quot;&gt;&lt;b&gt;Note&lt;/b&gt;: Sometime by allocating memory for JVM much more than allowed/supported by system, system will throw an error. In such case decrement the assign value a little and try again. &lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;font face=&quot;Verdana&quot;&gt;As recommended, assign as much memory as your system will allow to JVM, this will enable your workbench to run as efficiently as possible.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;font face=&quot;Verdana&quot;&gt;Above Eclipse environment tweaks can be achieve by modifying &lt;b&gt;FlexBuilder.ini&lt;/b&gt; or by using the arguments in shortcut for launching the Flex builder.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Verdana&quot;&gt;Under normal circumstances &lt;i&gt;target&lt;/i&gt; field under shortcut panel of Flex Builder will look like&lt;/font&gt;&lt;/p&gt;&lt;font face=&quot;Verdana&quot;  color=&#39;#000000&#39;&gt;&lt;br /&gt;
 &lt;table border=&quot;1&quot; width=&quot;100%&quot; style=&quot;border-left-width: 0px; border-top-width: 0px; border-bottom-width: 0px&quot;&gt;    &lt;tr&gt;
    &lt;td style=&quot;border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium&quot; bgcolor=&quot;#C0C0C0&quot;&gt;Target&lt;/td&gt;
    &lt;td style=&quot;border-style: solid; border-width: 1px&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;quot;C:\Program Files\Adobe\Flex Builder 3\FlexBuilder.exe&amp;quot;&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;
 &lt;/table&gt;&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;&lt;font face=&quot;Verdana&quot;&gt;In case if you want to display location of current project and increase memory allocated to JVM to 512MB then&lt;i&gt;target&lt;/i&gt; field under shortcut panel of Flex Builder will look like&lt;/font&gt;&lt;/p&gt;&lt;font face=&quot;Verdana&quot;  color=&#39;#000000&#39;&gt;&lt;br /&gt;
 &lt;table border=&quot;1&quot; width=&quot;100%&quot; style=&quot;border-left-width: 0px; border-top-width: 0px; border-bottom-width: 0px&quot;&gt;    &lt;tr&gt;
    &lt;td style=&quot;border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium&quot; bgcolor=&quot;#C0C0C0&quot;&gt;Target&lt;/td&gt;
    &lt;td style=&quot;border-style: solid; border-width: 1px&quot; bgcolor=&quot;#C0C0C0&quot;&gt;&lt;font face=&quot;Courier New&quot;&gt;&amp;quot;C:\Program Files\Adobe\Flex Builder 3\FlexBuilder.exe&amp;quot; -showlocation -vmargs -Xmx512m -Xms512m&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;
 &lt;/table&gt;&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;When you open the &lt;b&gt;FlexBuilder.ini&lt;/b&gt; file, it looks like&lt;/p&gt;&lt;font face=&quot;Courier New&quot; color=&#39;#000000&#39;&gt;&lt;br /&gt;
 &lt;table border=&quot;0&quot; width=100% &gt;    &lt;tr&gt;
    &lt;td width=30 align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;1&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;-vmargs&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;2&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;-Xms256m&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;3&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;-Xmx256m&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;4&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;-XX:MaxPermSize=256m&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;5&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;-XX:PermSize=64m&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;6&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;-Djava.net.preferIPv4Stack=true&lt;/td&gt;
    &lt;/tr&gt;
 &lt;/table&gt;&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;Add &lt;font face=&quot;Courier New&quot;&gt;clean&lt;/font&gt;, &lt;font face=&quot;Courier New&quot;&gt;refresh&lt;/font&gt; or &lt;font face=&quot;Courier New&quot;&gt;showlocation&lt;/font&gt; argument prior to &lt;font face=&quot;Courier New&quot;&gt;vmargs&lt;/font&gt; argument in &lt;b&gt;FlexBuilder.ini&lt;/b&gt; file. In case if you want to display location of current project then &lt;b&gt;FlexBuilder.ini&lt;/b&gt; file after update will look like&lt;/p&gt;&lt;font face=&quot;Courier New&quot; color=&#39;#000000&#39;&gt;&lt;br /&gt;
 &lt;table border=&quot;0&quot; width=100% &gt;    &lt;tr&gt;
    &lt;td width=30 align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;1&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;-showlocation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;2&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;-vmargs&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;3&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;-Xms256m&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;4&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;-Xmx256m&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;5&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;-XX:MaxPermSize=256m&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;6&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#FFFFFF&quot;&gt;-XX:PermSize=64m&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td align=&quot;center&quot; style=&quot;border-right-style: solid; border-right-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;7&lt;/td&gt;
    &lt;td style=&quot;border-left-style: solid; border-left-width: 1px&quot; bgcolor=&quot;#E6E6E6&quot;&gt;-Djava.net.preferIPv4Stack=true&lt;/td&gt;
    &lt;/tr&gt;
 &lt;/table&gt;&lt;/font&gt;&lt;br /&gt;
&lt;p&gt;The &lt;b&gt;FlexBuilder.ini&lt;/b&gt; file should be in your Flex Builder install folder.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/7682097711095471049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/flex-builder-3-optimizing-flex-builder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/7682097711095471049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/7682097711095471049'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/flex-builder-3-optimizing-flex-builder.html' title='Flex Builder 3: Optimizing Flex Builder Performance'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-748348560604106246.post-3777400289951447042</id><published>2010-05-05T23:22:00.004+05:30</published><updated>2010-05-06T00:03:58.958+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ActionScript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><title type='text'>The undocumented [SWF] Metadata Tag</title><content type='html'>&lt;span style=&quot;font-family: Verdana;&quot;&gt;In Flash authoring environment, developer can control actual width, height, frame rate properties of SWF. But in Flex project, these setting can be configured as a properties of &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;Application&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt; MXML tag. Where as in ActionScript project using Flex Builder, this complier setting can be configured using undocumented [SWF] metadata.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;[SWF(width=&#39;1024&#39;, height=&#39;768&#39;, frameRate=&#39;24&#39; backgroundColor=&#39;#CCCCCC&#39;)]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;Following are the list of properties that can be set using undocumented [SWF] Metadata &lt;/span&gt; &lt;br /&gt;
&lt;table border=&quot;true&quot; cellpadding=&quot;3&quot; cellspacing=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th align=&quot;center&quot; style=&quot;border-style: solid; border-width: 1px;&quot; valign=&quot;middle&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Property&lt;/span&gt;&lt;/th&gt;&lt;th align=&quot;center&quot; style=&quot;border-style: solid; border-width: 1px;&quot; valign=&quot;middle&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;backgroundColor&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;This property is use to set background color of the stage.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;pageTitle&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;String used to represent the title of HTML page&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;frameRate&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;This property is use to set frame rate of SWF file&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;width&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;This property is use to set the width of stage&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;height&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;This property is use to set the height of stage&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;widthPercentage&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;This property is use to set the width of stage with respect to inner&lt;br /&gt;
browser width.&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;b&gt;Note&lt;/b&gt;: Value specified for this property needs to be appended by &#39;&lt;b&gt;&lt;i&gt;%&lt;/i&gt;&lt;/b&gt;&#39; sign.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;heightPercentage&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;This property is use to set the height of stage with respect to inner browser height.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;b&gt;Note&lt;/b&gt;: Value specified for this property needs to be appended by &#39;&lt;i&gt;&lt;b&gt;%&lt;/b&gt;&lt;/i&gt;&#39; sign.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;scriptRecursionLimit&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;The maximum depth or stack overflow limit of flash player, i.e., number of time a recursive script will run before flash player stops.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;scriptTimeLimit&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border-style: solid; border-width: 1px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Maximum duration, in seconds, that an ActionScript event listener can execute before Flash Player assume that it has stopped processing and abort it. The default value is &lt;b&gt;&lt;i&gt;60 second&lt;/i&gt;&lt;/b&gt;, which is also the maximum allowable value.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;These properties convey instruction to Flex compiler about how to publish SWF application. &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;backgroundColor&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;pageTitle&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;widthPercentage&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;heightPercentage&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt; properties are used by Flex compiler for creating HTML wrapper, while &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;widthPercentage&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;heightPercentage&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;scriptRecursionLimit&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;scriptTimeLimit&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;properties are used by Flex compiler for creating of SWF.&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;b&gt;Note&lt;/b&gt;: Some of this properties can also be configure via compiler option in project properties settings.&lt;/span&gt;&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://patelgaurav.blogspot.com/feeds/3777400289951447042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/undocumented-swf-metadata-tag.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/3777400289951447042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/748348560604106246/posts/default/3777400289951447042'/><link rel='alternate' type='text/html' href='http://patelgaurav.blogspot.com/2010/05/undocumented-swf-metadata-tag.html' title='The undocumented [SWF] Metadata Tag'/><author><name>Gaurav Manoj Patel</name><uri>http://www.blogger.com/profile/16502652399993081285</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>