<?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>dndigital.net &#187; custom preloader</title>
	<atom:link href="http://dndigital.net/tag/custom-preloader/feed/" rel="self" type="application/rss+xml" />
	<link>http://dndigital.net</link>
	<description>Notes on Adobe Flash, Flex, AIR Development</description>
	<lastBuildDate>Wed, 22 Jun 2011 11:15:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Accessing flashvars in a custom Flex preloader</title>
		<link>http://dndigital.net/2008/08/accessing-flashvars-in-a-custom-flex-preloader/</link>
		<comments>http://dndigital.net/2008/08/accessing-flashvars-in-a-custom-flex-preloader/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 00:24:37 +0000</pubDate>
		<dc:creator>Nils</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[custom preloader]]></category>
		<category><![CDATA[flashvars]]></category>

		<guid isPermaLink="false">http://dndigital.net/blog/?p=3</guid>
		<description><![CDATA[Here&#8217;s a little code snippet that allows you to access flashvar parameters inside a custom Flex preloader. The custom preloader class extends Sprite and implements the IPreloaderDisplay class. Once the Sprite&#8217;s &#8216;root&#8217; property becomes available, you can use the standard AS3 way of accessing flashvars, namely: var flashvars:Object = root.loaderInfo.parameters; This code should be used [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little code snippet that allows you to access flashvar parameters inside a custom Flex preloader.</p>
<p>The custom preloader class extends Sprite and implements the IPreloaderDisplay class. Once the Sprite&#8217;s &#8216;root&#8217; property becomes available, you can use the standard AS3 way of accessing flashvars, namely:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> flashvars:<span style="color: #0066CC;">Object</span> = root.<span style="color: #006600;">loaderInfo</span>.<span style="color: #006600;">parameters</span>;</pre></div></div>

<p>This code should be used once the &#8216;root&#8217; property has been initialised &#8211; for example in the &#8216;initialize()&#8217; method defined by the IPreloaderDisplay interface:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> initialize<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">var</span> flashvars:<span style="color: #0066CC;">Object</span> = root.<span style="color: #006600;">loaderInfo</span>.<span style="color: #006600;">parameters</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Just for reference, compare the above approach with the standard Flex method of accessing flashvar parameters &#8211; which becomes possible once the main Application instance has been created:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> flashvars:<span style="color: #0066CC;">Object</span> = Application.<span style="color: #006600;">application</span>.<span style="color: #006600;">parameters</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dndigital.net/2008/08/accessing-flashvars-in-a-custom-flex-preloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

