<?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: Custom Flex 3 Lightweight Preloader with source code</title>
	<atom:link href="http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<pubDate>Fri, 09 Jan 2009 09:42:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Sasha Dzeletovic</title>
		<link>http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/#comment-4363</link>
		<dc:creator>Sasha Dzeletovic</dc:creator>
		<pubDate>Wed, 03 Dec 2008 20:36:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1101#comment-4363</guid>
		<description>Thanks Kalluru,
I haven't tried this in AIR but right of the top of my mind I would think something similar could work. Main difference that I foresee is that in AIR we are not loading but mostly initializing. I will get to it when time permits and update to this post on that topic.

Cheers!</description>
		<content:encoded><![CDATA[<p>Thanks Kalluru,<br />
I haven&#8217;t tried this in AIR but right of the top of my mind I would think something similar could work. Main difference that I foresee is that in AIR we are not loading but mostly initializing. I will get to it when time permits and update to this post on that topic.</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sasha Dzeletovic</title>
		<link>http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/#comment-4362</link>
		<dc:creator>Sasha Dzeletovic</dc:creator>
		<pubDate>Wed, 03 Dec 2008 20:33:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1101#comment-4362</guid>
		<description>Hi Darina,
Thanks! You can use this preloader in your applications without any restrictions whatsoever. Also feel free to change it, extend it or whatever else that comes to your mind. Pathfinder logo is copyrighted though :)
</description>
		<content:encoded><![CDATA[<p>Hi Darina,<br />
Thanks! You can use this preloader in your applications without any restrictions whatsoever. Also feel free to change it, extend it or whatever else that comes to your mind. Pathfinder logo is copyrighted though <img src='http://www.pathf.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darina</title>
		<link>http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/#comment-4286</link>
		<dc:creator>Darina</dc:creator>
		<pubDate>Wed, 26 Nov 2008 19:41:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1101#comment-4286</guid>
		<description>Hi Sasha, 

Thank you for sharing your solution with us!

Can we use your preloader with our logo in our applications? Are there any licenses or restrictions?</description>
		<content:encoded><![CDATA[<p>Hi Sasha, </p>
<p>Thank you for sharing your solution with us!</p>
<p>Can we use your preloader with our logo in our applications? Are there any licenses or restrictions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kalluru</title>
		<link>http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/#comment-4099</link>
		<dc:creator>kalluru</dc:creator>
		<pubDate>Wed, 12 Nov 2008 13:58:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1101#comment-4099</guid>
		<description>Hi,
    Thanks for proving such a beatiful component code,I am trying to use this preloader for AIR application its not working and its perfectly working for Web app's.Pls clarify me that preloder concept will work for AIr,if possible provide some sample.

Thanks &#38; Regards
Kalluru</description>
		<content:encoded><![CDATA[<p>Hi,<br />
    Thanks for proving such a beatiful component code,I am trying to use this preloader for AIR application its not working and its perfectly working for Web app&#8217;s.Pls clarify me that preloder concept will work for AIr,if possible provide some sample.</p>
<p>Thanks &amp; Regards<br />
Kalluru</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sasha Dzeletovic</title>
		<link>http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/#comment-3272</link>
		<dc:creator>Sasha Dzeletovic</dc:creator>
		<pubDate>Tue, 02 Sep 2008 19:14:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1101#comment-3272</guid>
		<description>Hi Sander,
To the best of my knowledge it is not possible call a method within a swf file while it's loading because it doesn't exist yet. Having the preloader in the swf that you are trying to load defies the purpose because your swf would need to load before showing your the preloader.

You do not need to do that at all because there are other ways around this. 
In my experience, it is best to keep the preloader extracted so you can call on it anytime for anything and reuse it. 

Your scenario could look something like this:
- You have a base file. It's a default MXML. 
- In your project, you have a component that will act as your preloader and is loaded together with your application.
- You have an external swf that you want to load after your app has loaded.

From that starting point we go to code in base file (imports not included):

//loader that will track the progress
private var myLoader:Loader;
//your custom preloader component
public var myPreloader:Speedometer;

//create your preloader and call the loading of the external swf file
private function getSwf():void
{
    //create your new preloader component
    myPreloader = new Speedometer();
    //position it where ever you want and set any other parameters you want
    myPreloader.x = 100;
    myPreloader.y = 100;
    //add your preloader to stage
    addChild(myPreloader)
    
    //create your loader
    myLoader = new Loader();
    //create a new URLRequest to use as with Loader
    var mySwfURL:URLRequest = new URLRequest("URL_of_my_swf.swf");
    //attach a listener to loader so you can track the progress using it
    myLoader.addEventListener(ProgressEvent.PROGRESS, trackProgress);
    //start loading
    myLoader.load(mySwfURL);
}

//trackProgress is attached to the listener and is being passed "progress" parameters in event parameter
private function trackProgress(event:ProgressEvent):void
{
    //this is where you can pass the progress to your custom preloader
    myPreloader.setPercentageLoaded(event.bytesLoaded / event.bytesTotal * 100 );
    //if the swf has loaded, remove your listener and custom preloader from the stage
    if(event.bytesLoaded == event.bytesTotal)
    {
        myLoader.removeEventListener(ProgressEvent.PROGRESS, trackProgress);
        removeChild(myPreloader)
    }
}</description>
		<content:encoded><![CDATA[<p>Hi Sander,<br />
To the best of my knowledge it is not possible call a method within a swf file while it&#8217;s loading because it doesn&#8217;t exist yet. Having the preloader in the swf that you are trying to load defies the purpose because your swf would need to load before showing your the preloader.</p>
<p>You do not need to do that at all because there are other ways around this.<br />
In my experience, it is best to keep the preloader extracted so you can call on it anytime for anything and reuse it. </p>
<p>Your scenario could look something like this:<br />
- You have a base file. It&#8217;s a default MXML.<br />
- In your project, you have a component that will act as your preloader and is loaded together with your application.<br />
- You have an external swf that you want to load after your app has loaded.</p>
<p>From that starting point we go to code in base file (imports not included):</p>
<p>//loader that will track the progress<br />
private var myLoader:Loader;<br />
//your custom preloader component<br />
public var myPreloader:Speedometer;</p>
<p>//create your preloader and call the loading of the external swf file<br />
private function getSwf():void<br />
{<br />
    //create your new preloader component<br />
    myPreloader = new Speedometer();<br />
    //position it where ever you want and set any other parameters you want<br />
    myPreloader.x = 100;<br />
    myPreloader.y = 100;<br />
    //add your preloader to stage<br />
    addChild(myPreloader)</p>
<p>    //create your loader<br />
    myLoader = new Loader();<br />
    //create a new URLRequest to use as with Loader<br />
    var mySwfURL:URLRequest = new URLRequest(&#8221;URL_of_my_swf.swf&#8221;);<br />
    //attach a listener to loader so you can track the progress using it<br />
    myLoader.addEventListener(ProgressEvent.PROGRESS, trackProgress);<br />
    //start loading<br />
    myLoader.load(mySwfURL);<br />
}</p>
<p>//trackProgress is attached to the listener and is being passed &#8220;progress&#8221; parameters in event parameter<br />
private function trackProgress(event:ProgressEvent):void<br />
{<br />
    //this is where you can pass the progress to your custom preloader<br />
    myPreloader.setPercentageLoaded(event.bytesLoaded / event.bytesTotal * 100 );<br />
    //if the swf has loaded, remove your listener and custom preloader from the stage<br />
    if(event.bytesLoaded == event.bytesTotal)<br />
    {<br />
        myLoader.removeEventListener(ProgressEvent.PROGRESS, trackProgress);<br />
        removeChild(myPreloader)<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sander</title>
		<link>http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/#comment-3230</link>
		<dc:creator>Sander</dc:creator>
		<pubDate>Fri, 29 Aug 2008 15:41:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1101#comment-3230</guid>
		<description>Is it possible to load a swf file for preloading and call a function in that swf. 

For instance, I would like to use a kind of speedometer for preloading. I've created a swf that has a 'setPercentageLoaded(percentage)' function in the first frame of the movieclip. This function rotates the dial of the speedometer based on the percentage loaded.

I've been trying to accomplish this, but embedding swf files causes the function to be unreachable.

Any help would me most appreciated.

Regards,

Sander</description>
		<content:encoded><![CDATA[<p>Is it possible to load a swf file for preloading and call a function in that swf. </p>
<p>For instance, I would like to use a kind of speedometer for preloading. I&#8217;ve created a swf that has a &#8217;setPercentageLoaded(percentage)&#8217; function in the first frame of the movieclip. This function rotates the dial of the speedometer based on the percentage loaded.</p>
<p>I&#8217;ve been trying to accomplish this, but embedding swf files causes the function to be unreachable.</p>
<p>Any help would me most appreciated.</p>
<p>Regards,</p>
<p>Sander</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roamer</title>
		<link>http://www.pathf.com/blogs/2008/08/custom-flex-3-lightweight-preloader-with-source-code/#comment-3106</link>
		<dc:creator>roamer</dc:creator>
		<pubDate>Fri, 22 Aug 2008 10:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1101#comment-3106</guid>
		<description>Very nice !!Thank you !</description>
		<content:encoded><![CDATA[<p>Very nice !!Thank you !</p>
]]></content:encoded>
	</item>
</channel>
</rss>
