2 Replies Latest reply on Jun 20, 2007 6:14 AM by KDan

    Actionscript works in IDE,projector but not SWF

      Hello, I'm atempting to create a swf that loads in a controller swf and accesses some of the information contained within the load swf. My main timeline is pretty simple.

      var preloader_mc:MovieClip = this.createEmptyMovieClip("preloader_mc", this.getNextHighestDepth());
      var labelcontainer:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
      var label:TextField = labelcontainer.createTextField("label", 1, 0, 365, 150, 20);
      var TOCcontainer:MovieClip = this.createEmptyMovieClip("TOCcontainer", this.getNextHighestDepth());
      var TOClabel:TextField = TOCcontainer.createTextField("TOClabel", 1, 0, 300, 150, 20);

      then I have an onenter frame function that access the variable contained within the loaded swf.

      loadMovie("xml_controller.swf", preloader_mc);

      onEnterFrame = function () {
      vTime = this.preloader_mc.container.controlBar.timeView.label.value;
      this.label.text = vTime

      When I test the movie I see the time displayed and everything is ok. When I create a projector file I see the time display. When I try to run the swf, in a browser or straight from explorer All I see is undefined for the values.

      Anybody have any ideas why this would work in two environments but not the third?
        • 1. Re: Actionscript works in IDE,projector but not SWF
          MaxManNH Level 2
          I saw this issue with a website I did. Sometimes the code would work no problem in the projector but fail when I published to the site.

          Does the xml_controller.swf refer to _root anywhere? If you have not locked the root and there is something it needs to access locally it won't be able to find the item because the _root it is referring to is now the load.swf movie
          • 2. Re: Actionscript works in IDE,projector but not SWF
            KDan Level 1
            I'll have to give tat a try. Do you know if root lock cascades down to loaded movies? In this case I do not have control of the controller movie I'm loading in...I just want to grab the time display of the playhead which is calculated in the controller movie and then move that data up to the level of the new laoding movie.