3 Replies Latest reply on Sep 27, 2006 12:50 AM by Peter Lorent

    lockroot in classes has no effect

    Level 7
      I loaded an swf into another swf like
      _level0.a_mc.another_mc.loadMovie("slave.swf"), with
      _level0.a_mc.another_mc._lockroot = true.
      If I use AS 2.0 classes in the slave swf a trace(_root) will result in
      "_level0" and not in "_level0.a_mc.another_mc."
      Is this a Bug?
      I use a lot of AS 2.0 classes in my Projects and the lockroot seems to be
      useless so I have to load my
      movies in levels which is less comfortable than loading them into clips
      created in _level0.

      Thanks
      Thomas


        • 1. Re: lockroot in classes has no effect
          Peter Lorent Level 2
          Not a bug. You are simply misusing the _lockroot prop. If you have a child swf that contains code that refers to the _root (not recommended) you can set _lockroot to true in that child swf (your slave.swf). This ensures that the code in the child swf will still execute as expected when loaded in the parent swf. _lockroot is available as of player version 7.
          • 2. Re: lockroot in classes has no effect
            Level 7
            This is what I did, I set _lockroot to true in my slave.swf.
            If I refer _root from within the slave.swf main timeline, everything is OK.
            But if create a AS2 class like new testclass() in my slave.swf, and the
            testclass is referring
            to _root, the result is _level0.

            "LuigiL" <webforumsuser@macromedia.com> schrieb im Newsbeitrag
            news:efbn3c$305$1@forums.macromedia.com...
            > Not a bug. You are simply misusing the _lockroot prop. If you have a child
            > swf
            > that contains code that refers to the _root (not recommended) you can set
            > _lockroot to true in that child swf (your slave.swf). This ensures that
            > the
            > code in the child swf will still execute as expected when loaded in the
            > parent
            > swf. _lockroot is available as of player version 7.
            >


            • 3. Re: lockroot in classes has no effect
              Peter Lorent Level 2
              Post your files somewhere and I will have a look.