4 Replies Latest reply on May 20, 2008 9:16 PM by kglad

    Preloader export to frame scenario

      I decided to move my preloader to the main timeline of my SWF instead of it's own scene in an attempt to simplify things. As before, everything works fine other than the blank white screen for about 15 secs and then the progress bar hitting the scene at about 50%. I see that this is a common surmountable issue. I am preloading an embedded font component which is taking up a little time. I tried to uncheck "Export in first frame" on the text component in the library and loading classes in publish settings into frame 2, (and also 3 when that didn't work, where the main movie event takes place.) The preloader is a standard 2-Frame breaking loop deal. Everything works great but my embedded font doesn't load at all when I do this. Everything else works. However, if I purposely comment out the embedded font for testing purposes, the preloader appears on the scene at about 20% so I know that the embedded font loading is bogging the preloader down. Of course I would like the preloader to start as close to the beginning as is possible as we all do. The font in question is in a nested movie clip starting on it's own Frame 1 where I build the first text field using AS. This embedded font is the only linkage "Export for Action Script" in the entire SWF. I can't get my text fade-in/out to work unless I use an embedded font. At least not the way that I am doing it. Here is the code for the textfield:

      //Create text field

      onClipEvent( enterFrame ){


      textframe.wordWrap = true;
      textframe.html = true;
      textframe.htmlText = "<p align = 'center'> First text string here. </center>";
      textframe.embedFonts = true;

      var textFieldFormat:TextFormat = new TextFormat();
      textFieldFormat.font = "textFieldFont"; // embedded font
      textFieldFormat.size = 16;


      //End create text field

      I use this exact chunk of code repeatedly on the timeline of the movie clip and change the _alpha of the clip for the fade effects and change the .htmlText property to change the textfield itself after x amount of frames. Question is, How can I force my preloader to load first and have the embedded font preload before it is needed if not the way that I am doing it? Perhaps the movie clip being nested is my problem? Or, do I need to add another frame to the main timeline? This is all I need to wrap up my first SWF. Once I nail this down and can actually begin to approach "productiviosity". I know it's not a word, but it should be.
        • 1. Re: Preloader export to frame scenario
          kglad Adobe Community Professional & MVP
          you shouldn't be using an enterFrame clipevent. that causes your code to repeatedly execute in a loop. use the load clipevent.
          • 2. Re: Preloader export to frame scenario
            cfords Level 1
            I see that, I tested it online and the SWF locked on the preloader. It's all good now, thank you. I will try to figure out the preloader itself now. It seems that no matter what I do the preloader progress bar appears at about 50%. Otherwise everything is fine. If I uncheck "Export in first frame" on my embedded font component and load classes into the 3rd frame where my main movie starts on the 4th frame, my text never loads. I am going back to school :)
            • 3. Re: Preloader export to frame scenario
              cfords Level 1
              It would appear that there is not much info at all available concerning preloaders and embedded fonts exported for action script. I have looked around, and I don't see a duplicate or near-duplicate of my problem anywhere. Let's consider this closed and I will either deal with the 50% loading problem or figure out a different way to manipulate _alpha in a dynamic textfield on the fly.
              • 4. Re: Preloader export to frame scenario
                kglad Adobe Community Professional & MVP
                you're most likely having a problem because there's a textfield using your embedded font in the frames that play while your preloader displays or you have some other assets exported in frame 1.