2 Replies Latest reply on Sep 19, 2013 2:28 PM by samanthmachavez

    CS6 Advanced Photo Album Template Upload Issue

    samanthmachavez

      When I send the .swf to my coworker the images do not load. I have already made sure they image files are in the same folder has the .swf file. Please help

       

       

      Here is my code:

      import fl.data.DataProvider;

      import fl.events.ListEvent;

      import fl.transitions.*;

      import fl.controls.*;

       

      // USER CONFIG SETTINGS =====

      var secondsDelay:Number = 2;

      var autoStart:Boolean = true;

      var transitionOn:Boolean = true; // true, false

      var transitionType:String = "Squeeze"; // Blinds, Fade, Fly, Iris, Photo, PixelDissolve, Rotate, Squeeze, Wipe, Zoom, Random

      var hardcodedXML:String = "<photos><image title='Quality Coverage'>image1.JPG</image><image title='Money Savings'>image2.JPG</image><image title='Home Insurance'>image3.JPG</image><image title='Fred Loya has Got You Covered'>image4.JPG</image></photos>";

      // END USER CONFIG SETTINGS

       

      // DECLARE VARIABLES AND OBJECTS =====

      var imageList:XML = new XML();

      var currentImageID:Number = 0;

      var imageDP:DataProvider = new DataProvider();

      var slideshowTimer:Timer = new Timer((secondsDelay*1005), 0);

      // END DECLARATIONS

       

      // CODE FOR HARDCODED XML =====

      imageList = XML(hardcodedXML);

      fl_parseImageXML(imageList);

      // END CODE FOR HARDCODED XML

       

      // EVENTS =====

      imageTiles.addEventListener(ListEvent.ITEM_CLICK, fl_tileClickHandler);

      function fl_tileClickHandler(evt:ListEvent):void

      {

          imageHolder.imageLoader.source = evt.item.source;

          currentImageID = evt.item.imgID;

      }

      playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);

      function fl_togglePlayPause(evt:MouseEvent):void

      {

          if(playPauseToggle_mc.currentLabel == "play")

          {

              fl_startSlideShow();

              playPauseToggle_mc.gotoAndStop("pause");

          }

          else if(playPauseToggle_mc.currentLabel == "pause")

          {

              fl_pauseSlideShow();

              playPauseToggle_mc.gotoAndStop("play");

          }

      }

      next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);

      prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);

      function fl_nextButtonClick(evt:MouseEvent):void

      {

          fl_nextSlide();

      }

      function fl_prevButtonClick(evt:MouseEvent):void

      {

          fl_prevSlide();

      }

      slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);

      function fl_slideShowNext(evt:TimerEvent):void

      {

          fl_nextSlide();

      }

      // END EVENTS

       

      // FUNCTIONS AND LOGIC =====

      function fl_parseImageXML(imageXML:XML):void

      {

          var imagesNodes:XMLList = imageXML.children();

          for(var i in imagesNodes)

          {

              var imgURL:String = imagesNodes[i];

              var imgTitle:String = imagesNodes[i].attribute("title");

              imageDP.addItem({label:imgTitle, source:imgURL, imgID:i});

          }

          imageTiles.dataProvider = imageDP;

          imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;

          title_txt.text = imageDP.getItemAt(currentImageID).label;

      }

      function fl_startSlideShow():void

      {

          slideshowTimer.start();

      }

      function fl_pauseSlideShow():void

      {

          slideshowTimer.stop();

      }

      function fl_nextSlide():void

      {

          currentImageID++;

          if(currentImageID >= imageDP.length)

          {

              currentImageID = 0;

          }

          if(transitionOn == true)

          {

              fl_doTransition();

          }

          imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;

          title_txt.text = imageDP.getItemAt(currentImageID).label;

      }

      function fl_prevSlide():void

      {

          currentImageID--;

          if(currentImageID < 0)

          {

              currentImageID = imageDP.length-1;

          }

          if(transitionOn == true)

          {

              fl_doTransition();

          }

          imageHolder.imageLoader.source = imageDP.getItemAt(currentImageID).source;

          title_txt.text = imageDP.getItemAt(currentImageID).label;

      }

      function fl_doTransition():void

      {

          if(transitionType == "Blinds")

          {

              TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Fade")

          {

              TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Fly")

          {

              TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Iris")

          {

              TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Photo")

          {

              TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "PixelDissolve")

          {

              TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Rotate")

          {

              TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Squeeze")

          {

              TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Wipe")

          {

              TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Zoom")

          {

              TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});

          } else if (transitionType == "Random")

          {

           

              var randomNumber:Number = Math.round(Math.random()*9) + 1;

              switch (randomNumber) {

                  case 1:

                      TransitionManager.start(imageHolder, {type:Blinds, direction:Transition.IN, duration:0.25});

                      break;

                  case 2:

                      TransitionManager.start(imageHolder, {type:Fade, direction:Transition.IN, duration:0.25});

                      break;

                  case 3:

                      TransitionManager.start(imageHolder, {type:Fly, direction:Transition.IN, duration:0.25});

                      break;

                  case 4:

                      TransitionManager.start(imageHolder, {type:Iris, direction:Transition.IN, duration:0.25});

                      break;

                  case 5:

                      TransitionManager.start(imageHolder, {type:Photo, direction:Transition.IN, duration:0.25});

                      break;

                  case 6:

                      TransitionManager.start(imageHolder, {type:PixelDissolve, direction:Transition.IN, duration:0.25});

                      break;

                  case 7:

                      TransitionManager.start(imageHolder, {type:Rotate, direction:Transition.IN, duration:0.25});

                      break;

                  case 8:

                      TransitionManager.start(imageHolder, {type:Squeeze, direction:Transition.IN, duration:0.25});

                      break;

                  case 9:

                      TransitionManager.start(imageHolder, {type:Wipe, direction:Transition.IN, duration:0.25});

                      break;

                  case 10:

                      TransitionManager.start(imageHolder, {type:Zoom, direction:Transition.IN, duration:0.25});

                      break;

              }

          } else

          {

              trace("error - transitionType not recognized");

          }

      }

      if(autoStart == true)

      {

         fl_startSlideShow();

         playPauseToggle_mc.gotoAndStop("pause");

      }

      // END FUNCTIONS AND LOGIC

      /* Click to Load/Unload SWF or Image from a URL.

      Clicking on the symbol instance loads and displays the specified SWF or image URL. Clicking on the symbol instance a second time unloads the SWF or image.

       

      Instructions:

      1. Replace "http://www.helpexamples.com/flash/images/image1.jpg" below with the desired URL address of the SWF or image. Keep the quotation marks ("").

      2. Files from internet domains separate from the domain where the calling SWF resides cannot be loaded without special configuration.

      */

       

      imageHolder.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF);

       

      import fl.display.ProLoader;

      var fl_ProLoader:ProLoader;

       

      //This variable keeps track of whether you want to load or unload the SWF

      var fl_ToLoad:Boolean = true;

       

      function fl_ClickToLoadUnloadSWF(event:MouseEvent):void

      {

          if(fl_ToLoad)

          {

              fl_ProLoader = new ProLoader();

              addChild(fl_ProLoader);

          }

          else

          {

              fl_ProLoader.unload();

              removeChild(fl_ProLoader);

              fl_ProLoader = null;

          }

          // Toggle whether you want to load or unload the SWF

          fl_ToLoad = !fl_ToLoad;

      }

       

      /* Click to Load/Unload SWF or Image from a URL.

      Clicking on the symbol instance loads and displays the specified SWF or image URL. Clicking on the symbol instance a second time unloads the SWF or image.

       

      Instructions:

      1. Replace "http://www.helpexamples.com/flash/images/image1.jpg" below with the desired URL address of the SWF or image. Keep the quotation marks ("").

      2. Files from internet domains separate from the domain where the calling SWF resides cannot be loaded without special configuration.

      */

       

      imageHolder.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_2);

       

      import fl.display.ProLoader;

      var fl_ProLoader_2:ProLoader;

       

      //This variable keeps track of whether you want to load or unload the SWF

      var fl_ToLoad_2:Boolean = true;

       

      function fl_ClickToLoadUnloadSWF_2(event:MouseEvent):void

      {

          if(fl_ToLoad_2)

          {

              fl_ProLoader_2 = new ProLoader();

              fl_ProLoader_2.load(new URLRequest("http://www.helpexamples.com/flash/images/image1.jpg"));

              addChild(fl_ProLoader_2);

          }

          else

          {

              fl_ProLoader_2.unload();

              removeChild(fl_ProLoader_2);

              fl_ProLoader_2 = null;

          }

          // Toggle whether you want to load or unload the SWF

          fl_ToLoad_2 = !fl_ToLoad_2;

      }