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

  • SEARCH
  • Home
  • 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 7401689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:32:22+00:00 2026-05-29T04:32:22+00:00

This is a function in a movieclip called Level function makeLvl():void {//this function will

  • 0

This is a function in a movieclip called Level

function makeLvl():void
    {//this function will add bells to the stage
        bellTime ++;//increment the time
        if(bellTime >= bellLimit)
        {//if the time for bell creation has been reached
            bellTotal ++;//increase the amount of bells created
            var newBell:Bell = new Bell();//create a new bell instance
            this.addChild(newBell);//and add it to bellHolder
            bellTime = 0;//reset the time for another creation
            bells.push(newBell);
        }
    }

this creates a few children movieclips inside Level.
Now, inside Bell(), I wish to access some variables like this:

parent.bellTotal = 0;

but it says:

Access of possibly undefined property bellTotal through a reference with a static type flash:DisplayObjectContainer

what is this error and why is it stopping my code from working? Thank you

  • 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-29T04:32:23+00:00Added an answer on May 29, 2026 at 4:32 am

    From within your Bell class, try casting parent as a MovieClip, something like:

    (parent as MovieClip).bellTotal = 0;
    

    or

    MovieClip(parent).bellTotal = 0;
    

    Also I would make sure bellTotal is declared at the parent’s scope, outside of the makeLvl() function.

    I don’t see the whole picture with what you are doing, but alternatively you can add a function/variable to the Bell class, and within makeLvl() pass or set a value.

    var newBell:Bell = new Bell();
    newBell.somePublicFunctionYouDefined(bellTotal);
    newBell.somePublicVariable = bellTotal;
    

    For good measure, you might want to also check if MovieClip(parent) == null before accessing any of its properties

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

Sidebar

Related Questions

Is this function declaration in C#: void foo(string mystring) the same as this one
Imagine this function: void SoundManager::playSource(ALuint sourceID, float offset) { alSourceStop(sourceID); ALint iTotal = 0;
Example: /** * This function will determine whether or not one string starts with
the AS2 code is: MovieClip.prototype.setModel = function(m) { this.model = m; this.drawModel(m); } MovieClip.prototype.drawModel
Curious question: Take this function: function something():Array { var ar:Array = []; var i:MovieClip;
I have this movieclip loaded on runtime called cHolder. I apply a tint at
i have a movieclip on my stage called dude inside the moviclip is a
This function appears to be a way to access all sorts of system values.
This function declaration gives me errors: ostream& operator<<(ostream& os, hand& obj); The errors are:
This function is written in ActionScirpt. What kind of decryption this is? Is there

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.