1 Reply Latest reply on Sep 6, 2008 5:12 AM by Newsgroup_User

    Page flip problem

    RickyD55
      Hi

      I download a page flip component ages back which I've used several times with success.

      This time I have a slightly different use for it, I won't go into the full story but basically when ever the pages change (they are double page spreads) I want a corresponding swf file to load at the bottom of the page.

      I have set up a variable called pageNo that is creating the page numbers correctly when I trace them, they come out as 1to2, 3to4 etc

      How can I get this to relate to a path for the correct movie clip to load?

      Can I get these page values to some how relate to an Array? or am I going down the wrong path?

      Can anyone suggest a better way?

      The FLA file is here
      http://www.qwerty-design.co.uk/testimonials.html

      Thanks in advance
        • 1. Re: Page flip problem
          Level 7
          >> How can I get this to relate to a path for the correct movie clip to
          >> load?

          Since you're using a string var, you might use a switch:

          var myFile = "";
          switch (pageNo) {
          case "1to2" :
          myFile = "bottomOne.swf";
          break;
          case "3to4" :
          myFile = "bottomTwo.swf";
          break;
          }

          An array would be problematic I think, just because of your naming: 1to2 and
          3to4 - even if you pulled out the first char and turned it into a number
          you'd get 1 and 3 - which would be fine as indexes but then you use only
          every other item... An associative array might do it though (aka object):

          var myFiles = new Object();
          myFiles["1to2"] = "bottomOne.swf";
          myFiles["3to4"] = "bottomTwo.swf";

          Then you could do:

          var whichFile = myFiles[pageNo];

          you could use xml to setup the object as well...


          --
          Dave -
          www.offroadfire.com
          Head Developer
          http://www.blurredistinction.com
          Adobe Community Expert
          http://www.adobe.com/communities/experts/