Small action script help

  • routhu
  • Beginner
  • Beginner
  • User avatar
  • Posts: 47
  • Loc: India

Post 3+ Months Ago

hi all,

I am using below script for xml thumnail gallery. Displaying of images is coming fine, I need to disply each title when roll over the image. That added in code but it's not working. Iam little bit confused.

Can any one help please.

Code: [ Select ]
function thumbnailsLoad(k)
    {
  thumbnailsWidth = mclThumbnails._width;
  mclThumbnails.attachMovie("scrollSymbol", "mcl" + k, mclThumbnails.getNextHighestDepth(), {_x: mclWidth * k});
  var __reg4 = new MovieClipLoader();
  var __reg3 = new Object();
  __reg3.onLoadInit = function (mclTarget)
  {
    mclTarget._alpha = 100;
    var __reg4 = undefined;
    var __reg5 = undefined;
    __reg4 = mclTarget._x;
    __reg5 = mclTarget._y;

        mclTarget.onRollOver = function ()
    {
      _root.is_move = false;
      this._alpha = 80;
      this._parent._parent.gotoAndPlay("show");
            this.caption.text = titleText[k];
            trace(caption.text);
            
    }
    ;
  1. function thumbnailsLoad(k)
  2.     {
  3.   thumbnailsWidth = mclThumbnails._width;
  4.   mclThumbnails.attachMovie("scrollSymbol", "mcl" + k, mclThumbnails.getNextHighestDepth(), {_x: mclWidth * k});
  5.   var __reg4 = new MovieClipLoader();
  6.   var __reg3 = new Object();
  7.   __reg3.onLoadInit = function (mclTarget)
  8.   {
  9.     mclTarget._alpha = 100;
  10.     var __reg4 = undefined;
  11.     var __reg5 = undefined;
  12.     __reg4 = mclTarget._x;
  13.     __reg5 = mclTarget._y;
  14.         mclTarget.onRollOver = function ()
  15.     {
  16.       _root.is_move = false;
  17.       this._alpha = 80;
  18.       this._parent._parent.gotoAndPlay("show");
  19.             this.caption.text = titleText[k];
  20.             trace(caption.text);
  21.             
  22.     }
  23.     ;
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • routhu
  • Beginner
  • Beginner
  • User avatar
  • Posts: 47
  • Loc: India

Post 3+ Months Ago

This is the I am using code:

Code: [ Select ]
function loadPhotoXML(filename)
{
  photoXML.ignoreWhite = true;
  photoXML.load(filename);
  photoXML.onLoad = function (success)
  {
    if (success)
    {
      photoNumber = 0;
      rootNode = this.firstChild;
      totalPhotos = rootNode.childNodes.length;
      var __reg2 = 0;
            while (__reg2 < totalPhotos * 2)
      {
        if (__reg2 < totalPhotos)
        {
          thumbnails[__reg2] = rootNode.childNodes[__reg2].childNodes[0].firstChild.nodeValue;
          link[__reg2] = rootNode.childNodes[__reg2].childNodes[1].firstChild.nodeValue;
          titleText[__reg2] = rootNode.childNodes[__reg2].childNodes[2].firstChild.nodeValue;
        }
        else
        {
          thumbnails[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[0].firstChild.nodeValue;
          link[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[1].firstChild.nodeValue;
          titleText[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[2].firstChild.nodeValue;
        }


        thumbnailsLoad(__reg2);
        ++__reg2;
      }

      checkProgressLoad(0);
            //caption.text = titleText[0];
    }

  }
  ;
}

function thumbnailsLoad(k)
    {
  thumbnailsWidth = mclThumbnails._width;
  mclThumbnails.attachMovie("scrollSymbol", "mcl" + k, mclThumbnails.getNextHighestDepth(), {_x: mclWidth * k});
  var __reg4 = new MovieClipLoader();
  var __reg3 = new Object();
  __reg3.onLoadInit = function (mclTarget)
  {
    mclTarget._alpha = 100;
    var __reg4 = undefined;
    var __reg5 = undefined;
    __reg4 = mclTarget._x;
    __reg5 = mclTarget._y;

        mclTarget.onRollOver = function ()
    {
      _root.is_move = false;
      this._alpha = 80;
      this._parent._parent.gotoAndPlay("show");
            _root.mclThumbnails.mclTarget.caption.text = titleText[k];
            trace(caption.text);
            
    }
    ;
    mclTarget.onRollOut = function ()
    {
      _root.is_move = true;
      this._alpha = 95;
      this._parent._parent.gotoAndPlay("hide");
    }
    ;
    mclTarget.onDragOut = function ()
    {
      _root.is_move = true;
      this._alpha = 95;
      this._parent._parent.gotoAndPlay("hide");
    }
    ;
  1. function loadPhotoXML(filename)
  2. {
  3.   photoXML.ignoreWhite = true;
  4.   photoXML.load(filename);
  5.   photoXML.onLoad = function (success)
  6.   {
  7.     if (success)
  8.     {
  9.       photoNumber = 0;
  10.       rootNode = this.firstChild;
  11.       totalPhotos = rootNode.childNodes.length;
  12.       var __reg2 = 0;
  13.             while (__reg2 < totalPhotos * 2)
  14.       {
  15.         if (__reg2 < totalPhotos)
  16.         {
  17.           thumbnails[__reg2] = rootNode.childNodes[__reg2].childNodes[0].firstChild.nodeValue;
  18.           link[__reg2] = rootNode.childNodes[__reg2].childNodes[1].firstChild.nodeValue;
  19.           titleText[__reg2] = rootNode.childNodes[__reg2].childNodes[2].firstChild.nodeValue;
  20.         }
  21.         else
  22.         {
  23.           thumbnails[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[0].firstChild.nodeValue;
  24.           link[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[1].firstChild.nodeValue;
  25.           titleText[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[2].firstChild.nodeValue;
  26.         }
  27.         thumbnailsLoad(__reg2);
  28.         ++__reg2;
  29.       }
  30.       checkProgressLoad(0);
  31.             //caption.text = titleText[0];
  32.     }
  33.   }
  34.   ;
  35. }
  36. function thumbnailsLoad(k)
  37.     {
  38.   thumbnailsWidth = mclThumbnails._width;
  39.   mclThumbnails.attachMovie("scrollSymbol", "mcl" + k, mclThumbnails.getNextHighestDepth(), {_x: mclWidth * k});
  40.   var __reg4 = new MovieClipLoader();
  41.   var __reg3 = new Object();
  42.   __reg3.onLoadInit = function (mclTarget)
  43.   {
  44.     mclTarget._alpha = 100;
  45.     var __reg4 = undefined;
  46.     var __reg5 = undefined;
  47.     __reg4 = mclTarget._x;
  48.     __reg5 = mclTarget._y;
  49.         mclTarget.onRollOver = function ()
  50.     {
  51.       _root.is_move = false;
  52.       this._alpha = 80;
  53.       this._parent._parent.gotoAndPlay("show");
  54.             _root.mclThumbnails.mclTarget.caption.text = titleText[k];
  55.             trace(caption.text);
  56.             
  57.     }
  58.     ;
  59.     mclTarget.onRollOut = function ()
  60.     {
  61.       _root.is_move = true;
  62.       this._alpha = 95;
  63.       this._parent._parent.gotoAndPlay("hide");
  64.     }
  65.     ;
  66.     mclTarget.onDragOut = function ()
  67.     {
  68.       _root.is_move = true;
  69.       this._alpha = 95;
  70.       this._parent._parent.gotoAndPlay("hide");
  71.     }
  72.     ;
  • routhu
  • Beginner
  • Beginner
  • User avatar
  • Posts: 47
  • Loc: India

Post 3+ Months Ago

Any One Please......?
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

what does your xml look like? I usually use item attributes instead of child objects since its easier to get to in flash.

Code: [ Select ]

<xml etc>
<images>
  <item URL="pathToFile" tName="Name for the Thumbnail"></item>
<item URL="pathToFile" tName="Name for the Thumbnail"></item>
<item URL="pathToFile" tName="Name for the Thumbnail"></item>
<item URL="pathToFile" tName="Name for the Thumbnail"></item>
<item URL="pathToFile" tName="Name for the Thumbnail"></item>
</images>
  1. <xml etc>
  2. <images>
  3.   <item URL="pathToFile" tName="Name for the Thumbnail"></item>
  4. <item URL="pathToFile" tName="Name for the Thumbnail"></item>
  5. <item URL="pathToFile" tName="Name for the Thumbnail"></item>
  6. <item URL="pathToFile" tName="Name for the Thumbnail"></item>
  7. <item URL="pathToFile" tName="Name for the Thumbnail"></item>
  8. </images>


Then when you load the xml make it into an array. Its a lot easier to deal with instead of all the crazy if statements your using.

So you want something like this...
Code: [ Select ]
mainContent_xml.onLoad = function(success) {
    if (success) {
        _root.myContent = mainContent_xml.firstChild.childNodes;
        myFunction();
    } else {
        trace("Error loading mainContent_xml");
    }
};

function myFunction()
{
// loop through the list and do something with them
for(i=0;i<_root.myContent.length;i++)
{
  trace("URL for current xmlNode is: "+_root.myContent[i].attributes.URL);
  trace("Name for curr xmlNode is: "+_root.myContent[i].attributes.tName);
}
}
  1. mainContent_xml.onLoad = function(success) {
  2.     if (success) {
  3.         _root.myContent = mainContent_xml.firstChild.childNodes;
  4.         myFunction();
  5.     } else {
  6.         trace("Error loading mainContent_xml");
  7.     }
  8. };
  9. function myFunction()
  10. {
  11. // loop through the list and do something with them
  12. for(i=0;i<_root.myContent.length;i++)
  13. {
  14.   trace("URL for current xmlNode is: "+_root.myContent[i].attributes.URL);
  15.   trace("Name for curr xmlNode is: "+_root.myContent[i].attributes.tName);
  16. }
  17. }


I know that means changing quite a bit of your code now but it will probably be a lot easier for you down the road.
  • routhu
  • Beginner
  • Beginner
  • User avatar
  • Posts: 47
  • Loc: India

Post 3+ Months Ago

Hi,

Thanks for your reply, this is my xml code: I am getting "alt" in xml to flash file. But I am not able to display that one in below the image.

Code: [ Select ]

<?xml version="1.0" standalone="yes" ?>
<PhotoGallery>

<photo>
    <thumbnails>images/img1.jpg</thumbnails>
    <url>http://wwww.1.com/</url>
    <alt>Image 1</alt>
</photo>

<photo>
    <thumbnails>images/img2.jpg</thumbnails>
    <url>http://wwww.2.com/</url>
    <alt>Image 2</alt>
</photo></PhotoGallery>
  1. <?xml version="1.0" standalone="yes" ?>
  2. <PhotoGallery>
  3. <photo>
  4.     <thumbnails>images/img1.jpg</thumbnails>
  5.     <url>http://wwww.1.com/</url>
  6.     <alt>Image 1</alt>
  7. </photo>
  8. <photo>
  9.     <thumbnails>images/img2.jpg</thumbnails>
  10.     <url>http://wwww.2.com/</url>
  11.     <alt>Image 2</alt>
  12. </photo></PhotoGallery>



This is my actionscript, could you please tell me where I can modify my code and how?

Code: [ Select ]
mclThumbnails.dx = 0.01;
var mclWidth = 104;
var screenCenter = 450;
var acceleration = 100;
var deceleration = 0.999;
var leastSpeed = 2;

////////////////////////////////////////////////

var photoXML = new XML();
var photoNumber;
var rootNode;
var totalPhotos;
var ids;
var thumbnails = [];
var link = [];
var titleText = [];
var thumbnailsWidth;
var is_move = true;
var i = 0;
var nInterval;
var nRow = 0;

///////////////////////////////////////////////

function loadPhotoXML(filename)
{
  photoXML.ignoreWhite = true;
  photoXML.load(filename);
  photoXML.onLoad = function (success)
  {
    if (success)
    {
      photoNumber = 0;
      rootNode = this.firstChild;
      totalPhotos = rootNode.childNodes.length;
      var __reg2 = 0;
            while (__reg2 < totalPhotos * 2)
      {
        if (__reg2 < totalPhotos)
        {
          thumbnails[__reg2] = rootNode.childNodes[__reg2].childNodes[0].firstChild.nodeValue;
          link[__reg2] = rootNode.childNodes[__reg2].childNodes[1].firstChild.nodeValue;
          titleText[__reg2] = rootNode.childNodes[__reg2].childNodes[2].firstChild.nodeValue;
        }
        else
        {
          thumbnails[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[0].firstChild.nodeValue;
          link[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[1].firstChild.nodeValue;
          titleText[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[2].firstChild.nodeValue;
        }


        thumbnailsLoad(__reg2);
        ++__reg2;
      }

      checkProgressLoad(0);
            //caption.text = titleText[0];
    }

  }
  ;
}

function thumbnailsLoad(k)
    {
  thumbnailsWidth = mclThumbnails._width;
  mclThumbnails.attachMovie("scrollSymbol", "mcl" + k, mclThumbnails.getNextHighestDepth(), {_x: mclWidth * k});
  var __reg4 = new MovieClipLoader();
    this.caption.text = titleText[k]
            trace(caption.text);
  var __reg3 = new Object();
  __reg3.onLoadInit = function (mclTarget)
  {
    mclTarget._alpha = 100;
    var __reg4 = undefined;
    var __reg5 = undefined;
    __reg4 = mclTarget._x;
    __reg5 = mclTarget._y;
        mclTarget.onRollOver = function ()
    {
      _root.is_move = false;
      this._alpha = 80;
      this._parent._parent.gotoAndPlay("show");
            caption.text = titleText[k];
            trace(caption.text);
            
    }
    ;
    mclTarget.onRollOut = function ()
    {
      _root.is_move = true;
      this._alpha = 95;
      this._parent._parent.gotoAndPlay("hide");
    }
    ;
    mclTarget.onDragOut = function ()
    {
      _root.is_move = true;
      this._alpha = 95;
      this._parent._parent.gotoAndPlay("hide");
    }
    ;
    mclTarget.onPress = function ()
    {
            if(ids!=k) {
            checkProgressLoad(k);
            getURL(link[k], "_self");
            trace(link[k]);
            ids=k;
                }
    }
    ;
  }
  ;
  __reg3.onLoadProgress = function (mclTarget, nLoaded, nTotal)
  {
    if (nLoaded != nTotal)
    {
      preloader._visible = true;
      preloader.textf.text = "Thumbnails loading";
      return;
    }

  }
  ;
  __reg4.addListener(__reg3);
  mclThumbnails["mcl" + k].mclLoadPicture.createEmptyMovieClip("temp", this.getNextHighestDepth());
  __reg4.loadClip(thumbnails[k], "mclThumbnails.mcl" + k + ".mclLoadPicture.temp");
  thumbnailsWidth = mclWidth * totalPhotos;
}

function ff(j)
{
  ++nRow;
  _root.mcHolder1.attachMovie("simplesquare", "mcsquare", _root.mcHolder1.getNextHighestDepth(), {_x: 13, _y: 0 + 12 * nRow});
  _root.mcHolder1.mcsquare1._y = 6 + 12 * nRow;
  if (nRow > 37)
  {
    removeMovieClip(_root.mcHolder1);
    clearInterval(nInterval);
    removeMovieClip(mclPicture["mcl" + j]);
    nRow = 0;
  }

}

function checkProgressLoad(k)
{
  var __reg3 = new MovieClipLoader();
  var __reg2 = new Object();
  mclPicture.attachMovie("imageSymbol", "mcl" + i, 1000 - (i + 1));
  mclPicture["mcl" + i].mclLoadPicture.createEmptyMovieClip("temp", mclPicture["mcl" + i].mclLoadPicture.getNextHighestDepth());
  __reg2.onLoadStart = function (mclTarget)
  {
    preloader._visible = true;
  }
  ;
  __reg2.onLoadProgress = function (mclTarget, nLoaded, nTotal)
  {
    preloader.bar._alpha = 100;
    preloader.bar._width = nLoaded / nTotal * 600;
    preloader.textf.text = "Loaded " + Math.floor(nLoaded / 1000) + "Kb of " + Math.floor(nTotal / 1000) + " Kb";
  }
  ;
  __reg2.onLoadComplete = function (mclTarget)
  {
    preloader.bar._width = 20;
    preloader._visible = false;
    mclTarget._parent._parent.gotoAndPlay("start_play");
    if (i > 0)
    {
      nRow = 0;
      clearInterval(nInterval);
      removeMovieClip(_root.mcHolder1);
      removeMovieClip(mclPicture["mcl" + (i - 2)]);
      _root.createEmptyMovieClip("mcHolder1", _root.getNextHighestDepth());
      _root.mcHolder1.attachMovie("mask_square", "mcsquare1", _root.mcHolder1.getNextHighestDepth());
      _root.mcHolder1.mcsquare1._x = 0;
      _root.mcHolder1.mcsquare1._y = 0;
      _root.mcHolder1.mcsquare1._width = 600;
      _root.mcHolder1.mcsquare1._height = 600;
      mclPicture["mcl" + (i - 1)].mclLoadPicture.setMask(mcHolder1);
      nInterval = setInterval(ff, 48, i - 1);
    }

    ++i;
  }
  ;
  __reg3.addListener(__reg2);
  if (k < totalPhotos)
  {
    __reg3.loadClip(url[k], "mclPicture.mcl" + i + ".mclLoadPicture.temp");
    return;
  }

  __reg3.loadClip(url[k - totalPhotos], "mclPicture.mcl" + i + ".mclLoadPicture.temp");
}

function thumbnailsRoll()
{
  if (mclThumbnails.hitTest(_root._xmouse, _root._ymouse, 0))
  {
    mclThumbnails.dx = (_root._xmouse - screenCenter) / acceleration;
  }

  if (_root.is_move)
  {
    mclThumbnails.dx = mclThumbnails.dx * deceleration;
    if (Math.abs(mclThumbnails.dx) < leastSpeed)
    {
      if (mclThumbnails.dx > 0)
      {
        mclThumbnails.dx = leastSpeed;
      }
      else
      {
        mclThumbnails.dx = 0 - leastSpeed;
      }


    }

    mclThumbnails._x = mclThumbnails._x - mclThumbnails.dx;
    if (mclThumbnails._x < 0 - thumbnailsWidth)
    {
      mclThumbnails._x = mclThumbnails._x + thumbnailsWidth;
    }

    if (mclThumbnails._x > 0)
    {
      mclThumbnails._x = mclThumbnails._x - thumbnailsWidth;
    }

  }

}

loadPhotoXML("photoslist.xml");
mclThumbnails.onEnterFrame = function ()
{
  thumbnailsRoll();
}
;
  1. mclThumbnails.dx = 0.01;
  2. var mclWidth = 104;
  3. var screenCenter = 450;
  4. var acceleration = 100;
  5. var deceleration = 0.999;
  6. var leastSpeed = 2;
  7. ////////////////////////////////////////////////
  8. var photoXML = new XML();
  9. var photoNumber;
  10. var rootNode;
  11. var totalPhotos;
  12. var ids;
  13. var thumbnails = [];
  14. var link = [];
  15. var titleText = [];
  16. var thumbnailsWidth;
  17. var is_move = true;
  18. var i = 0;
  19. var nInterval;
  20. var nRow = 0;
  21. ///////////////////////////////////////////////
  22. function loadPhotoXML(filename)
  23. {
  24.   photoXML.ignoreWhite = true;
  25.   photoXML.load(filename);
  26.   photoXML.onLoad = function (success)
  27.   {
  28.     if (success)
  29.     {
  30.       photoNumber = 0;
  31.       rootNode = this.firstChild;
  32.       totalPhotos = rootNode.childNodes.length;
  33.       var __reg2 = 0;
  34.             while (__reg2 < totalPhotos * 2)
  35.       {
  36.         if (__reg2 < totalPhotos)
  37.         {
  38.           thumbnails[__reg2] = rootNode.childNodes[__reg2].childNodes[0].firstChild.nodeValue;
  39.           link[__reg2] = rootNode.childNodes[__reg2].childNodes[1].firstChild.nodeValue;
  40.           titleText[__reg2] = rootNode.childNodes[__reg2].childNodes[2].firstChild.nodeValue;
  41.         }
  42.         else
  43.         {
  44.           thumbnails[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[0].firstChild.nodeValue;
  45.           link[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[1].firstChild.nodeValue;
  46.           titleText[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[2].firstChild.nodeValue;
  47.         }
  48.         thumbnailsLoad(__reg2);
  49.         ++__reg2;
  50.       }
  51.       checkProgressLoad(0);
  52.             //caption.text = titleText[0];
  53.     }
  54.   }
  55.   ;
  56. }
  57. function thumbnailsLoad(k)
  58.     {
  59.   thumbnailsWidth = mclThumbnails._width;
  60.   mclThumbnails.attachMovie("scrollSymbol", "mcl" + k, mclThumbnails.getNextHighestDepth(), {_x: mclWidth * k});
  61.   var __reg4 = new MovieClipLoader();
  62.     this.caption.text = titleText[k]
  63.             trace(caption.text);
  64.   var __reg3 = new Object();
  65.   __reg3.onLoadInit = function (mclTarget)
  66.   {
  67.     mclTarget._alpha = 100;
  68.     var __reg4 = undefined;
  69.     var __reg5 = undefined;
  70.     __reg4 = mclTarget._x;
  71.     __reg5 = mclTarget._y;
  72.         mclTarget.onRollOver = function ()
  73.     {
  74.       _root.is_move = false;
  75.       this._alpha = 80;
  76.       this._parent._parent.gotoAndPlay("show");
  77.             caption.text = titleText[k];
  78.             trace(caption.text);
  79.             
  80.     }
  81.     ;
  82.     mclTarget.onRollOut = function ()
  83.     {
  84.       _root.is_move = true;
  85.       this._alpha = 95;
  86.       this._parent._parent.gotoAndPlay("hide");
  87.     }
  88.     ;
  89.     mclTarget.onDragOut = function ()
  90.     {
  91.       _root.is_move = true;
  92.       this._alpha = 95;
  93.       this._parent._parent.gotoAndPlay("hide");
  94.     }
  95.     ;
  96.     mclTarget.onPress = function ()
  97.     {
  98.             if(ids!=k) {
  99.             checkProgressLoad(k);
  100.             getURL(link[k], "_self");
  101.             trace(link[k]);
  102.             ids=k;
  103.                 }
  104.     }
  105.     ;
  106.   }
  107.   ;
  108.   __reg3.onLoadProgress = function (mclTarget, nLoaded, nTotal)
  109.   {
  110.     if (nLoaded != nTotal)
  111.     {
  112.       preloader._visible = true;
  113.       preloader.textf.text = "Thumbnails loading";
  114.       return;
  115.     }
  116.   }
  117.   ;
  118.   __reg4.addListener(__reg3);
  119.   mclThumbnails["mcl" + k].mclLoadPicture.createEmptyMovieClip("temp", this.getNextHighestDepth());
  120.   __reg4.loadClip(thumbnails[k], "mclThumbnails.mcl" + k + ".mclLoadPicture.temp");
  121.   thumbnailsWidth = mclWidth * totalPhotos;
  122. }
  123. function ff(j)
  124. {
  125.   ++nRow;
  126.   _root.mcHolder1.attachMovie("simplesquare", "mcsquare", _root.mcHolder1.getNextHighestDepth(), {_x: 13, _y: 0 + 12 * nRow});
  127.   _root.mcHolder1.mcsquare1._y = 6 + 12 * nRow;
  128.   if (nRow > 37)
  129.   {
  130.     removeMovieClip(_root.mcHolder1);
  131.     clearInterval(nInterval);
  132.     removeMovieClip(mclPicture["mcl" + j]);
  133.     nRow = 0;
  134.   }
  135. }
  136. function checkProgressLoad(k)
  137. {
  138.   var __reg3 = new MovieClipLoader();
  139.   var __reg2 = new Object();
  140.   mclPicture.attachMovie("imageSymbol", "mcl" + i, 1000 - (i + 1));
  141.   mclPicture["mcl" + i].mclLoadPicture.createEmptyMovieClip("temp", mclPicture["mcl" + i].mclLoadPicture.getNextHighestDepth());
  142.   __reg2.onLoadStart = function (mclTarget)
  143.   {
  144.     preloader._visible = true;
  145.   }
  146.   ;
  147.   __reg2.onLoadProgress = function (mclTarget, nLoaded, nTotal)
  148.   {
  149.     preloader.bar._alpha = 100;
  150.     preloader.bar._width = nLoaded / nTotal * 600;
  151.     preloader.textf.text = "Loaded " + Math.floor(nLoaded / 1000) + "Kb of " + Math.floor(nTotal / 1000) + " Kb";
  152.   }
  153.   ;
  154.   __reg2.onLoadComplete = function (mclTarget)
  155.   {
  156.     preloader.bar._width = 20;
  157.     preloader._visible = false;
  158.     mclTarget._parent._parent.gotoAndPlay("start_play");
  159.     if (i > 0)
  160.     {
  161.       nRow = 0;
  162.       clearInterval(nInterval);
  163.       removeMovieClip(_root.mcHolder1);
  164.       removeMovieClip(mclPicture["mcl" + (i - 2)]);
  165.       _root.createEmptyMovieClip("mcHolder1", _root.getNextHighestDepth());
  166.       _root.mcHolder1.attachMovie("mask_square", "mcsquare1", _root.mcHolder1.getNextHighestDepth());
  167.       _root.mcHolder1.mcsquare1._x = 0;
  168.       _root.mcHolder1.mcsquare1._y = 0;
  169.       _root.mcHolder1.mcsquare1._width = 600;
  170.       _root.mcHolder1.mcsquare1._height = 600;
  171.       mclPicture["mcl" + (i - 1)].mclLoadPicture.setMask(mcHolder1);
  172.       nInterval = setInterval(ff, 48, i - 1);
  173.     }
  174.     ++i;
  175.   }
  176.   ;
  177.   __reg3.addListener(__reg2);
  178.   if (k < totalPhotos)
  179.   {
  180.     __reg3.loadClip(url[k], "mclPicture.mcl" + i + ".mclLoadPicture.temp");
  181.     return;
  182.   }
  183.   __reg3.loadClip(url[k - totalPhotos], "mclPicture.mcl" + i + ".mclLoadPicture.temp");
  184. }
  185. function thumbnailsRoll()
  186. {
  187.   if (mclThumbnails.hitTest(_root._xmouse, _root._ymouse, 0))
  188.   {
  189.     mclThumbnails.dx = (_root._xmouse - screenCenter) / acceleration;
  190.   }
  191.   if (_root.is_move)
  192.   {
  193.     mclThumbnails.dx = mclThumbnails.dx * deceleration;
  194.     if (Math.abs(mclThumbnails.dx) < leastSpeed)
  195.     {
  196.       if (mclThumbnails.dx > 0)
  197.       {
  198.         mclThumbnails.dx = leastSpeed;
  199.       }
  200.       else
  201.       {
  202.         mclThumbnails.dx = 0 - leastSpeed;
  203.       }
  204.     }
  205.     mclThumbnails._x = mclThumbnails._x - mclThumbnails.dx;
  206.     if (mclThumbnails._x < 0 - thumbnailsWidth)
  207.     {
  208.       mclThumbnails._x = mclThumbnails._x + thumbnailsWidth;
  209.     }
  210.     if (mclThumbnails._x > 0)
  211.     {
  212.       mclThumbnails._x = mclThumbnails._x - thumbnailsWidth;
  213.     }
  214.   }
  215. }
  216. loadPhotoXML("photoslist.xml");
  217. mclThumbnails.onEnterFrame = function ()
  218. {
  219.   thumbnailsRoll();
  220. }
  221. ;


Thanks
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

what are you trying to do with this section? I want to make sure I don't break it for you.

Code: [ Select ]
if (success)

    {

      photoNumber = 0;

      rootNode = this.firstChild;

      totalPhotos = rootNode.childNodes.length;

      var __reg2 = 0;

     while (__reg2 < totalPhotos * 2)

      {

        if (__reg2 < totalPhotos)

        {

          thumbnails[__reg2] = rootNode.childNodes[__reg2].childNodes[0].firstChild.nodeValue;

          link[__reg2] = rootNode.childNodes[__reg2].childNodes[1].firstChild.nodeValue;

          titleText[__reg2] = rootNode.childNodes[__reg2].childNodes[2].firstChild.nodeValue;

        }

        else

        {

          thumbnails[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[0].firstChild.nodeValue;

          link[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[1].firstChild.nodeValue;

          titleText[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[2].firstChild.nodeValue;

        }



        thumbnailsLoad(__reg2);

        ++__reg2;

      }


      checkProgressLoad(0);

     //caption.text = titleText[0];

    }
  1. if (success)
  2.     {
  3.       photoNumber = 0;
  4.       rootNode = this.firstChild;
  5.       totalPhotos = rootNode.childNodes.length;
  6.       var __reg2 = 0;
  7.      while (__reg2 < totalPhotos * 2)
  8.       {
  9.         if (__reg2 < totalPhotos)
  10.         {
  11.           thumbnails[__reg2] = rootNode.childNodes[__reg2].childNodes[0].firstChild.nodeValue;
  12.           link[__reg2] = rootNode.childNodes[__reg2].childNodes[1].firstChild.nodeValue;
  13.           titleText[__reg2] = rootNode.childNodes[__reg2].childNodes[2].firstChild.nodeValue;
  14.         }
  15.         else
  16.         {
  17.           thumbnails[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[0].firstChild.nodeValue;
  18.           link[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[1].firstChild.nodeValue;
  19.           titleText[__reg2] = rootNode.childNodes[__reg2 - totalPhotos].childNodes[2].firstChild.nodeValue;
  20.         }
  21.         thumbnailsLoad(__reg2);
  22.         ++__reg2;
  23.       }
  24.       checkProgressLoad(0);
  25.      //caption.text = titleText[0];
  26.     }
  • routhu
  • Beginner
  • Beginner
  • User avatar
  • Posts: 47
  • Loc: India

Post 3+ Months Ago

Hi graphixboy,

The code is for continuity of scrolling images means we are looping the images. From the last week i am trying but till now i am not success.
  • routhu
  • Beginner
  • Beginner
  • User avatar
  • Posts: 47
  • Loc: India

Post 3+ Months Ago

Any help...?
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

sorry I've been swamped at work. I'll take a look at it later today.

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 16 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.