Stephen:

I've been messing around with the same thing, it's always nice when 
other people have the same challenges, which means more help.  I've got 
a lot to learn and the following solution might be considered  a bad 
hack, but sometimes what works, works.

Keeping preloader on the screen after intial load means you should look 
at this example how to make a custom one is made first.  i think you 
said you did....

http://www.onflex.org/ted/2006/07/flex-2-preloaders-swf-png-gif-examples.php 
<http://www.onflex.org/ted/2006/07/flex-2-preloaders-swf-png-gif-examples.php>

Of course you can't tell how long your data query is going to take so 
the progress bar is just for the application.
I don't know what you want to do with the progress bar after the 
intitial load, but ok...

I was able to do this from this example and use my custom swf preloader 
with our logo in a swf from this example, thanks ted patrick!

I hope this provides you insight.   if you extend the loader class you 
can do the same thing basically.  
Let me know your results. good luck





<http://www.onflex.org/ted/2006/07/flex-2-preloaders-swf-png-gif-examples.php>

I took Ted's example and hacked it to hell like this:


from the customPreLoaderFile:


    private function FlexInitComplete( event:Event ):void
        {     
            wcs.ready = true;     
            dispatchEvent( new Event( Event.COMPLETE ) );
            Application.application.createWCS(wcs);
        }
       
          private function dispatchMeEvent(wcs:WelcomeScreen):void{
          Application.application.createWCS(wcs);
       
          //this gives me access to this the WelcomeScreen from my main 
application, not
          //the best way but it works fine for me , using my custom 
dispatcher, actually sending
         //  the object to my application so then i can fade it and wait 
for my query to come back
        //   before so. 
       
  }

from the WelcomeScreen.as  i  added a flag for the fadeIn and commented 
out the fadeOut because i want to fade it on my own from my main 
application, if you don't  do this, the loader will be active and fade 
in & out whenever something is loaded.  I don't want to removeChild, i 
want to keep it there, it's small and at the top of
the application and it sits nicely in front of everything and can be 
used for loading images or anything


 public function updateView( event:TimerEvent ):void
        {
            if (_started == false){
               
           
                if( this.alpha < 1)    this.alpha = this.alpha + 
this.fadeInRate;
                this.stage.addChild(this)
           
                this.visible=true;
                   if( this.ready && timer.currentCount > 
this.timeAutoClose ) closeScreen()   
               _started = true;
               }
        }
       


public function closeScreenFade( event:TimerEvent ):void
        {
            /*
            if( this.alpha > 0){
                this.alpha = this.alpha - fadeOutRate;
            } else {
                timer.stop();
          
                //this.parent.removeChild(this);
            }       
            */
        }       


Stephen Gilson wrote:
>
> There is an example in the doc starting here:
>  
> http://livedocs.macromedia.com/flex/2/docs/00000647.html 
> <http://livedocs.macromedia.com/flex/2/docs/00000647.html>
>  
> Stephen
>
> ------------------------------------------------------------------------
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
> *On Behalf Of *Giles Roadnight
> *Sent:* Thursday, December 14, 2006 11:25 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] customising preloader
>
> Hi All
>
> I've been trying to create a custom preloader for my flex app. I want
> to keep the DownloadProgressBar object on the screen when the app has
> finished loading and initialising and then load my own xml
> configuration file.
>
> I've been trying to extend the DownloadProgressBar class and had a
> look at extending the prelaoder class but didn't get very far.
>
> Can anyone point me in the right direction? I did find one example
> that replaced the prelaoder with an image but I couldn't alter this to
> what I want.
>
> I also tried to create my own DownloadProgressBar object and use it to
> display progress of a load after the app has finished initialising but
> this didn't work either.
>
> Unless I can get it to work I'll have to just create my own popup and
> load the xml once hte app has initialised but I'd rather it all
> happens with the 1 popup.
>
> Many Thanks.
>
> Giles Roadnight
>
>  


Reply via email to