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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:54:18+00:00 2026-05-23T20:54:18+00:00

Here is the deal, I have a Main class that I call from the

  • 0

Here is the deal,
I have a Main class that I call from the .fla file. Everything work fine until I set a object in the Library “export for actionscript”… after that the stage didn’t work anymore, the stage now return “null”, just because I checked an object to “export for actionscript”.

I’m using flash cs5 and it never happen to me with the early version of flash.

Sorry about the english… and I hope I was clear enough.

Code Sample:

package com {

import flash.display.MovieClip;

public class Teste extends MovieClip {

    public function Teste() {
        trace(stage)// traced null 
    }
}
}

I’ll try to explain the steps that I make.
– Create that Teste Class;
– Open the .fla file, and add that Class in the Class field on the Property of the .fla file;
– create and MovieClip and try to export it from Actionscript;
And here comes the problem… when I did it the stage now return Null, just because I exported a MovieClip in the Library. o.O

  • 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-23T20:54:18+00:00Added an answer on May 23, 2026 at 8:54 pm

    The reason is that Stage probably became available right away when there was not much to load. Now that you have added something to export for Actionscript the loading might even take a millisecond longer and stage wont be available.

    Always check if stage exists and then wait for it to exist before trying to reference it.

    Try this:

    package com {
    
    import flash.display.MovieClip;
    
    public class Teste extends MovieClip {
    
        public function Teste() {
            if(!stage) addEventListener(Event.ADDED_TO_STAGE, _addedToStage)
            else _addedToStage();
        }
    
        private function _addedToStage(e:Event = null)
        {
            trace(stage)// traced null 
        }
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the deal: I have an Android application that needs to call a web
Ok, so here's the deal: Currently we have a page that calls a popup
So here's the deal I'm working on a project that requires me to have
So here's the deal I'm working on a project that requires me to have
Here's the deal - I have two files, main.html and processing.php. Within the php
Here's the deal : I have Publication objets in my application. I also have
Here is the deal, in my Java project I have to make a composite
I have been struggling with this for months in my project. Here's the deal:
Here's the deal: I'm in the process of planning a mid-sized business application that
Here's the deal: A Github repo features a historical import from CVS, divided in

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.