<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ria-coder.com &#187; ActionScript 3.0</title>
	<atom:link href="http://ria-coder.com/blog/category/actionscript/actionscript-3-0/feed" rel="self" type="application/rss+xml" />
	<link>http://ria-coder.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 21 Apr 2010 19:35:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Accessing services-config.xml values from Flex at runtime</title>
		<link>http://ria-coder.com/blog/accessing-services-config-values-with-flex</link>
		<comments>http://ria-coder.com/blog/accessing-services-config-values-with-flex#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:24:58 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[serverconfig]]></category>
		<category><![CDATA[services-config]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=545</guid>
		<description><![CDATA[Recently I found this magic class in the Flex 3 SDK called ServerConfig.]]></description>
			<content:encoded><![CDATA[<p>Recently I found this magic class in the Flex 3 SDK called <a title="ServerConfig" href="http://www.adobe.com/livedocs/flex/3/langref/mx/messaging/config/ServerConfig.html" target="_blank">ServerConfig</a>. This class is great&#8230; What it allows you to do is access values that you defined in your <em>services-config.xml</em> file used to define the communication channels between Flex and your server.</p>
<p>Take the following <em>services-config.xml</em> file for example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;services-config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;services<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;amfphp-flashremoting-service&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;flex.messaging.services.RemotingService&quot;</span></span>
<span style="color: #009900;">				<span style="color: #000066;">messageTypes</span>=<span style="color: #ff0000;">&quot;flex.messaging.messages.RemotingMessage&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;amfphp&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;my-amfphp&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/properties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/destination<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/services<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;channel-definition</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;my-amfphp&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;mx.messaging.channels.AMFChannel&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;endpoint</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;gateway.php&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;flex.messaging.endpoints.AMFEndpoint&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channel-definition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/channels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/services-config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>As you can see, we&#8217;re setting the endpoint for our <em>my-amfphp</em> channel to <strong>gateway.php</strong>. What if you wanted to read that value into your Flex application? You could use the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>ServerConfig<span style="color: #000066; font-weight: bold;">.</span>getChannel<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;my-amfphp&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>endpoint<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>Check out the <a title="ServerConfig" href="http://www.adobe.com/livedocs/flex/3/langref/mx/messaging/config/ServerConfig.html" target="_blank">ServerConfig</a> for more information!</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/accessing-services-config-values-with-flex/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>AMFPHP is back!</title>
		<link>http://ria-coder.com/blog/amfphp-is-back</link>
		<comments>http://ria-coder.com/blog/amfphp-is-back#comments</comments>
		<pubDate>Tue, 02 Feb 2010 13:29:49 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[amfphp]]></category>
		<category><![CDATA[amfphp 1.9]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=541</guid>
		<description><![CDATA[AMFPHP is back!]]></description>
			<content:encoded><![CDATA[<p>Today is a wonderful day!</p>
<p>I have teamed up with <a title="Ariel Sommeria" href="http://arielsommeria.com/blog/" target="_blank">Ariel Sommeria-klein</a> to revive the legendary <a title="AMFPHP" href="http://amfphp.sourceforge.net" target="_blank">AMFPHP</a> project that spawned a whole new dimension of Rich Internet Applications. Together we have brought <a title="AMFPHP 1.9" href="https://sourceforge.net/projects/amfphp/files/#files" target="_blank">AMFPHP 1.9</a> out of beta and made it compatible with PHP 5.3. We have also completely rewritten the AMFPHP service browser and we have several improvements planned for AMFPHP 2.0.</p>
<p>If you would like to help contribute to this great open-source application, please <a title="Contact Us!" href="http://amfphp.sourceforge.net/contact.html" target="_blank">contact us</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/amfphp-is-back/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Truly Cached Flex Modules</title>
		<link>http://ria-coder.com/blog/truly-cached-flex-modules</link>
		<comments>http://ria-coder.com/blog/truly-cached-flex-modules#comments</comments>
		<pubDate>Sun, 31 Jan 2010 19:56:14 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[modules]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=532</guid>
		<description><![CDATA[I was working on a project recently and I discovered (or possibly misunderstood - see disclaimer) that Flex does not cache modules correctly, or - at the very least - it does not do it effectively according to my tests.]]></description>
			<content:encoded><![CDATA[<p>I was working on a project recently and I discovered (or possibly misunderstood &#8211; see disclaimer) that Flex does <strong>not</strong> cache modules correctly, or &#8211; at the very least &#8211; it does not do it effectively according to my tests.</p>
<p><em>My test was conducted using Flex SDK <strong>3.4.0.9271, </strong>Firefox <strong>3.5.7 </strong>and <strong>Flex Builder Professional 3.0.214193</strong></em></p>
<p>According to <a title="Adobe LiveDocs" href="http://livedocs.adobe.com/flex/3/html/help.html?content=modular_5.html" target="_blank">this</a> page (under the <strong>Preloading modules</strong> heading), Adobe asserts the following:</p>
<blockquote><p>When a module is loaded by the Flex application for the first time, the module&#8217;s SWF file is transferred across the network and stored in the browser&#8217;s cache. If the Flex application unloads that module, but then later reloads it, there should be less wait time because Flash Player loads the module from the cache rather than across the network.</p>
<p>Module SWF files, like all SWF files, reside in the browser&#8217;s cache unless and until a user clears them. As a result, modules can be loaded by the main application across several sessions, reducing load time; but this depends on how frequently the browser&#8217;s cache is flushed.</p></blockquote>
<p>I found the above claims to be demonstrably false, or at least just plain inefficient&#8230;</p>
<p>Let me qualify this:<br />
According to my tests (conducted with my Firefox browser cache turned both on and off), i found that the application&#8217;s memory usage keeps growing exponentially when switching between two loaded modules. There was a variance (as you&#8217;d imagine) when the browser cache was left on but nonetheless, the memory usage keeps growing steadily.</p>
<p>In the code sample below, I have extended the functionality of the <strong>mx.modules.ModuleLoader</strong> class, and added a Dictionary (with a little logic) to manage the (ostensibly) effective caching of previously loaded modules. I have not tested this class extensively, but all the tests that I conducted seemed to produce a significant memory and speed improvement.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">DisplayObject</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">DisplayObjectContainer</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ByteArray</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Dictionary</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>FlexEvent<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>events<span style="color: #000066; font-weight: bold;">.</span>ModuleEvent<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>modules<span style="color: #000066; font-weight: bold;">.</span>IModuleInfo<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>modules<span style="color: #000066; font-weight: bold;">.</span>ModuleLoader<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>modules<span style="color: #000066; font-weight: bold;">.</span>ModuleManager<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * This class manages the loading, unloading and caching of Flex Modules
	 * This is a modified version of the mx.modules.ModuleLoader class
	 *
	 * @author Danny Kopping - danny@ria-coder.com
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> CachedModuleLoader <span style="color: #0033ff; font-weight: bold;">extends</span> ModuleLoader
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Dictionary</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Dictionary</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _url<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> module<span style="color: #000066; font-weight: bold;">:</span>IModuleInfo<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> loadRequested<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CachedModuleLoader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">url</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> == _url<span style="color: #000000;">&#41;</span>
				<span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>module<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PROGRESS</span><span style="color: #000066; font-weight: bold;">,</span> moduleProgressHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span>SETUP<span style="color: #000066; font-weight: bold;">,</span> moduleSetupHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span>READY<span style="color: #000066; font-weight: bold;">,</span> moduleReadyHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ERROR</span><span style="color: #000066; font-weight: bold;">,</span> moduleErrorHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">UNLOAD</span><span style="color: #000066; font-weight: bold;">,</span> moduleUnloadHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				<span style="color: #009900; font-style: italic;">//module.release();</span>
				module = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span>
				<span style="color: #000000;">&#123;</span>
					<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #009900; font-style: italic;">//child = null;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			_url = <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FlexEvent<span style="color: #000000;">&#40;</span>FlexEvent<span style="color: #000066; font-weight: bold;">.</span>URL_CHANGED<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			removeAllChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_url <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000066; font-weight: bold;">&amp;&amp;</span> loadRequested<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span><span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
					loadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #0033ff; font-weight: bold;">else</span>
				<span style="color: #000000;">&#123;</span>
&nbsp;
					<span style="color: #004993;">child</span> = <span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
					<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">get</span> <span style="color: #004993;">url</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> _url<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> createComponentsFromDescriptors<span style="color: #000000;">&#40;</span>recurse<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000066; font-weight: bold;">.</span>createComponentsFromDescriptors<span style="color: #000000;">&#40;</span>recurse<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			loadRequested = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
			loadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> loadModule<span style="color: #000000;">&#40;</span><span style="color: #004993;">url</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> bytes<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">url</span> <span style="color: #000066; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
				_url = <span style="color: #004993;">url</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_url == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #009900; font-style: italic;">//trace(&quot;loadModule() - null url&quot;);</span>
				<span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #009900; font-style: italic;">//trace(&quot;loadModule() - already created the child&quot;);</span>
				<span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>module<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #009900; font-style: italic;">//trace(&quot;loadModule() - load already initiated&quot;);</span>
				<span style="color: #0033ff; font-weight: bold;">return</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FlexEvent<span style="color: #000000;">&#40;</span>FlexEvent<span style="color: #000066; font-weight: bold;">.</span>LOADING<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			module = ModuleManager<span style="color: #000066; font-weight: bold;">.</span>getModule<span style="color: #000000;">&#40;</span>_url<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PROGRESS</span><span style="color: #000066; font-weight: bold;">,</span> moduleProgressHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span>SETUP<span style="color: #000066; font-weight: bold;">,</span> moduleSetupHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span>READY<span style="color: #000066; font-weight: bold;">,</span> moduleReadyHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ERROR</span><span style="color: #000066; font-weight: bold;">,</span> moduleErrorHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">UNLOAD</span><span style="color: #000066; font-weight: bold;">,</span> moduleUnloadHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">applicationDomain</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> bytes<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> unloadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span> <span style="color: #000066; font-weight: bold;">&amp;&amp;</span> <span style="color: #004993;">contains</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #004993;">child</span> = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>module<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PROGRESS</span><span style="color: #000066; font-weight: bold;">,</span> moduleProgressHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span>SETUP<span style="color: #000066; font-weight: bold;">,</span> moduleSetupHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span>READY<span style="color: #000066; font-weight: bold;">,</span> moduleReadyHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ERROR</span><span style="color: #000066; font-weight: bold;">,</span> moduleErrorHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">unload</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span>ModuleEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">UNLOAD</span><span style="color: #000066; font-weight: bold;">,</span> moduleUnloadHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				module = <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">delete</span> <span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span>_url<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleProgressHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleSetupHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900; font-style: italic;">// Not ready for creation yet, but can call factory.info().</span>
&nbsp;
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleReadyHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">child</span> = module<span style="color: #000066; font-weight: bold;">.</span>factory<span style="color: #000066; font-weight: bold;">.</span>create<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">DisplayObject</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> p<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">DisplayObjectContainer</span> = <span style="color: #004993;">parent</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #009900; font-style: italic;">// p.removeChild(this);</span>
				<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">child</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
				<span style="color: #004993;">map</span><span style="color: #000000;">&#91;</span><span style="color: #004993;">url</span><span style="color: #000000;">&#93;</span> = <span style="color: #004993;">child</span><span style="color: #000066; font-weight: bold;">;</span><span style="color: #009900; font-style: italic;">//ModuleManager.getModule(_url);</span>
				<span style="color: #009900; font-style: italic;">//trace(map + &quot;:&quot; + url + &quot;:&quot; + map[url]);</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleErrorHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			unloadModule<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> moduleUnloadHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ModuleEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>The usage of this class is exactly the same as the regular <strong>mx.modules.ModuleLoader</strong> class. I hope this helps!</p>
<p><strong>Download this file:</strong> <a href="http://ria-coder.com/blog/wp-content/uploads/2010/01/CachedModuleLoader.as">Download</a></p>
<p><strong>**DISCLAIMER**<br />
<span style="font-weight: normal; ">I know a bit about Flex modules from hours of obsessing over them, but i <span style="text-decoration: underline;">do not know everything</span>. From my tests of the efficacy of the above code &amp; explanation, i found that it reduces memory usage and increases the general usability of my Flex project; i could be very wrong on this topic, and if i am &#8211; please tell me. Maybe i&#8217;m just an idiot, but it seems to work&#8230;</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/truly-cached-flex-modules/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using a Custom Cursor in Flex with CSS</title>
		<link>http://ria-coder.com/blog/using-a-custom-cursor-in-flex-with-css</link>
		<comments>http://ria-coder.com/blog/using-a-custom-cursor-in-flex-with-css#comments</comments>
		<pubDate>Wed, 16 Dec 2009 21:54:22 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=511</guid>
		<description><![CDATA[Learn how to define a custom Flex busy cursor in pure CSS]]></description>
			<content:encoded><![CDATA[<p>If you want to use a custom <em>busyCursor</em> animation in your Flex applications, you don&#8217;t need to do anything fancy&#8230; All you have to do is define one, solitary property in your CSS file:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">CursorManager
<span style="color: #00AA00;">&#123;</span>
	<span style="color: #808080; font-style: italic;">/* You can use PNGs, SWFs or JPEGs */</span>
	busyCursor<span style="color: #00AA00;">:</span> Embed<span style="color: #00AA00;">&#40;</span>source<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;path/to/your/resource&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>
To invoke the busy cursor, use the following line:<br />
</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">CursorManager.<span style="color: #006600;">setBusyCursor</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>&#8230;or you could set the <em>showBusyCursor</em> to <strong>true</strong> in your HTTPService or RemoteObject instances.</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/using-a-custom-cursor-in-flex-with-css/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AMFPHP Genie v0.2</title>
		<link>http://ria-coder.com/blog/amfphp-genie-02</link>
		<comments>http://ria-coder.com/blog/amfphp-genie-02#comments</comments>
		<pubDate>Sun, 13 Dec 2009 23:35:56 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[amfphp]]></category>
		<category><![CDATA[amfphp genie]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=505</guid>
		<description><![CDATA[AMFPHP Genie (0.2) is a simple tool to help you get shit done using Flex and AMFPHP.]]></description>
			<content:encoded><![CDATA[<p>AMFPHP Genie (0.2) is a simple tool to help you get shit done using Flex and AMFPHP.</p>
<p>Check out <a title="AMFPHP Genie" href="http://dannykopping.co.za/amfphp-genie/">http://dannykopping.co.za/amfphp-genie/</a> for more information!</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/amfphp-genie-02/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>QuickTip: asSQL Connection Problem with non-localhost hostname</title>
		<link>http://ria-coder.com/blog/assql-connection-problem-with-non-localhost-hostname</link>
		<comments>http://ria-coder.com/blog/assql-connection-problem-with-non-localhost-hostname#comments</comments>
		<pubDate>Sat, 12 Dec 2009 22:58:26 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[assql]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=488</guid>
		<description><![CDATA[Read this post to fix that annoying error with asSQL when trying to connect to remote MySQL installations]]></description>
			<content:encoded><![CDATA[<p><a title="asSQL" href="http://code.google.com/p/assql/">asSQL</a> is just great. It&#8217;s an ActionScript 3.0 library  for connecting AIR applications to MySQL databases and it works brilliantly &#8211; when it works! Recently i gave it a shot again after an utter failure the last time i tried it&#8230; The library seems to be a port of the Java implementation of connecting to MySQL (<em>Connections, Statements, Fields, etc</em>). It takes a little getting used to but it&#8217;s an excellent library and i highly recommend it.<br />
<br />
<h2>Background</h2>
<p>My development environment is Windows-based (against my wishes&#8230; not enough loot or motivation for a Mac, lack of Adobe software on Linux) but i make up for this by running a virtual Linux installation in my Windows environment and networking the two together. It actually works really well, and the process for setting this up can be found <a title="Ubuntu + Windows" href="http://www.simonholywell.com/computing/internet/a-good-windows-development-environment-and-ubuntu-virtualbox.html">here</a>. To cut a very long and boring story short, essentially i cannot use <em>localhost</em> as your server when using this architecture since i have my LAMPP stack running on my Linux environment, so my &#8220;local server&#8221; can only be accessed using the IP address of the virtual system.</p>
<p>This complicates things a bit when trying to use asSQL to connect to my MySQL installation, because MySQL gets all paranoid and won&#8217;t accept connections from a foreign IP address (the IP of my Windows machine on which my AIR app is running)&#8230; To get around this, all you have to do is create a new user in MySQL (i used <a title="phpMyAdmin" href="http://phpmyadmin.net">phpMyAdmin</a>), set the user&#8217;s hostname to the IP address of your remote system (i&#8217;ve explained how to do this below) and you&#8217;re ready to rock and roll!<br />
<br />
<h2>Solution</h2>
<p>The first thing you need to do is get the IP address of the remote system&#8230;</p>
<p><strong>Windows: </strong>Open the command line, type <em>ipconfig<br />
<strong><span style="font-style: normal;">Linux</span><span style="font-weight: normal;"> </span><span style="font-style: normal;">&amp; Mac: <span style="font-weight: normal;">Open the terminal, type <em>ifconfig</em></span></span></strong></em></p>
<p><strong><span style="font-weight: normal;">In this example, my IP address is </span>192.168.56.1</strong></p>
<p>I&#8217;ll be using phpMyAdmin to fix the problem.</p>
<ol>
<li>Open phpMyAdmin and click on the <strong>Privileges</strong> tab.</li>
<li>Click <strong>Add a new User</strong></li>
<li>Enter any username you like, paste the IP address obtained in the <strong>Host</strong> field and put in a password</li>
<li>Under the <em>Database for user</em> panel, leave it at <strong>None</strong></li>
<li>Under the <em>Global privileges</em>, you can <strong>Check All</strong></li>
</ol>
<p>That should sort it out&#8230; Remember, this is <strong>HIGHLY</strong> insecure and should <strong>only be used on development environments and <span style="text-decoration: underline;">NOT</span> production environments.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/assql-connection-problem-with-non-localhost-hostname/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing that annoying feature of List controls</title>
		<link>http://ria-coder.com/blog/fixing-that-annoying-feature-of-list-controls</link>
		<comments>http://ria-coder.com/blog/fixing-that-annoying-feature-of-list-controls#comments</comments>
		<pubDate>Sun, 15 Nov 2009 21:57:07 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[creationPolicy]]></category>
		<category><![CDATA[offscreen]]></category>
		<category><![CDATA[tilelist]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=469</guid>
		<description><![CDATA[Learn how to fix that ever-painful "optimization" feature of Flex's list components]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t you just hate it&#8230; Doesn&#8217;t it just piss you off when you want to display a gallery of images in Flex and Flex decides that it&#8217;s actually going to set it so that when you scroll, it&#8217;ll <em>only</em> <em>then</em> load the images displayed offscreen? I find this particularly &#8220;ball-ache-ish&#8221; with the TileList component.</p>
<p>I was browsing through the documentation like i had many times before, but this time i noticed the <strong>offscreenExtraRowsOrColumns</strong> property. At first you think &#8220;wtf&#8221; but then i got curious&#8230;</p>
<p>Say you have 25 images in a grid that displays one row of 5 images at a time:</p>
<table border="0" width="200">
<tbody>
<tr style="background-color:#C7E811">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>The row in green will be the only row visible at this point in time. When you scroll, Flex will chuck out the first row and create the second row:</p>
<table border="0" width="200">
<tbody>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#C7E811">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color:#DDDDDD">
<td height="10px"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>&#8230;and so on. Isn&#8217;t that just damn irritating? (If you&#8217;re thinking &#8220;nah, what&#8217;s the big deal?&#8221; then you obviously haven&#8217;t tried this before).</p>
<p>Anyway, the way to fix it is to tell Flex how many rows there are offscreen so that it can create them in the interim. This seems like a bit of a weird method because in the navigator classes (ViewStack, et al) there is a <strong>creationPolicy</strong> property which &#8211; when set to &#8220;all&#8221; &#8211; will create all the non-visible components before they&#8217;re navigated to, thus slowing down the processing a bit (depending on your app) but also speeding up the switch between views. Alas, no such property to be found in the TileList component. Can anybody tell me why? I think i should code a modified version of the TileList component to accept this property&#8230; <em>+1 to TODO list&#8230; *sigh*</em></p>
<p>Hopefully this will help those of you experiencing the ball-ache that i did.</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/fixing-that-annoying-feature-of-list-controls/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Belated Announcement</title>
		<link>http://ria-coder.com/blog/a-belated-announcement</link>
		<comments>http://ria-coder.com/blog/a-belated-announcement#comments</comments>
		<pubDate>Wed, 09 Sep 2009 12:01:26 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[danny kopping consulting]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=403</guid>
		<description><![CDATA[Danny Kopping Consulting opens up shop!]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-409" style="margin-right: 10px; margin-bottom: 2px;" title="Danny Kopping Consulting" src="http://ria-coder.com/temp/wp-content/uploads/2009/09/logo-smaller.jpg" alt="Danny Kopping Consulting" width="223" height="210" />Well, it&#8217;s been a week now since i officially left my old employer &#8211; IceBlue InfoTech (which has now been acquired by <a href="http://www.virtuosa.co.za">Virtuosa</a>)&#8230; I decided to start my own freelance consulting, development &amp; training firm, creatively named <strong><a href="http://www.dannykopping.co.za">Danny Kopping Consulting</a>. <span style="font-weight: normal;">Unfortunately, all the cool names were taken, so i went for the one that i knew wouldn&#8217;t be taken <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</span></strong></p>
<p><span style="font-weight: normal;">I&#8217;ll be focusing primarily on building advanced, highly customized Flex-based systems and websites, using PHP, MySQL &amp; Apache on the back-end. I&#8217;ll also be doing some training on the side for Flash &amp; Flex (with a little PHP). Hopefully this freelance venture will pan out well and i&#8217;ll have even less time to muck about than i did before <img src='http://ria-coder.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </span></p>
<p><span style="font-weight: normal;"><br />
</span></p>
<p>A special thanks goes out to my best mate <a href="http://www.ndlh.co.za">Neil de la Harpe</a> for doing all my corporate branding!</p>
<p>I&#8217;ve set up a temporary site over at <a title="Danny Kopping Consulting Website" href="http://www.dannykopping.co.za/" target="_blank">http://www.dannykopping.co.za/</a>. Check it out&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/a-belated-announcement/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flex font embedding nightmare</title>
		<link>http://ria-coder.com/blog/flex-font-embedding-nightmare</link>
		<comments>http://ria-coder.com/blog/flex-font-embedding-nightmare#comments</comments>
		<pubDate>Tue, 08 Sep 2009 19:35:55 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[embedding]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[preloader]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=401</guid>
		<description><![CDATA[There are many things that really irritate me - pretence, dishonesty, blind faith and Flex font embedding! Sometimes it makes me wonder whether i really exist... Ok, that's taking it a bit far, but it really grates my nuts sometimes]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="margin-left: 5px; margin-right: 5px;" title="Doh!" src="http://www.newyorkpersonalinjuryattorneyblog.com/uploaded_images/Doh-712993.jpg" alt="" width="157" height="264" />There are many things that really irritate me &#8211; pretence, dishonesty, blind faith and <strong>Flex font embedding</strong><strong>!</strong> Sometimes it makes me wonder whether i really exist&#8230; Ok, that&#8217;s taking it a bit far, but it really grates my nuts sometimes. I was recently (this evening) working on a website for a production company and i added a custom preloader from Flash (thank you <a title="Custom Preloaders in Flex" href="http://gotoandlearn.com/play?id=108" target="_blank">Mr Brimelow</a>!) to my Flex application. I&#8217;d embedded a font to use for the content in my site and i&#8217;d used the same font for the <em>percentage loaded</em> textfield in the preloader.</p>
<p>So i carried on happily putting the finishing touches on the site when disaster struck! The embedded fonts no longer showed up! I was perplexed&#8230; After about an hour of trying ever single bloody trick in the book and vociferous googling, i found&#8230; <strong>nothing</strong>. The worst part was that <span style="text-decoration: underline;">any other font</span> worked, except the one that i was using for the site, and the client needed that specific font &#8211; no compromise.</p>
<p>As luck would have it, i had a chance brainfart and decided to check my font embedding settings in my Flash preloader. Wouldn&#8217;t you know it&#8230; <strong>Flash was screwing up my fonts! </strong>It&#8217;s no fault of Flash&#8217;s though&#8230; It was embedding the fonts before Flex could, and it was embedding only a handful of glyphs.</p>
<p>So&#8230; Next time your fonts spontaneously stop working in Flex, check out any Flash resources you&#8217;re including in the site to make sure that the font embedding isn&#8217;t pernicious.</p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/flex-font-embedding-nightmare/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash &amp; Flex Developer&#039;s Magazine</title>
		<link>http://ria-coder.com/blog/flash-flex-developers-magazine</link>
		<comments>http://ria-coder.com/blog/flash-flex-developers-magazine#comments</comments>
		<pubDate>Wed, 02 Sep 2009 19:49:25 +0000</pubDate>
		<dc:creator>Danny Kopping</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[amfphp]]></category>
		<category><![CDATA[ffdmag]]></category>

		<guid isPermaLink="false">http://ria-coder.com/blog/?p=386</guid>
		<description><![CDATA[The new version of FFDMag is officially out! The publication is now an online-based magazine, available free of charge to all that want to check it out. Check out my article about Flex &#038; AMFPHP integration on Page 54.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">The new version of FFDMag is officially out! The publication is now an online-based magazine, available free of charge to all that want to check it out.</p>
<p>Check out my article about Flex &amp; AMFPHP integration on Page 54&#8230;</p>
<p style="text-align: center;"><a href="http://www.ffdmag.com"><img class="aligncenter" style="margin-top: 5px; margin-bottom: 5px;" title="FFDMag 5" src="http://ffdmag.com//files/ffdmag/Cover/f&amp;f_magazine_05_2009.jpg" alt="" width="400" height="578" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ria-coder.com/blog/flash-flex-developers-magazine/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

