Skip navigation
feldin
Currently Being Moderated

flex 4 preloader problem with air

Apr 4, 2010 8:34 AM

Hello,

 

I was trying to delay the preloader just to do some other things before the application fully starts.. Anyway I used this code for my preloader:

package com.somePackage

{

    import flash.events.Event;
    import mx.preloaders.SparkDownloadProgressBar;

    public class Preloader extends SparkDownloadProgressBar
    {
        public function Preloader()
        {
            super();
        }
        override protected function createChildren():void
        {
        }        
        override protected function setDownloadProgress(completed:Number, total:Number):void
        {
        }
        override protected function setInitProgress(completed:Number,total:Number):void
        {
        }
        override protected function initCompleteHandler(event:Event):void
        {
            dispatchEvent(new Event(Event.COMPLETE));
        }
    }
}

 

 

this works but the problem is if i comment the line where i dispatch the complete event ( works on non-air project ) so that the preloader just stays instead of opening the application i get this error in air application:

 

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at spark.components::WindowedApplication/enterFrameHandler()[E:\dev\4.0. 0\frameworks\projects\airspark\src\spark\components\WindowedApplicatio n.as:2350]

 

I would just like to halt the preloader for few moments after the application fully loads to do some other stuff...
any ideas?

 

P.S. for the application I am using <s:WindowedApplication...

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points