A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Navigating through slideshow

Threaded View

  1. #1
    Member
    Join Date
    Sep 2009
    Posts
    72

    Navigating through slideshow

    I have two movieclips this is based off of. work_mc and workss_mc

    Work_mc is a collection of thumbnails on one frame.

    Workss_mc is a collection of larger images with descriptions that has to ability to scroll through each slide

    The way you navigate this is you click in work_mc, whatever thumbnail you choose and it will open workss_mc.
    Once you are inside of work_mc you can view the image, go back(which takes you back to work_mc) or you have prev and next

    Workss_mc consistants of multiple frames and each frame has a different image on it.


    Here is the code for a button in work_mc:

    Actionscript Code:
    twentythreemographthmb_mc.addEventListener(MouseEvent.CLICK, clickHandler2);
    twentythreemographthmb_mc.buttonMode=true;

    function clickHandler2(event:MouseEvent):void {

         var workss_mc = new mc_workss();
         newClassRoot.showModalContent(workss_mc);
         workss_mc.x=225;
         workss_mc.y=200;
         workss_mc.gotoAndStop("twentythreemotion");
         workss_mc.addEventListener("closeButtonClick10", onCloseClick10);


    }

    function onCloseClick10(e:Event):void {
         var work_mc = new mc_work();
         newClassRoot.showModalContent(work_mc);
         work_mc.x=225;
         work_mc.y=130;
    }

    So this should go to twentythreemotion and stop, which it does and it works correctly.

    However, once you are in workss_mc the prev and next button are not functioning properly.

    If you click on the first thumbnail and start the show from the beginning: This is on frame 1 of workss_mc..

    Actionscript Code:
    var a:Array=["urban","twentythree","citibrochure","csccard","rokroom","hiphop","metal","vangogh"];
    var currentIndex:int=0;
    worknextbtn_mc.addEventListener(MouseEvent.CLICK, worknextClicked);
    function worknextClicked(event:MouseEvent) {
         currentIndex++;
         if (currentIndex>=a.length) {
              currentIndex=0;
         }
         gotoAndStop(a[currentIndex]);
    }

    workprevbtn_mc.addEventListener(MouseEvent.CLICK, workprevClicked);
    function workprevClicked(event:MouseEvent) {
         currentIndex--;
         if (currentIndex>=a.length) {
              currentIndex=0;
         }
         gotoAndStop(a[currentIndex]);
    }

    This works correctly if I choose the first thumbnail that goes to frame one but if I choose another thumbnail on work_mc that will go to a different frame label in workss_mc the prev/next buttons won't function properly..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center