5 Replies Latest reply on Jul 12, 2009 9:13 AM by a@ve-creative

    linking gallery to xml file using a http: link

    a@ve-creative

      ive got a flash gallery that i use swfobject to place on a page.

       

      as everything is all database driven on my site i link the flash file using swfobject like "http://theauctionwinners.com/resources/upload/599070606/gallery.swf" but inside the swf file it calls an xml file that is local. Now because i have linked to the swf using http: the xml file will not load. Is it possible to link to the xml file in the same way as i have with the swf using http:?

       

      also when i export my flash file from the fla it comes up with an error on output saying " There is no property with the name'displayState' "???

       

      here is the actionscript code

       

      function initGallery()
      {
          function loadXML(loaded)
          {
              if (loaded)
              {
                  xmlNode = this.firstChild;
                  total = xmlNode.childNodes.length;
                  for (i = 0; i < total; i++)
                  {
                      _root.small_image[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
                      _root.big_image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
                      _root.description[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
                      if (i == 0)
                      {
                          _root.loadGImage(_root.description[i], _root.big_image[i]);
                      } // end if
                      ++_root.total_images;
                  } // end of for
                  createSmall();
                  _root.downloadButton._visible = true;
              }
              else
              {
                  content = "file not loaded!";
              } // end else if
          } // End of the function
          xmlData = new XML();
          xmlData.ignoreWhite = true;
          xmlData.onLoad = loadXML;
          if (_root.xml_file == undefined)
          {
              _root.xml_file = "images.xml";
          } // end if
          xmlData.load(xml_file);
      } // End of the function
      function createSmall()
      {
          _root.smallContainer.createEmptyMovieClip("smallImageContainer", 10);
          var _loc4 = 0;
          var _loc3 = 0;
          for (var _loc2 = 0; _loc2 < _root.small_image.length; ++_loc2)
          {
              _root.smallContainer.imageContainer.attachMovie("smallImage", "smallImage_" + _loc2, 100 + _loc2);
              m = _root.smallContainer.imageContainer["smallImage_" + _loc2];
              m._x = _loc3 * 50;
              m._y = 0;
              m.imageContainer.loadMovie(_root.small_image[_loc2], 100);
              m.iData = Array();
              m.iData.big = _root.big_image[_loc2];
              m.iData.title = _root.description[_loc2];
              ++_loc3;
          } // end of for
          _root.smallImageContainer._x = 5;
          _root.smallImageContainer._y = 0;
      } // End of the function
      function loadGImage(title, bigImgURL)
      {
          _root.bigImage.imageContainer.loadMovie(bigImgURL, 100);
          _root.bigImage.imageContainer._x = 0;
          _root.bigImage.imageContainer._y = 0;
          _root.title.text = title;
          _root.downloadButton.onRelease = function ()
          {
              getURL(bigImgURL, "_blank");
          };
      } // End of the function
      function goFullScreen()
      {
          Stage.displayState = "fullScreen";
      } // End of the function
      function exitFullScreen()
      {
          Stage.displayState = "normal";
      } // End of the function
      function menuHandler(obj, menuObj)
      {
          if (Stage.displayState == "normal")
          {
              menuObj.customItems[0].enabled = true;
              menuObj.customItems[1].enabled = false;
          }
          else
          {
              menuObj.customItems[0].enabled = false;
              menuObj.customItems[1].enabled = true;
          } // end else if
      } // End of the function
      _root.description = new Array();
      _root.small_image = new Array();
      _root.big_image = new Array();
      _root.total_images = 0;
      initGallery();
      var fullscreenCM = new ContextMenu(menuHandler);
      fullscreenCM.hideBuiltInItems();
      var fs = new ContextMenuItem("Go Full Screen", goFullScreen);
      fullscreenCM.customItems.push(fs);
      var xfs = new ContextMenuItem("Exit Full Screen", exitFullScreen);
      fullscreenCM.customItems.push(xfs);
      _root.menu = fullscreenCM;
      downloadButton._visible = false;