Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error #1056: Cannot create property __id0_ on ModuleSwf

New Here ,
Apr 27, 2012 Apr 27, 2012

I have a document class for a SWF. This SWF compiles and runs fine.  When I load it inside another SWF, I get this:

ReferenceError: Error #1056: Cannot create property __id0_ on ModuleSwf.

          at flash.display::Sprite/constructChildren()

          at flash.display::Sprite()

          at flash.display::MovieClip()

          at ModuleSwf()

ModuleSwf is the document class of the loaded SWF.  What is causing this?

TOPICS
ActionScript
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2012 Apr 27, 2012

if your document class is extending Sprite, change it to extend MovieClip.

and, is __id0_ something you have in your code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2012 Apr 27, 2012

__id0__ is nothing of mine. I am already extending MovieClip.

I thought I figured it out that I needed to make my document class dynamic, but when I did that, one of my custom components within the loaded SWF stopped working.  Very frustrating!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2012 Apr 27, 2012

A Sprite can load a MovieClip so that should be no issue.

Though you're not giving nearly enough detail. Please post some code surrounding the error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2012 Apr 27, 2012

click file>publish settings>flash>tick "permit debuggin" in your loading swf. 

retest and note the problematic line number in the error message.  copy and paste that line of code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2012 Apr 27, 2012

ReferenceError: Error #1056: Cannot create property __id0_ on ModuleSwf.

          at flash.display::Sprite/constructChildren()

          at flash.display::Sprite()

          at flash.display::MovieClip()

          at ModuleSwf()

package

{

          import flash.display.DisplayObject;

          import flash.display.MovieClip;

          import flash.events.Event;

          public class ModuleSwf extends MovieClip

          {   // This is line 17

            public function ModuleSwf()

                    {

                              if (this != root)

                              {

                                        stop();

                              }

                              addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler, false, 0, true);

                              addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler, false, 0, true);

                    }

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2012 Apr 27, 2012
LATEST

what's line 17?  your constructor? 

if yes, is there a lot of white space above the contructor?  (much more than you've shown?)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines