Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6343421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:25:58+00:00 2026-05-24T20:25:58+00:00

I modified an Adobe Flash CS5 sample to create a swf with a preloader.

  • 0

I modified an Adobe Flash CS5 sample to create a swf with a preloader.

In my FLA I’ve two stopped frames:

In the first frame I only put this code (and a textfield showing percentage):

stop();

this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoading);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);

function onLoading(evt:ProgressEvent):void {
    var loaded:Number = evt.bytesLoaded / evt.bytesTotal; 
    percent_txt.text = (loaded*100).toFixed(0) + "%";
};

function onComplete(event:Event):void { 
    this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onLoading);
    this.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);
    gotoAndStop(2); 
};

In the second frame I:

  • exported the Main class;
  • I have all the needed graphics assets on stage;

When I test the Adobe sample (it has no main class on frame 2, only a large image) anything works fine, but when I compile the modified version I get strange errors.

In the Main class constructor I reference three movieclips, eg. this way: myClip.alpha=0, but it seems now Flash can’t see them anymore (they are null). Why?

How can I make this preloader work?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:25:59+00:00Added an answer on May 24, 2026 at 8:25 pm

    When you say Main class, are you referring to a class you have set as the Document Class? If I’m following you correctly, the problem is likely that the Document Class is always instantiated on the first frame, so your instances on stage wouldn’t yet exist.

    It’s not possible to have the Document Class wait to instantiate until later frames. You’ll probably have to remove your class from the Document Class assignment in order to create your instance on frame 2. At that point, you can pass a reference to your movieclips or stage through to the constructor of your class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've modified the quartz composer slideshow sample from xcode to render a high speed
I have modified the example found here to use two io channels. None of
If you've ever seen an application in the Adobe Creative Suite 5 (CS5), you
EDIT: Modified title and added update. UPDATE : We no longer believe this is
I modified an existing form and saved it on my desktop as .oft file.
Has anyone ever modified the post-new.php file in their WordPress installation? I want to
I've modified the Agile task template in TFS to include a new 'In Progress'
I have an app modified to take into account the UAC in VISTA. So,
I've modified my run.sh file and added JAVA_OPTS=$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n but when I start
I have modified the Nerd Dinner application to allow editing of child records by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.