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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:23:39+00:00 2026-06-09T22:23:39+00:00

I’m working on a flash project in which I have a swf with a

  • 0

I’m working on a flash project in which I have a swf with a bunch of art assets. However, they are not on the stage, there are simply in the library, and linked up to code I have written.

I have one class that I would like to instantiate, but I keep getting a reference error when it’s being constructed.

Here’s how the swf/fla Library is set up

[MovieClip]ButtonPopup, Linkage:com.packagename.ButtonPopup
[MovieClip]popup_btn, Linkage: none

popup_btn is a child of Popup, and aptly named _popup_btn (with a getter generated by Flash Builder called popup_btn) within the Flash CS5.5 IDE. Here’s the Popup class:

package com.packagename.ButtonPopup {

    public class ButtonPopup extends Popup {
        public Popup() {
            addClickListeners(popup_btn);
        }

        protected function get popup_btn():MovieClip {
            return this["_popup_btn"];
        }
    }
}

package com.packagename.Popup {
    public class Popup extends MovieClip {
        public Popup() {

        }

        protected function addClickListeners(mc:MovieClip) {
            //add click listeners
        }
    }
}

My main swf looks like so:

public MainClass() {
    var loader:Loader = new Loader();
    loader.load(new URLRequest("assets.swf"));
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadArtComplete);
}

function loadArtComplete (e:Event):void {
    var popup_class:Class = e.target.applicationDomain.getDefinition("com.packagename::Popup");
    var popup_mc:MovieClip = new popup_class() as MovieClip;

    addChild(popup_mc);
}

Sadly, I get an error on the var popup_mc:MovieClip = new popup_class() as MovieClip line:

ReferenceError: Error #1056: Cannot create property _popup_btn on com.packagename.Popup
    at flash.display::Sprite/constructChildren()
    at flash.display::Sprite()
    at flash.display::MovieClip()
    at com.packageName.Popup() [file path]
    at com.packageName.MainClass/loadArtComplete() [filepath]

If I leave the popup_btn unnamed in the Flash IDE, I don’t get an error, but then I can’t reference the MovieClip (for adding click listeners and the like), so that’s a no-go solution.

Does anyone have any ideas on what to do here? Can I not instantiate a “complex” MovieClip but instead have to instantiate each child MovieClip, one by one?

EDIT: After a bit more testing, it looks like it has to do with the fact that the problem class isn’t inheriting directly from MovieClip, but from another class (which is inheriting from MovieClip). I updated the source code to reflect that. I still don’t know if that’s the case (if not inheriting from MovieClip would cause a problem). But we’ll see.

Thanks,
-Esa

  • 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-06-09T22:23:41+00:00Added an answer on June 9, 2026 at 10:23 pm

    There is two solutions:
    Set your class as dynamic :

    public dynamic class ButtonPopup extends Popup
    

    then you won’t have flash error

    OR

    You need to create a public var named “_popup_btn” (typed with SimpleButton or MovieClip) in your ButtonPopup class, then Flash will sets this var with your popup_btn’s instance.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a text area in my form which accepts all possible characters from
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't

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.