1 Reply Latest reply on Jul 26, 2009 8:57 PM by Rothrock

    Help whit action script.

    kodak-globe
      Hello out there
      are there any of you out there who can help me get my image display system to work?

       

      I have been following advances script from my main site:

       

      function onFinish(success_boolean, gallery_obj, xml)
      {
          if (success_boolean)
          {
              play ();
          } // end if
      } // End of the function
      function textSelectable(selectedObject)
      {
          isTextSelected = getSettingsValue(mainObj, "textSelectable", "item");
          if (isTextSelected == "true")
          {
              selectedObject.selectable = true;
          } // end if
      } // End of the function
      function getXmlSection(obj, itemName, sectionName)
      {
          for (i = 0; obj[itemName][i]; i++)
          {
              if (obj[itemName][i].name == sectionName)
              {
                  returnedResult = true;
                  return (i);
                  break;
              } // end if
          } // end of for
      } // End of the function
      function getSettingsValue(obj, itemName, itemType)
      {
          sectionNum = getXmlSection(obj, "section", "settings");
          for (k = 0; obj.section[sectionNum][itemType][k]; k++)
          {
              if (obj.section[sectionNum][itemType][k].name == itemName)
              {
                  return (obj.section[sectionNum][itemType][k].value);
                  break;
              } // end if
          } // end of for
      } // End of the function
      function getGlobalImageName(imageNumber)
      {
          sectionNum = getXmlSection(mainObj, "section", "global_img");
          imageParams = new Array();
          imageParams.name = mainObj.section[sectionNum].image[imageNumber].imageUrl;
          imageParams.linkToOpen = mainObj.section[sectionNum].image[imageNumber].link;
          return (imageParams);
      } // End of the function
      function getCopyright(textObj)
      {
          textObj.htmlText = getSettingsValue(mainObj, "copyright", "item");
          textSelectable(textObj);
      } // End of the function
      function getCompanyName(textObj)
      {
          textObj.htmlText = getSettingsValue(mainObj, "companyName", "item");
          textSelectable(textObj);
      } // End of the function
      function getSlogan(textObj)
      {
          textObj.htmlText = getSettingsValue(mainObj, "slogan", "item");
          textSelectable(textObj);
      } // End of the function
      function getSystemValue(textObj, systemOptionName)
      {
          textObj.htmlText = getSettingsValue(mainObj, systemOptionName, "item");
          textSelectable(textObj);
      } // End of the function
      function getMenuLink(textObj, linkNum)
      {
          sectionNum = getXmlSection(mainObj, "section", "menu");
          textObj.htmlText = mainObj.section[sectionNum].link[linkNum].value;
          textSelectable(textObj);
      } // End of the function
      function getMenuSystemOrder(linkNum)
      {
          sectionNum = getXmlSection(mainObj, "section", "menu");
          return (mainObj.section[sectionNum].link[linkNum].systemOrder);
      } // End of the function
      function getCurrentText(textObj, textNumber)
      {
          sectionNum = getXmlSection(mainObj, "section", "pages");
          currentPage = _root.link - _root.firstPageFrame;
          textObj.htmlText = mainObj.section[sectionNum].page[currentPage].texts[0].pageText[textNumber].value;
          textSelectable(textObj);
      } // End of the function
      function getMenuPreviousLink(linkNum)
      {
          k = 0;
          for (systemOrder = getMenuSystemOrder(k); systemOrder; systemOrder = getMenuSystemOrder(k))
          {
              if (systemOrder == linkNum)
              {
                  orderResult = k + 1;
                  break;
              } // end if
              ++k;
          } // end of for
          return (orderResult);
      } // End of the function
      function getCurrentImageName(imageNumber)
      {
          sectionNum = getXmlSection(mainObj, "section", "pages");
          currentPage = _root.link - _root.firstPageFrame;
          imageParams = new Array();
          imageParams.name = mainObj.section[sectionNum].page[currentPage].image[imageNumber].imageUrl;
          imageParams.linkToOpen = mainObj.section[sectionNum].page[currentPage].image[imageNumber].link;
          imageParams.target = mainObj.section[sectionNum].page[currentPage].image[imageNumber].target;
          return (imageParams);
      } // End of the function
      function getCurrentImageName_splash(imageNumber)
      {
          sectionNum = getXmlSection(mainObj, "section", "settings");
          imageParams = new Array();
          imageParams.name = mainObj.section[sectionNum].image[imageNumber].imageUrl;
          imageParams.linkToOpen = mainObj.section[sectionNum].image[imageNumber].link;
          return (imageParams);
      } // End of the function
      function checkLinkType(linkTextType, linkNumber)
      {
          k = 0;
          typeCount = 0;
          finalLinkNumber = parseInt(linkNumber) + 1;
          currentPage = _root.link - _root.firstPageFrame;
          sectionNum = getXmlSection(mainObj, "section", "pages");
          for (linkTypeCkeck = mainObj.section[sectionNum].page[currentPage].link[k].linkType; linkTypeCkeck; linkTypeCkeck = mainObj.section[sectionNum].page[currentPage].link[k].linkType)
          {
              if (linkTypeCkeck == linkTextType)
              {
                  ++typeCount;
              } // end if
              if (typeCount == finalLinkNumber)
              {
                  return (k);
                  break;
              } // end if
              ++k;
          } // end of for
      } // End of the function
      function more_click_func(number)
      {
          tempNumber = number.split(" ");
          number = tempNumber.join("");
          number = number.toLowerCase();
          num = _root.pagesReadMoreFrame;
          currentPage = _root.link - _root.firstPageFrame;
          if (isNaN(Number(number)))
          {
              readMoreType = number;
          }
          else
          {
              readMoreType = "readmore";
          } // end else if
          if ((_root.link != num || _root.readMoreFrameType != readMoreType) && _root.animation == 1)
          {
              _root.animation = 0;
              _root.link_prev = _root.link;
              if (_root.link != 7)
              {
                  _root.menu["item" + getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
                  _root.menu2["item" + getMenuPreviousLink(_root.link)].gotoAndPlay("s2");
              } // end if
              if (number == "privacypolicy")
              {
                  _root.readMoreFrameType = "privacypolicy";
                  sectionNum = getXmlSection(mainObj, "section", "privacyPolicy");
                  titleNum = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
                  textNum = getXmlSection(mainObj.section[sectionNum], "item", "pageText");
                  _root.readMoreTitle = mainObj.section[sectionNum].item[titleNum].value;
                  _root.readMoreText = mainObj.section[sectionNum].item[textNum].value;
              }
              else if (number == "termsofuse")
              {
                  _root.readMoreFrameType = "termsofuse";
                  sectionNum = getXmlSection(mainObj, "section", "termsOfUse");
                  titleNum = getXmlSection(mainObj.section[sectionNum], "item", "pageTitle");
                  textNum = getXmlSection(mainObj.section[sectionNum], "item", "pageText");
                  _root.readMoreTitle = mainObj.section[sectionNum].item[titleNum].value;
                  _root.readMoreText = mainObj.section[sectionNum].item[textNum].value;
              }
              else
              {
                  _root.readMoreFrameType = "readmore";
                  sectionNum = getXmlSection(mainObj, "section", "pages");
                  linkCount = checkLinkType("readMoreLink", number);
                  i = 0;
                  linkTitleNum = getXmlSection(mainObj.section[sectionNum].page[currentPage].link[linkCount], "item", "title");
                  linkTextNum = getXmlSection(mainObj.section[sectionNum].page[currentPage].link[linkCount], "item", "linkText");
                  _root.readMoreTitle = mainObj.section[sectionNum].page[currentPage].link[linkCount].item[linkTitleNum].value;
                  _root.readMoreText = mainObj.section[sectionNum].page[currentPage].link[linkCount].item[linkTextNum].value;
              } // end else if
              _root.link = num;
              _root.play();
          } // end if
      } // End of the function
      function getContactFormText(textObj, textNumber)
      {
          sectionNum = getXmlSection(mainObj, "section", "contactForm");
          textObj.htmlText = mainObj.section[sectionNum].texts[0].pageText[textNumber].value;
          textSelectable(textObj);
      } // End of the function
      function getContactFormText_only(textNumber)
      {
          sectionNum = getXmlSection(mainObj, "section", "contactForm");
          return (htmlText = mainObj.section[sectionNum].texts[0].pageText[textNumber].value);
      } // End of the function
      function getContactFormParams()
      {
          sectionNum = getXmlSection(mainObj, "section", "contactForm");
          ContactFormParams = new Array();
          servNum = getXmlSection(mainObj.section[sectionNum], "item", "serverOption");
          recNum = getXmlSection(mainObj.section[sectionNum], "item", "recipient");
          ContactFormParams.rec = mainObj.section[sectionNum].item[recNum].value;
          ContactFormParams.serv = mainObj.section[sectionNum].item[servNum].value;
          return (ContactFormParams);
      } // End of the function
      function getGallerySystemProperty(propName)
      {
          sectionNum = getXmlSection(galleryObj, "section", "systemOptions");
          propNum = getXmlSection(galleryObj.section[sectionNum], "option", propName);
          return (galleryObj.section[sectionNum].option[propNum].value);
      } // End of the function
      function getGallerySettings(propName)
      {
          sectionNum = getXmlSection(galleryObj, "section", "settings");
          propNum = getXmlSection(galleryObj.section[sectionNum], "option", propName);
          return (galleryObj.section[sectionNum].option[propNum].value);
      } // End of the function
      function getGalleryImage(imageNum, categoryNum)
      {
          sectionNum = getXmlSection(galleryObj, "section", "imagesData");
          imageParams = new Array();
          image = galleryObj.section[sectionNum].category[categoryNum].image[imageNum];
          nameNum = getXmlSection(image, "item", "imageUrl");
          commentNum = getXmlSection(image, "item", "imageComment");
          imageParams.name = image.item[nameNum].value;
          imageParams.comment = image.item[commentNum].value;
          return (imageParams);
      } // End of the function
      function getCurrentGalleryName(categoryNum)
      {
          sectionNum = getXmlSection(galleryObj, "section", "imagesData");
          return (galleryObj.section[sectionNum].category[categoryNum].name);
      } // End of the function
      pagesReadMoreFrame = 5;
      firstPageFrame = 1;
      var mainObj = _root.parsed_obj;
      var galleryObj = _root.gallery_obj;
      _root.readMoreFrameType = "readmore";

       

       

      And I follow the script tries from display page:

      function reloadContent()
      {
          thisTitle.htmlText = _root.readMoreTitle;
          thisText.htmlText = _root.readMoreText;
          _root.textSelectable(thisText);
          _root.textSelectable(thisTitle);
      } // End of the function
      reloadContent();
      function reset_txt(name, name2, value)
      {
          path = _target;
          path[name2] = value;
          this[name].onSetFocus = function ()
          {
              path = _target;
              if (path[name2] == value)
              {
                  path[name2] = "";
              } // end if
          };
          this[name].onKillFocus = function ()
          {
              path = _target;
              if (path[name2] == "")
              {
                  path[name2] = value;
              } // end if
          };
      } // End of the function
      formParams = _root.getContactFormParams();
      rec = formParams.rec;
      serv = formParams.serv;
      var fields_descriptions = Array("", Array("t1", "your_name", ""), Array("t2", "your_email", ""), Array("t3", "message", ""));
      for (i = 1; i <= fields_descriptions.length; i++)
      {
          reset_txt("t" + i, fields_descriptions[i][1], fields_descriptions[i][2]);
      } // end of for

       

       

      And one action fore the images frame

      onClipEvent (load)
      {
          imageProperties = _root.getCurrentImageName(3);
          loadMovie(_root.url + imageProperties.name, this.cont.pic);
          url = imageProperties.linkToOpen;
          targetWindow = imageProperties.target;
      }

       

       

      Here I have to follow the advances xml file from where it should findeud of which image to display:

       


      <?xml version="1.0" encoding="UTF-8"?>
      <content>
      <!-- general vars -->
      <section name="settings">
        <item name="textSelectable">true</item>
        <item name="copyright"><![CDATA[COPYRIGHT NAVN |<a href="asfunction:_root.more_click_func, privacyPolicy">COPYRIGHT LINK TEKST</a>]]></item>
        <item name="companyName">SIDENS NAVN</item>
        <item name="slogan">SIDENS SLOGAN</item>
        <item name="slogan2"><![CDATA[SIDENS EKSTRA TEKST]]></item>
        <image imageUrl="_logo.png" link="asfunction:link"/>
       
        <image imageUrl="_pic_menu_1.png" link="asfunction:link"/>
        <image imageUrl="_pic_menu_2.png" link="asfunction:link"/>
        <image imageUrl="_pic_menu_3.png" link="asfunction:link"/>
        <image imageUrl="_pic_menu_4.png" link="asfunction:link"/>
        <image imageUrl="_pic_menu_5.png" link="asfunction:link"/>
       
      </section>

      <!-- menu -->
      <section name="menu">
      <link systemOrder="1"><![CDATA[MENU 1]]></link>

      <link systemOrder="2"><![CDATA[MENU 2]]></link>

      <link systemOrder="3"><![CDATA[MENU 3]]></link>

      <link systemOrder="4"><![CDATA[MENU 4]]></link>

      <link systemOrder="5"><![CDATA[MENU 5]]></link>
      </section>

      <!-- pages -->
      <section name="pages">
       
       
      <page name="company">
      <image imageUrl="_pic1.png" link="asfunction:link"/>
      <image imageUrl="_pic2.png" link="asfunction:link"/>
      <image imageUrl="_pic3.png" link="asfunction:link"/>
      <image imageUrl="_pic4.png" link="asfunction:link"/>

      <texts>

      <pageText><![CDATA[FØRSTE SIDE OVERSKRIFT 1]]></pageText>

      <pageText><![CDATA[FØRSTE SIDE TEKST 1]]></pageText>


      <pageText><![CDATA[FØRSTE SIDE OVERSKRIFT 2]]></pageText>

      <pageText><![CDATA[FØRSTE SIDE TEKST 2]]></pageText>

      <pageText><![CDATA[FØRSTE SIDE TEKST 3]]></pageText>

      <pageText><![CDATA[FØRSTE SIDE TEKST 3]]></pageText>

      <pageText><![CDATA[FØRSTE SIDE TEKST 4]]></pageText>


      <pageText><![CDATA[FØRSTE SIDE OVERSKRIFT 3]]></pageText>


      <pageText><![CDATA[FØRSTE SIDE TEKST 5]]></pageText>


      </texts>

      <link linkType="readMoreLink">
      <image imageUrl="HEER I VANT YHE PUCTURE URL TO BE" link="and images link"/>                              !--- < HEER
      <item name="title"><![CDATA[FØRSTE SIDE MERE OVERSKRIFT 1]]></item>
      <item name="linkText"><![CDATA[FØRSTE SIDE MERE TEKST 1]]></item>
      </link>


      <link linkType="readMoreLink">
      <image imageUrl="HEER I VANT YHE PUCTURE URL TO BE" link="and images link"/>                              !--- < HEER
      <item name="title"><![CDATA[FØRSTE SIDE MERE OVERSKRIFT 2]]></item>
      <item name="linkText"><![CDATA[FØRSTE SIDE MERE TEKST 2]]></item>
      </link>

      <link linkType="readMoreLink">
      <image imageUrl="HEER I VANT YHE PUCTURE URL TO BE" link="and images link"/>                              !--- < HEER
      <item name="title"><![CDATA[FØRSTE SIDE MERE OVERSKRIFT 3]]></item>
      <item name="linkText"><![CDATA[FØRSTE SIDE MERE TEKST 3]]></item>
      </link>

      <link linkType="readMoreLink">
      <image imageUrl="HEER I VANT YHE PUCTURE URL TO BE" link="and images link"/>                              !--- < HEER
      <item name="title"><![CDATA[FØRSTE SIDE MERE OVERSKRIFT 4]]></item>
      <item name="linkText"><![CDATA[FØRSTE SIDE MERE TEKST 4]]></item>
      </link>

      </page>

       

       

       

       

       

       

       

       


      <page name="services">
      <image imageUrl="_pic5.png" link="asfunction:link"/>
      <image imageUrl="_pic6.png" link="asfunction:link"/>

      <texts>

      <pageText><![CDATA[ANDEN SIDE OVERSKRIFT 1]]></pageText>

      <pageText><![CDATA[ANDENSIDE TEKST 1]]></pageText>


      <pageText><![CDATA[ANDEN SIDE OVERSKRIFT 2]]></pageText>

      <pageText><![CDATA[ANDEN SIDE TEKST 2]]></pageText>

      <pageText><![CDATA[ANDEN SIDE TEKST 3]]></pageText>

      </texts>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[ANDEN SIDE MERE OVERSKRIFT 1]]></item>
      <item name="linkText"><![CDATA[ANDEN SIDE MERE TEKST 1]]></item>
      </link>


      <link linkType="readMoreLink">
      <item name="title"><![CDATA[ANDEN SIDE MERE OVERSKRIFT 2]]></item>
      <item name="linkText"><![CDATA[ANDEN SIDE MERE TEKST 2]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[ANDEN SIDE MERE OVERSKRIFT 3]]></item>
      <item name="linkText"><![CDATA[ANDEN SIDE MERE TEKST 3]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[ANDEN SIDE MERE OVERSKRIFT 4]]></item>
      <item name="linkText"><![CDATA[ANDEN SIDE MERE TEKST 4]]></item>
      </link>

      </page>

       

       

       

       

       

       

       

       

       

       

      <page name="solutions">
      <image imageUrl="_pic7.png" link="asfunction:link"/>
      <image imageUrl="_pic8.png" link="asfunction:link"/>

      <texts>

      <pageText><![CDATA[TREDIE SIDE OVERSKRIFT 1]]></pageText>


      <pageText><![CDATA[TREDIE SIDE TEKST 1]]></pageText>


      <pageText><![CDATA[TREDIE SIDE TEKST 2]]></pageText>


      <pageText><![CDATA[TREDIE SIDE OVERSKRIFT 2]]></pageText>


      <pageText><![CDATA[TREDIE SIDE TEKST 3]]></pageText>

      </texts>

       

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[TREDIE SIDE MERE OVERSKRIFT 1]]></item>
      <item name="linkText"><![CDATA[TREDIE SIDE MERE TEKST 1]]></item>
      </link>


      <link linkType="readMoreLink">
      <item name="title"><![CDATA[TREDIE SIDE MERE OVERSKRIFT 2]]></item>
      <item name="linkText"><![CDATA[TREDIE SIDE MERE TEKST 2]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[TREDIE SIDE MERE OVERSKRIFT 3]]></item>
      <item name="linkText"><![CDATA[TREDIE SIDE MERE TEKST 3]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[TREDIE SIDE MERE OVERSKRIFT 4]]></item>
      <item name="linkText"><![CDATA[TREDIE SIDE MERE TEKST 4]]></item>
      </link>

      </page>

       

       

       

       

       

       

       

       

       

      <page name="products">
      <image imageUrl="_pic9.png" link="asfunction:link"/>
      <image imageUrl="_pic10.png" link="asfunction:link"/>
      <image imageUrl="_pic11.png" link="asfunction:link"/>

      <texts>

      <pageText><![CDATA[FJERDE SIDE OVERSKRIFT 1]]></pageText>


      <pageText><![CDATA[FJERDE SIDE TEKST 1]]></pageText>

      <pageText><![CDATA[FJERDE SIDE OVERSKRIFT 2]]></pageText>

      <pageText><![CDATA[FJERDE SIDE TEKST 2]]></pageText>


      <pageText><![CDATA[FJERDE SIDE TEKST 3]]></pageText>

      <pageText><![CDATA[FJERDE SIDE TEKST 4]]></pageText>

      <pageText><![CDATA[FJERDE SIDE TEKST 5]]></pageText>


      <pageText><![CDATA[FJERDE SIDE TEKST 6]]></pageText>

      </texts>

       

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FJERDE SIDE MERE OVERSKRIFT 1]]></item>
      <item name="linkText"><![CDATA[FJERDE SIDE MERE TEKST 1]]></item>
      </link>


      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FJERDE SIDE MERE OVERSKRIFT 2]]></item>
      <item name="linkText"><![CDATA[FJERDE SIDE MERE TEKST 2]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FJERDE SIDE MERE OVERSKRIFT 3]]></item>
      <item name="linkText"><![CDATA[FJERDE SIDE MERE TEKST 3]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FJERDE SIDE MERE OVERSKRIFT 4]]></item>
      <item name="linkText"><![CDATA[FJERDE SIDE MERE TEKST 4]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FJERDE SIDE MERE OVERSKRIFT 5]]></item>
      <item name="linkText"><![CDATA[FJERDE SIDE MERE TEKST 5]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FJERDE SIDE MERE OVERSKRIFT 6]]></item>
      <item name="linkText"><![CDATA[FJERDE SIDE MERE TEKST 6]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FJERDE SIDE MERE OVERSKRIFT 7]]></item>
      <item name="linkText"><![CDATA[FJERDE SIDE MERE TEKST 7]]></item>
      </link>

      </page>

       

       

       

       

       

       

       

      <page name="contacts">
      <image imageUrl="_pic12.png" link="asfunction:link"/>

      <texts>

      <pageText><![CDATA[FEMTE SIDE OVERSKRIFT 1]]></pageText>


      <pageText><![CDATA[FEMTE SIDE TEKST 1]]></pageText>

      <pageText><![CDATA[FEMTE SIDE OVERSKRIFT 2]]></pageText>


      <pageText><![CDATA[FEMTE SIDE TEKST 2]]></pageText>

      <pageText><![CDATA[FEMTE SIDE OVERSKRIFT 3]]></pageText>

      <pageText><![CDATA[FEMTE SIDE TEKST 3]]></pageText>

       

      </texts>

       

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FEMTE SIDE MERE OVERSKRIFT 1]]></item>
      <item name="linkText"><![CDATA[FEMTE SIDE MERE TEKST 1]]></item>
      </link>


      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FEMTE SIDE MERE OVERSKRIFT 2]]></item>
      <item name="linkText"><![CDATA[FEMTE SIDE MERE TEKST 2]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FEMTE SIDE MERE OVERSKRIFT 3]]></item>
      <item name="linkText"><![CDATA[FEMTE SIDE MERE TEKST 3]]></item>
      </link>

      <link linkType="readMoreLink">
      <item name="title"><![CDATA[FEMTE SIDE MERE OVERSKRIFT 4]]></item>
      <item name="linkText"><![CDATA[FEMTE SIDE MERE TEKST 4]]></item>
      </link>

      </page>

       

       


      </section>

       

       

      <!-- privacy policy -->
      <section name="privacyPolicy">
      <item name="pageTitle"><![CDATA[COPYRIGHT OVERSKRIFT]]></item>
      <item name="pageText"><![CDATA[COPYRIGHT TEXT]]></item>
      </section>
      <!-- privacy policy -->


      <!-- terms of use -->
      <section name="termsOfUse">
      <item name="pageTitle"><![CDATA[REGLER OVERSKRIFT]]></item>
      <item name="pageText"><![CDATA[REGLER TEXT]]></item>
      </section>
      <!-- terms of use -->

       

      </content>

       


      The second language in the XML file is Danish


      Can not make it work showing the picture can you help me?

       

        • 1. Re: Help whit action script.
          Rothrock Level 5

          You've posted way too much code. Maybe somebody will have the time to read all of it and try and figure out what your problem is. It isn't really even clear that you know what your problem is.

           

          Try to focus down your question to something a little bit more direct. That is the best way to get help.