views:

606

answers:

1

Greetings!

I am working on an AS2 website with MovieClips for pages that swap depth when navigation is clicked. Text content is pulled dynamically from an external XML file & styled via CSS, including links (HTML/CDATA). My problem is this:

When a page is hidden behind another via swapDepths(), HTML links within the hidden page are still clickable with the hand cursor. I have tried mc.enabled=false on the contents' parent clips, but it has no effect on the dynamic text string. Does anyone know how to disable CDATA links with Actionscript 2?

The same question goes for MovieClip children in general: how does one disable movieClips within a parent clip in AS2 without hard coding instance names?

Thanks in advance for any suggestions!

Here is the code where I control my page swapping:

// class code.Startup() :

      page_arr = new Array(); // references clips laid out in the IDE
      page_arr = [
            ['home', pages.homePage_mc],
            ['apartments', pages.apartmentsPage_mc],
            ['building', pages.buildingPage_mc],
            ['neighborhood', pages.neighborhoodPage_mc],
            ['press', pages.pressPage_mc],
            ['team', pages.teamPage_mc],
            ['retail', pages.retailPage_mc],
            ['office', pages.officePage_mc],
            ['contact', pages.contactPage_mc]
      ]

// class code.Navigation() :

private function showPage(num):Void {
        turnOffAllPages();

        if(siteFirstRun == true){ 
          prevPageObj = code.Startup.getInstance().page_arr[0][1]; 
                //defaults to homepage, already showing
          currPageObj = code.Startup.getInstance().page_arr[num][1]; 
                //sets currPageObj to whatever page was chosen with nav 
          siteFirstRun = false;
        }
        else {      
          if(currPageObj !== prevPageObj){
              prevPageObj = currPageObj;
          }
          currPageObj = code.Startup.getInstance().page_arr[num][1];
        }

      TweenLite.to(code.Startup.getInstance().page_arr[num][1], .25, {_alpha:100, ease:'easeOutQuad', delay:.25});

      if(prevPageObj !== undefined){
             currPageObj.swapDepths(code.Startup.getInstance().pages.getNextHighestDepth());
      }
      currPageObj.copy_mc.enabled = true;

      }

// Each page_arr clip contains a 'copy_mc' instance into which XML content is fed. These are what I need to target!

private function turnOffAllPages():Void{
      for(i=0; i<code.Startup.getInstance().numPages; i++){
        code.Startup.getInstance().page_arr[i][1].copy_mc.enabled = false; 
         // disable pages to avoid rolling over hidden links

         TweenLite.to(code.Startup.getInstance().page_arr[i][1], .2, {_alpha:0, ease:'easeOutQuad'});
      }
}
A: 

I would advice two approaches to your problem:

1) Move your movieclip that is hidden to an offscreen position (i.e. set _x and _y to something outside of your stage)

2) Attach a blocker movieclip or button on top of the hidden mc so it will keep it from receiving any mouse events. When it becomes unhidden again, remove the blocker movieclip or button.

Boon
Moving the objects below works. I had done that before, but hoped to find another solution. That is indeed the way to do it! Thanks!
Marcy Sutton