Action Script Aide

  • chand
  • Born
  • Born
  • No Avatar
  • Inscription: Juin 19, 2007
  • Messages: 1
  • Status: Offline

Message Juin 19th, 2007, 1:01 am

Hai tous,

Je suis nouveau à action script. J'ai déjà XML Galerie Verticale, si quelqu'un peut convertir en horizontal...

Merci
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);
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Juin 19th, 2007, 1:01 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Inscription: Fév 10, 2004
  • Messages: 13455
  • Loc: Florida
  • Status: Offline

Message Juin 19th, 2007, 3:00 am

Devrait être aussi facile que la modification de certaines lettre X & Y à la hauteur à la largeur de mot dans un tas d'endroits.
Peut-être que certains ajustements mineurs.
Strong with this one, the sudo is.
  • IceCold
  • Guru
  • Guru
  • Avatar de l’utilisateur
  • Inscription: Nov 05, 2004
  • Messages: 1254
  • Loc: Ro
  • Status: Offline

Message Juin 21st, 2007, 5:04 am

Joebert Oui, mais c'est toujours plus facile si quelqu'un d'autre est là pour ça.
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Afficher de l'information

  • Total des messages de ce sujet: 3 messages
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 45 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC