0 Replies Latest reply on Jan 29, 2009 1:55 PM by ecolara3

    Access text area from different video

    ecolara3
      So here is what I have. I have a master.swf that loads another tester.swf into it. Below is the code for the three swf's. Another swf called tester2 is loaded into a higher layer of tester.swf. So here is how it looks and what each layer contains:

      master.swf
      loads tester.swf into layer 5
      -contains two buttons
      loads tester2.swf into layer 6
      -contains a text area

      What I need to figure out is how to get the buttons from layer 5 to load text into the text area of layer 6. I am using Adobe Flash 8 and here is the code.

      master.swf

      stop();
      //--------------------<MCL>-----------------------\\
      var myMCL:MovieClipLoader = new MovieClipLoader();
      var myListener:Object = new Object();

      myMCL.addListener(myListener);

      myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
      _level50._visible = true;
      var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
      _level50.preloader.gotoAndStop(preloadPercent);
      }

      myListener.onLoadComplete = function(target_mc:MovieClip) {
      _level50._visible = false;
      }
      //--------------------</MCL>-----------------------\\

      // trigger the MCL to load these assets:
      myMCL.loadClip("tester.swf", 5);
      myMCL.loadClip("tester2.swf", 6);


      //-----------------<LoadVars>---------------------\\
      var myLV:LoadVars = new LoadVars();

      myLV.onLoad = function (success) {
      if (success) {
      _level5.loadedInfo.htmlText = myLV.info;
      } else {
      _level5.loadedInfo.text = "hhhhhhhng the requested information. Please contact the Webmaster and report your error.";
      }
      }
      //------------------</LoadVars>---------------------\\

      tester.swf


      _level0.myLV.load("ourStaff.txt");

      //--------------<scroll buttons>-----------------\\
      this.scrollDown.onRelease = function() {
      loadedInfo.scroll += 1;
      }
      this.scrollUp.onRelease = function() {
      loadedInfo.scroll -= 1;
      }
      //--------------</scroll buttons>-----------------\\

      //
      // will set the alignment to the right
      this.ourHistoryMC.ourHistory.autoSize = "right";
      this.ourStaffMC.ourStaff.autoSize = "right";


      // defines enable and disable formats
      var btnDisable:TextFormat = new TextFormat("Bitstream Vera Sans", 12, null, true, true);
      var btnEnable:TextFormat = new TextFormat("Bitstream Vera Sans", 11, null, false, true);

      // disable the already loaded text
      this.ourHistoryMC.ourHistory.setTextFormat(btnDisable);
      this.ourHistoryMC.enabled = false;

      // re-enable the submenu options
      function reEnableOptions() {
      this.ourHistoryMC.enabled = true;
      this.ourHistoryMC.ourHistory.setTextFormat(btnEnable);
      this.ourStaffMC.enabled = true;
      this.ourStaffMC.ourStaff.setTextFormat(btnEnable);

      }

      //--------------<our history option>-----------------\\
      this.ourHistoryMC.onRollOver = function() {
      this.ourHistory.setTextFormat(btnDisable);
      }
      this.ourHistoryMC.onRollOut = function() {
      this.ourHistory.setTextFormat(btnEnable);
      }
      this.ourHistoryMC.onRelease = function() {
      reEnableOptions();
      this.ourHistory.setTextFormat(btnDisable);
      this.enabled = false;
      _level0.myLV.load("ourHistory.txt",6);

      }
      //--------------</our history option>-----------------\\

      //--------------<our staff option>-----------------\\
      this.ourStaffMC.onRollOver = function() {
      this.ourStaff.setTextFormat(btnDisable);
      }
      this.ourStaffMC.onRollOut = function() {
      this.ourStaff.setTextFormat(btnEnable);
      }
      this.ourStaffMC.onRelease = function() {
      reEnableOptions();
      this.ourStaff.setTextFormat(btnDisable);
      this.enabled = false;
      _level0.myLV.load("ourStaff.txt",6);

      }

      tester2.swf
      stop();