8 Replies Latest reply on Nov 18, 2014 2:21 PM by kglad

    Sprite/constructChildren() problem

    Karaczono

      Hi

       

      I have two FLA files: in.fla and a.fla


      a.fla has two symbols: Symbol1 and Symbol2

      Symbol2 is added to Symbol1

      Symbol2's instance name is 's2'

      Both symbols I exported to the run time shared library

      In first frame of a.fla I wrote:

      --------------------------------------------------------------

      import flash.display.MovieClip;

       

      var s1:MovieClip = new Symbol1;

      trace(s1.s2, 'this is trace from a.fla');

      --------------------------------------------------------------

      If I test the a.fla now in output I can see: [object Symbol2] this is trace from a.fla


      Next:

       

      In in.fla I import those two Symbols to it

      Import SWC of a.fla to that one

      then write code in frame 1:

       

      var l:Loader = new Loader;

      l.contentLoaderInfo.addEventListener(Event.COMPLETE, c);

      l.load(new URLRequest('a.swf'));

       

      function c(e:Event):void{

          new Symbol1;

      }

       

      When I test in.fla in output I can see: [object Symbol2] this is trace from a.fla

       

      So everything works fine till now.

       

      But if I edit class definition for Symbol1 in a.fla and save it as Symbol1.as then:

       

      When I test a.fla nothing has changed

      But in.fla gives me an error:

       

      ReferenceError: Error #1056: Cannot create property s2 on Symbol1.

          at flash.display::Sprite/constructChildren()

          at flash.display::Sprite()

          at flash.display::MovieClip()

          at Symbol1()

          at a_fla::MainTimeline/frame1()

      ReferenceError: Error #1056: Cannot create property s2 on Symbol1.

          at flash.display::Sprite/constructChildren()

          at flash.display::Sprite()

          at flash.display::MovieClip()

          at Symbol1()

          at in_fla::MainTimeline/c()

       

      What is wrong?

       

      PS. If in a.fla in Symbol1 delete instance name for Symbol2 the error disappears;