Skip navigation
he11f1re
Currently Being Moderated

Mask Preloader Problem !?

Aug 26, 2011 7:16 AM

I have 3 layers in my fla document and I'm trying to build a preloader.

The bottom layer is a vector company logo and it is masked by a rectangle with the same size.

The topmost layer contains the outline of the logo.

So basically I'm trying to animate the filling of the logo while the content loads.

My AS3 code is :

stop();
rectMask_mc.height = 1;
this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, LOADING);
function LOADING(event:ProgressEvent):void {
var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
rectMask_mc.scaleY = pcent;
if(pcent==100){
gotoAndStop("GameLogo");
}
}

When I stimulate Download I get a blank white screen and in the last moments the outline is shown and right after that the content displays.

What is the problem here ?

 
Replies
  • kglad
    62,161 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 26, 2011 7:19 AM   in reply to he11f1re

    what's the size of your swf and how many bytes are exported in frame 1?

     
    |
    Mark as:
  • kglad
    62,161 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 26, 2011 7:43 AM   in reply to he11f1re

    in the test environment click view and tick bandwidth profiler.  check frame 1.

     
    |
    Mark as:
  • kglad
    62,161 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 26, 2011 8:01 AM   in reply to he11f1re

    so, your preloader will START to display after 85% of your swf has already been loaded.

     

    there are a couple of ways to fix it so your preloader starts to display sooner.  the easiest is to make a stand-alone preloader that loads your current swf (minus the preloader).

     
    |
    Mark as:
  • kglad
    62,161 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 26, 2011 8:15 AM   in reply to he11f1re

    1.  remove all on-stage assets from frame 1 except those needed by your preloader.

    2.  for all objects (classes and fonts) exported for use by actionscript, untick export in frame 1.

    3.  in your publish settings (file/publish settings/flash/actionscript 3.0 settings), change the export frame from 1 to 2.

     

    that's usually good enough.  if it's not, you'll need to check textfields created in the ide and disable font embedding in the ide.  you can re-enable it using actionscript and suggestion 2.

     
    |
    Mark as:
  • kglad
    62,161 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 26, 2011 12:14 PM   in reply to he11f1re

    both steps 2 and 3 have to be done.  neither alone will accomplish anything.


     
    |
    Mark as:
  • kglad
    62,161 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 26, 2011 2:24 PM   in reply to he11f1re

    you got the same result as what?


     
    |
    Mark as:
  • kglad
    62,161 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 26, 2011 3:52 PM   in reply to he11f1re

    you mean that you're emulating downloading in the test environment and you see your preloader at 100% immediately and main timeline is failing to advance to frame 2?

     
    |
    Mark as:
  • kglad
    62,161 posts
    Jul 21, 2002
    Currently Being Moderated
    Aug 27, 2011 7:32 AM   in reply to he11f1re

    rectMask_mc's registration point should be along its bottom edge, is it?  ie, on its timeline all its content is above the stage-center.

     
    |
    Mark as:

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