Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
if your document class is extending Sprite, change it to extend MovieClip.
and, is __id0_ something you have in your code?
Copy link to clipboard
Copied
__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!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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);
}
Copy link to clipboard
Copied
what's line 17? your constructor?
if yes, is there a lot of white space above the contructor? (much more than you've shown?)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now