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

Swf Loading Error

Community Beginner ,
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

Hi,

    I am having four to five swf which need to be loaded dynamically based on user click into Main.swf.But when, I try to load a swf which as many MC in stage and also added to stage dynamically into Main.swf, It's displaying following error.

Codding:

    public function Main()
   {
   if(stage)
   {
   initStage();
   }
   else
   {
   addEventListener(Event.ADDED_TO_STAGE,initStage);
   }
   }
  
   //function called when stage is initialized
   private function initStage(evt:Event = null)
   {
   removeEventListener(Event.ADDED_TO_STAGE,initStage);
   initData();
   }
  
   private function initData()
   {
   var url:String = "DragAndDrop.swf";
   var urlReq:URLRequest = new URLRequest(url);
   loader = new Loader();
   loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoaded)
   loader.load(urlReq);
   //this.addChild(loader);
   }
  
   private function onLoaded(evt:Event)
   {
   this.addChild(loader);
   //var targetSwf:MovieClip = MovieClip(loader.content);
   //trace("targetSwf="+targetSwf);
   //this.addChild(targetSwf);
   }

Error:

ReferenceError: Error #1056: Cannot create property question_mc on Main.

    at flash.display::Sprite/flash.display:Sprite::constructChildren()

    at flash.display::Sprite$iinit()

    at flash.display::MovieClip$iinit()

    at Main$iinit()

Can anyone help me out why this error is coming, I need to establish communication between all swf's..I am using CS3 suit...

TOPICS
ActionScript

Views

222

Translate

Translate

Report

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 ,
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

the line of code causing that error is not shown in your message.

click file>publish settings>swf and tick 'enable debugging'.  retest.

the error message will can the timeline/class and line number of the problematic code.

Votes

Translate

Translate

Report

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 Beginner ,
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

ReferenceError: Error #1056: Cannot create property question_mc on Main.

    at flash.display::Sprite/flash.display:Sprite::constructChildren()

    at flash.display::Sprite$iinit()

    at flash.display::MovieClip$iinit()

    at Main$iinit()

Line 15 is braces after the public function Main()----this class files Main.as belongs to the QuestionAnsAnwer.fla , in which i am trying to load all the other swf.....

Votes

Translate

Translate

Report

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 ,
Mar 04, 2015 Mar 04, 2015

Copy link to clipboard

Copied

LATEST

copy and paste the first 20 lines or so of Main.as

Votes

Translate

Translate

Report

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