7 Replies Latest reply on Nov 25, 2015 10:29 AM by jason.young@flightsafety.

    if else condition

    jason.young@flightsafety.

      I am creating a slide show based on Paul Trani's

       

      Variables and Conditions in Edge Animate - YouTube

       

      I have the slide show functioning, picture counter functioning.

       

      Problem; I am trying to toggle visibility of text when certain pictures become visible. So... on my Stage, creation complete, I have this...


      var numOfPhotos = 11;
      var imageCount = 1;

      sym.showPhoto = function (photoDirection){

      imageCount = imageCount + photoDirection;

      //Set in a loop
      if (imageCount > numOfPhotos) { imageCount = 1};
      if (imageCount < 1) { imageCount = numOfPhotos};

      sym.$("textCount").html(imageCount);

      sym.$("mainPhoto").attr("src","images/photo_"+ imageCount +".png");

      };

       

      I don't know how to properly code a line that sources the "mainPhoto" when its "src" attribute is "photo_1". I am also unsure if that code needs to be on a button click or on the stage, included in the code above.

       

      Thanks for any help!