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

Swf Loading Error

Community Beginner ,
Mar 04, 2015 Mar 04, 2015

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

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.

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

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.....

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

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

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