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 607679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:23:08+00:00 2026-05-13T17:23:08+00:00

I’m seeing some strange behavior with respect to interactions between my preloader and main

  • 0

I’m seeing some strange behavior with respect to interactions between my preloader and main application classes (all AS3 / Flash CS4). Roughly speaking, here’s the flow of events:

  1. Preloader.swf loads two things: main.swf, which is the main app, and assets for a custom object consisting of text and images, which are assembled into the object by the preloader from various URLs.
  2. When load finishes, Preloader adds main.swf as a child. Preloader then calls
    init(myCustomObject)

    on main.swf, where myCustomObject is a reference to the object assembled by the preloader during step 1 and

    public function init(customObject:CustomObject):void)

    is a method signature in Main.as. (Preload.as casts Main to an object of type * so as to be able to invoke arbitrary functions without fear of compile-time errors.)

  3. Main.as is actually a container for the application itself, so it instantiates a
    new Application(customObject);

    passing along a reference to the customObject assembled by the preloader, and adds that as a child.

I’ve installed thunderbolt so I can log messages as the application runs, and here’s what I’ve determined is happening. The instantiation of the Application object in step 3 is what’s causing trouble; for some reason, the statement
myMainApplication = new Application(customobj); in Main.as is throwing a lovely #1009 error, which usually indicates a null pointer reference or something similar.

The strange thing is that I’ve added some logging to Application.as, and it seems to be receiving the reference to customObject without a problem; calling toString() on the customObject in Application‘s constructor returns exactly the expected data.

In other words, the statement myMainApplication = new Application(customobj); in Main.as seems to be succeeding and failing at the same time. What gives?

  • 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-13T17:23:08+00:00Added an answer on May 13, 2026 at 5:23 pm

    The reason that myMainApplication = new Application(customobj); seemed to be succeeding and failing at the same time is that I didn’t completely understand the way the try/catch blocks operate in AS3. There was a null pointer exception being thrown in a subroutine to Application‘s constructor, occurring after the code in which Application checks to ensure it’s receiving a reference to customobj. This error was being caught by the try/catch block surrounding the instantation of Application in Main, as it was the nearest enclosing error-checking code.

    Hopefully my mistake will save someone else for making a similar one!

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

Sidebar

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.