<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: _global in ActionScript 3</title>
	<atom:link href="http://flashrevolution.net/_global-in-actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://flashrevolution.net/_global-in-actionscript-3/</link>
	<description>Another Singapore Flash User Group</description>
	<pubDate>Fri, 21 Nov 2008 07:03:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: damian stewart</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-307</link>
		<dc:creator>damian stewart</dc:creator>
		<pubDate>Thu, 31 Jul 2008 12:57:37 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-307</guid>
		<description>sorry, the link should be to 
&lt;a href='http://greenethumb.com/article/11/global-variables-in-as3#c000070' rel="nofollow"&gt;http://greenethumb.com/article/11/global-variables-in-as3#c000070&lt;/a&gt;

i only wrote the comment, not the whole article ;-)
d</description>
		<content:encoded><![CDATA[<p>sorry, the link should be to<br />
<a href='http://greenethumb.com/article/11/global-variables-in-as3#c000070' rel="nofollow">http://greenethumb.com/article/11/global-variables-in-as3#c000070</a></p>
<p>i only wrote the comment, not the whole article <img src='http://flashrevolution.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
d</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: damian stewart</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-306</link>
		<dc:creator>damian stewart</dc:creator>
		<pubDate>Thu, 31 Jul 2008 12:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-306</guid>
		<description>hey, 

i posted something about this over here 
&lt;a href='http://greenethumb.com/article/11/global-variables-in-as3' rel="nofollow"&gt;http://greenethumb.com/article/11/global-variables-in-as3&lt;/a&gt;

in short, 'static' is only 'static' to the current swf and its children; it does not propagate up to the root document. you cannot lazily construct a static (singleton) class instance in a child swf you are dynamically loading: it has to be constructed in the root, otherwise you end up with several different 'static' instances that don't know about each other.

more details on my comment &lt;a href='http://greenethumb.com/article/11/global-variables-in-as3' rel="nofollow"&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>hey, </p>
<p>i posted something about this over here<br />
<a href='http://greenethumb.com/article/11/global-variables-in-as3' rel="nofollow">http://greenethumb.com/article/11/global-variables-in-as3</a></p>
<p>in short, &#8217;static&#8217; is only &#8217;static&#8217; to the current swf and its children; it does not propagate up to the root document. you cannot lazily construct a static (singleton) class instance in a child swf you are dynamically loading: it has to be constructed in the root, otherwise you end up with several different &#8217;static&#8217; instances that don&#8217;t know about each other.</p>
<p>more details on my comment <a href='http://greenethumb.com/article/11/global-variables-in-as3' rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [AS3] Global Stage Singleton - Ultrashock Forums</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-28</link>
		<dc:creator>[AS3] Global Stage Singleton - Ultrashock Forums</dc:creator>
		<pubDate>Thu, 20 Mar 2008 02:52:06 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-28</guid>
		<description>[...] you can read more about this here. http://flashrevolution.net/_global-in-actionscript-3/ [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] you can read more about this here. <a href="http://flashrevolution.net/_global-in-actionscript-3/" rel="nofollow">http://flashrevolution.net/_global-in-actionscript-3/</a> [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shang</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-19</link>
		<dc:creator>Shang</dc:creator>
		<pubDate>Wed, 12 Mar 2008 10:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-19</guid>
		<description>Yup, I agree there's some trade off when using _global. So, it's the developer's responsibility of evaluating which method suits the project best. 

It's my pleasure to discuss with you, too!</description>
		<content:encoded><![CDATA[<p>Yup, I agree there&#8217;s some trade off when using _global. So, it&#8217;s the developer&#8217;s responsibility of evaluating which method suits the project best. </p>
<p>It&#8217;s my pleasure to discuss with you, too!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-18</link>
		<dc:creator>kevin</dc:creator>
		<pubDate>Wed, 12 Mar 2008 09:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-18</guid>
		<description>Thank you for taking the time to share your views

Althrough I cant totally agree with the trade off required for the additional flexibility that this class offers

I found this discussion with you refreshing, and I look forward to having more such discussions with you in future</description>
		<content:encoded><![CDATA[<p>Thank you for taking the time to share your views</p>
<p>Althrough I cant totally agree with the trade off required for the additional flexibility that this class offers</p>
<p>I found this discussion with you refreshing, and I look forward to having more such discussions with you in future</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shang</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-16</link>
		<dc:creator>Shang</dc:creator>
		<pubDate>Wed, 12 Mar 2008 08:41:04 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-16</guid>
		<description>The reason of why it's a dynamic class because it can add on any variable. It offers more flexibility than a customized class (be it a singleton class or not). This is designed to be as similar to the "_global" in AS2 as possible. The class is meant to share information, so it should be in the opposite direction of encapsulation. 

I feel the overwriting problem is inevitable because the intention of _global class is to allow both read and write access to some information in anywhere of the system. It's a feature of the class to allow variables to be overwritten and there are scenarios overwriting a variable is a why of solving some problems.</description>
		<content:encoded><![CDATA[<p>The reason of why it&#8217;s a dynamic class because it can add on any variable. It offers more flexibility than a customized class (be it a singleton class or not). This is designed to be as similar to the &#8220;_global&#8221; in AS2 as possible. The class is meant to share information, so it should be in the opposite direction of encapsulation. </p>
<p>I feel the overwriting problem is inevitable because the intention of _global class is to allow both read and write access to some information in anywhere of the system. It&#8217;s a feature of the class to allow variables to be overwritten and there are scenarios overwriting a variable is a why of solving some problems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-15</link>
		<dc:creator>kevin</dc:creator>
		<pubDate>Wed, 12 Mar 2008 07:36:53 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-15</guid>
		<description>hmm,

I do understand the need for the global class to be a singleton, 
but I dont quite get the benefit of making a dynamic singleton class.

From what i know, this implementation goes in the opposite direction of encapsulation

examples of possible problems i see when 2 mutually exclusive subsystems use this class is,
- overwriting of  a variable which  both subsystems use the same name, but are for different intents
- knowledge of the other subsystem, which by right are exclusive to each other [to avoid the first senario]

your implementation of the global class is interesting in its direction, and I would like to better understand when and why you would use this class instead of a normal singleton.

which is why I asked what "what is the difference between the example implementation above, and the singleton pattern used in AS 3"

I apologise for being unclear in my first post.</description>
		<content:encoded><![CDATA[<p>hmm,</p>
<p>I do understand the need for the global class to be a singleton,<br />
but I dont quite get the benefit of making a dynamic singleton class.</p>
<p>From what i know, this implementation goes in the opposite direction of encapsulation</p>
<p>examples of possible problems i see when 2 mutually exclusive subsystems use this class is,<br />
- overwriting of  a variable which  both subsystems use the same name, but are for different intents<br />
- knowledge of the other subsystem, which by right are exclusive to each other [to avoid the first senario]</p>
<p>your implementation of the global class is interesting in its direction, and I would like to better understand when and why you would use this class instead of a normal singleton.</p>
<p>which is why I asked what &#8220;what is the difference between the example implementation above, and the singleton pattern used in AS 3&#8243;</p>
<p>I apologise for being unclear in my first post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shang</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-12</link>
		<dc:creator>Shang</dc:creator>
		<pubDate>Wed, 12 Mar 2008 03:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-12</guid>
		<description>I think there's nothing wrong with _global in AS2. It was just misused in AS2. But in AS3, the story is different. Because it's more strict, _global variables are more reliable. I didn't use much _global variables in AS2 because I can always reference the main file as "_root". But in AS3, "root" is only available for DisplayObject. It's hard to reference something without using something similar to _global. 

It has not to be _global/Global or a separate class. Any static variable in any class can serve the purpose. Since people have already accepted the concept of _global means you can access it everywhere, it would be easier to reuse the concept to elaborate the idea of a static variable. 

The example I implemented uses singleton pattern to make sure there's only one instance of Global. I think it makes sense because it won't be reliable if there are multiple instances.</description>
		<content:encoded><![CDATA[<p>I think there&#8217;s nothing wrong with _global in AS2. It was just misused in AS2. But in AS3, the story is different. Because it&#8217;s more strict, _global variables are more reliable. I didn&#8217;t use much _global variables in AS2 because I can always reference the main file as &#8220;_root&#8221;. But in AS3, &#8220;root&#8221; is only available for DisplayObject. It&#8217;s hard to reference something without using something similar to _global. </p>
<p>It has not to be _global/Global or a separate class. Any static variable in any class can serve the purpose. Since people have already accepted the concept of _global means you can access it everywhere, it would be easier to reuse the concept to elaborate the idea of a static variable. </p>
<p>The example I implemented uses singleton pattern to make sure there&#8217;s only one instance of Global. I think it makes sense because it won&#8217;t be reliable if there are multiple instances.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin</title>
		<link>http://flashrevolution.net/_global-in-actionscript-3/#comment-11</link>
		<dc:creator>kevin</dc:creator>
		<pubDate>Tue, 11 Mar 2008 14:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://flashrevolution.net/_global-in-actionscript-3/#comment-11</guid>
		<description>Hmm, 

personally, i never really liked using "_global" in AS 2,
as I felt it made it harder for others to keep track of the variable due to the variable scope, and that the variable could be accessed without. "_global." prefix.


Just curious, what is the difference between the example implementation above, and the singleton pattern used in AS 3?</description>
		<content:encoded><![CDATA[<p>Hmm, </p>
<p>personally, i never really liked using &#8220;_global&#8221; in AS 2,<br />
as I felt it made it harder for others to keep track of the variable due to the variable scope, and that the variable could be accessed without. &#8220;_global.&#8221; prefix.</p>
<p>Just curious, what is the difference between the example implementation above, and the singleton pattern used in AS 3?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
