2 Replies Latest reply on Feb 14, 2008 9:52 AM by paulgd619

    Problem with movieclip buttons overlapping when loading

    paulgd619
      I have external swfs loading into a main swf, and the different subpages in the same fla but encapsualted within movieclips and each movieclip is on a different layer in the timeline. The trouble is that I can't disable the buttons on the different layers so if a particular page loads all the hit states are still on the stage even though I cant see the actual button. This is the code I think needs to be changed I tried modifying the for loop, but I don't know how to go about disabling those hitstates Ex. I'm on the contact page but hit states from the home page are causing the mouse icon to chnge when rolled over. I added this to the for loop but it just broke the swf:
      else if (id = "home")
      _root.mcPages.mcSection1.home._visible = false;

      I think since its externally loading I need to use relative targeting or use _level?? instead of _root

      Attach Code

      class com.sony.mylo.LowerContent extends MovieClip
      {

      public static var log:ZLog = new ZLog("com.sony.mylo.LowerContent");

      private var mcPages : MovieClip;
      private var _sectA:Array;

      public function LowerContent()
      {
      ZigoEngine.register(Fuse,PennerEasing);
      this.onEnterFrame = init;
      }

      private function init() : Void
      {
      this.onEnterFrame = null;

      mcPages.mcSection1.id = "home";
      mcPages.mcSection2.id = "chat";
      mcPages.mcSection3.id = "capture";
      mcPages.mcSection4.id = "entertain";
      mcPages.mcSection5.id = "widgetize";
      _sectA = [ mcPages.mcSection1,
      mcPages.mcSection2,
      mcPages.mcSection3,
      mcPages.mcSection4,
      mcPages.mcSection5 ];

      NotificationCenter.defaultCenter().addObserver(this, updateSelection, NotificationNames.LOCATION_UPDATE);

      var selId:String = App.getLocation().getItemIdForPageId(PageNames.STORY);
      if (!selId)
      selId = "home";
      gotoSection(selId);

      }

      public static function main()
      {
      // This is our entry point when compiled with MTASC
      }

      public function updateSelection(notification:Notification)
      {
      var selId:String = App.getLocation().getItemIdForPageId(PageNames.STORY);
      log.debug("updateSelection to:" + selId);
      if (selId)
      gotoSection(selId);
      }

      private function gotoSection(id:String):Void
      {
      var f:Fuse = new Fuse();
      var i:Number, count:Number = _sectA.length;
      var selClip:MovieClip;
      for (i=0;i<count;i++)
      {
      var sect:MovieClip = _sectA ;
      if (sect.id == id)
      selClip = sect;
      else if (id = "home")
      _root.mcPages.mcSection1.home._visible = false;
      else if (sect._alpha > 0)
      f.push({target:sect, alpha:0, time:1, ease:"easeOutQuad"});
      }
      // fade in the selection last
      // cross-fade will not work as some of the product images
      // are not cropped out: their background looks ugly when faded in
      f.push({target:selClip, alpha:100, time:1, ease:"easeOutQuad"});
      f.start();
      }







      }