Action Script Help

  • chand
  • Born
  • Born
  • chand
  • Posts: 1

Post 3+ Months Ago

Hai All,

I am new to action script. I have already Vertical XML Gallery, If anybody can convert into Horizontal...

Thanks
chandu

Here is my code:

Code: [ Select ]
function moveNext()
{
  for (var _loc2 = 0; _loc2 < len; ++_loc2)
  {
    var _loc1 = thumbBlock["thumbImg" + _loc2];
    if (_loc1.targetY == -spaceY)
    {
      _loc1._y = _loc1.targetY = spaceY * showNum;
      _loc1.no = setNumber(_loc1.no, totalNum);
      loadThumb(_loc1, _loc1.no);
      continue;
    } // end if
    _loc1.targetY = _loc1.targetY - spaceY;
  } // end of for
} // End of the function
function movePrev()
{
  for (var _loc2 = 0; _loc2 < len; ++_loc2)
  {
    var _loc1 = thumbBlock["thumbImg" + _loc2];
    if (_loc1.targetY == spaceY * showNum)
    {
      _loc1._y = _loc1.targetY = -spaceY;
      _loc1.no = setNumber(_loc1.no, totalNum);
      loadThumb(_loc1, _loc1.no);
      continue;
    } // end if
    _loc1.targetY = _loc1.targetY + spaceY;
  } // end of for
} // End of the function



isNext = true;
spaceY = thumbYsize + ySpaceThumb;
thumbBlock._x = xThumb;
thumbBlock._y = yThumb;
mask._x = xThumb - maskMargin;
mask._y = yThumb - maskMargin;
mask._width = thumbXsize + maskMargin * 2;
mask._height = spaceY * showNum + maskMargin * 2;
thumbBlock.setMask(mask);
k = i = 0;
len = showNum + 2;
openNum = 0;
while (k < len)
{
  var _mc = thumbBlock.thumbImg.duplicateMovieClip("thumbImg" + k, k);
  _mc.targetY = spaceY * k;
  _mc._y = -50 * k;
  _mc.no = i;
  loadThumb(_mc, _mc.no);
  if (k == showNum + 1)
  {
    _mc._y = _mc.targetY = -spaceY;
    _mc.no = i = totalNum - 1;
    loadThumb(_mc, _mc.no);
  } // end if
  if (i == totalNum - 1)
  {
    i = 0;
  }
  else
  {
    ++i;
  } // end else if
  _mc.onRollOver = function ()
  {
    timer.gotoAndStop(1);
  };
  _mc.onRollOut = function ()
  {
    timer.play();
  };
  _mc.onRelease = function ()
  {
    if (this.no != openNum)
    {
      loadImage(this.no);
    } // end if
  };
  _mc.onEnterFrame = function ()
  {
    this._y = this._y + 2.000000E-001 * (this.targetY - this._y);
  };
  ++k;
} // end while
nextBtn.onRelease = function ()
{
  isNext = true;
  moveNext();
  timer.gotoAndPlay(1);
};
prevBtn.onRelease = function ()
{
  isNext = false;
  movePrev();
  timer.gotoAndPlay(1);
};
thumbBlock.thumbImg._visible = false;
loadImage(openNum);
  1. function moveNext()
  2. {
  3.   for (var _loc2 = 0; _loc2 < len; ++_loc2)
  4.   {
  5.     var _loc1 = thumbBlock["thumbImg" + _loc2];
  6.     if (_loc1.targetY == -spaceY)
  7.     {
  8.       _loc1._y = _loc1.targetY = spaceY * showNum;
  9.       _loc1.no = setNumber(_loc1.no, totalNum);
  10.       loadThumb(_loc1, _loc1.no);
  11.       continue;
  12.     } // end if
  13.     _loc1.targetY = _loc1.targetY - spaceY;
  14.   } // end of for
  15. } // End of the function
  16. function movePrev()
  17. {
  18.   for (var _loc2 = 0; _loc2 < len; ++_loc2)
  19.   {
  20.     var _loc1 = thumbBlock["thumbImg" + _loc2];
  21.     if (_loc1.targetY == spaceY * showNum)
  22.     {
  23.       _loc1._y = _loc1.targetY = -spaceY;
  24.       _loc1.no = setNumber(_loc1.no, totalNum);
  25.       loadThumb(_loc1, _loc1.no);
  26.       continue;
  27.     } // end if
  28.     _loc1.targetY = _loc1.targetY + spaceY;
  29.   } // end of for
  30. } // End of the function
  31. isNext = true;
  32. spaceY = thumbYsize + ySpaceThumb;
  33. thumbBlock._x = xThumb;
  34. thumbBlock._y = yThumb;
  35. mask._x = xThumb - maskMargin;
  36. mask._y = yThumb - maskMargin;
  37. mask._width = thumbXsize + maskMargin * 2;
  38. mask._height = spaceY * showNum + maskMargin * 2;
  39. thumbBlock.setMask(mask);
  40. k = i = 0;
  41. len = showNum + 2;
  42. openNum = 0;
  43. while (k < len)
  44. {
  45.   var _mc = thumbBlock.thumbImg.duplicateMovieClip("thumbImg" + k, k);
  46.   _mc.targetY = spaceY * k;
  47.   _mc._y = -50 * k;
  48.   _mc.no = i;
  49.   loadThumb(_mc, _mc.no);
  50.   if (k == showNum + 1)
  51.   {
  52.     _mc._y = _mc.targetY = -spaceY;
  53.     _mc.no = i = totalNum - 1;
  54.     loadThumb(_mc, _mc.no);
  55.   } // end if
  56.   if (i == totalNum - 1)
  57.   {
  58.     i = 0;
  59.   }
  60.   else
  61.   {
  62.     ++i;
  63.   } // end else if
  64.   _mc.onRollOver = function ()
  65.   {
  66.     timer.gotoAndStop(1);
  67.   };
  68.   _mc.onRollOut = function ()
  69.   {
  70.     timer.play();
  71.   };
  72.   _mc.onRelease = function ()
  73.   {
  74.     if (this.no != openNum)
  75.     {
  76.       loadImage(this.no);
  77.     } // end if
  78.   };
  79.   _mc.onEnterFrame = function ()
  80.   {
  81.     this._y = this._y + 2.000000E-001 * (this.targetY - this._y);
  82.   };
  83.   ++k;
  84. } // end while
  85. nextBtn.onRelease = function ()
  86. {
  87.   isNext = true;
  88.   moveNext();
  89.   timer.gotoAndPlay(1);
  90. };
  91. prevBtn.onRelease = function ()
  92. {
  93.   isNext = false;
  94.   movePrev();
  95.   timer.gotoAndPlay(1);
  96. };
  97. thumbBlock.thumbImg._visible = false;
  98. loadImage(openNum);
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Should be as easy as changing some letter Ys to Xs & the word height to width in a bunch of places.
Maybe some other minor tweaking.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

Yea joebert, but it's always easier if someone else is doing it for you.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 5 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.