![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
![]() |
|
|
|
|||||
|
Здравствуйте, помогите пожалуйста новичку.
Мне понравился переход картинок, сделанный в примере (см вложения) Размер сцены в примере 750х300 пикс. Я взял его за основу, но увеличил размер сцены до 1366х768. В описании примера написано, что для изменения размеров этого достаточно, однако это не так. Эффект выполняется не в моем размере, а в меньшем (см. вложения) Как это можно исправить? Спасибо! Вот код, расположенный внутри: stop(); Stage.scaleMode = "noScale"; // This is where you insert all your img1,img2,img3,... movieclips // Attention! Don't forget NOT to put "," (comma) after the last one loop = true; frames = new Array( img1, img2, img3, img4, img5, img6 ); // Circle Functions circleListener = null; CurrentFrame = null; CurrentFrameNumber = null; erasing = false; initcirclesequence(); function initcirclesequence() { for (i=0; i<frames.length; i++) { frames[i]._visible = false; frames[i].gotoAndStop(1); } CurrentFrame = frames[0].duplicateMovieClip("cf", 996); CurrentFrameNumber = 0; circleListener = createEmptyMovieClip("circleListener", 998); CurrentFrame._visible = true; CurrentFrame.gotoAndPlay(1); } // This onEnterFrame function listens to see if one of the movieclips has finished playing and if it has, it erases it out of view circleListener.onEnterFrame = function() { if (erasing == true) { return; } if (CurrentFrame._currentframe == CurrentFrame._totalframes) { var NextFrameNumber = CurrentFrameNumber == frames.length-1 ? 0 : CurrentFrameNumber+1; if (NextFrameNumber == 0 && loop == false) { circleListener.onEnterFrame = null; return; } var NextFrame = frames[NextFrameNumber].duplicateMovieClip("nf", 995); CurrentFrame.stop(); NextFrame._visible = true; NextFrame.gotoAndStop(1); erasing = true; mycircle(CurrentFrame); } }; function mycircle(sender) { // Speed of the circles (1-8) speed = 2; // Speed of the sizing scalespeed = 1000; // Circles direction (1-8) mode = random(8)+1; // Circle steps: Diamond = 4, Pentagon = 5, Circle = 15 steps = 15; // Circle radius radius = 30; // Movieclips erased when this radius is reached removeradius = 3; // Transition delay (frames) tansdelay = 6; // Don't edit anything beyond this point created = 0; done = 0; startdepth = 1; createEmptyMovieClip("circleContainer", startdepth); circleContainer.createEmptyMovieClip("circle", startdepth+1); // Circle drawing lx = Math.cos(0)*radius; ly = Math.sin(0)*radius; sender.setMask(circleContainer); circleContainer.circle.lineStyle(1, 0xFFFFFF, 100); circleContainer.circle.moveTo(lx, ly); circleContainer.circle.beginFill(0xFFFFFF, 100); for (s=1; s<steps+2; s++) { lx = Math.cos((s/steps)*360*Math.PI/180)*radius; ly = Math.sin((s/steps)*360*Math.PI/180)*radius; circleContainer.circle.lineTo(lx, ly); } circleContainer.circle.endFill(0x000000, 100); circleContainer.circle._visible = false; circleContainer.circle._x = -1000; circleContainer.circle._y = -1000; // Grid i = startdepth+2; // This assumes that the registration point is centered vertical and horizontal for (y=sender._y-sender._height/2; y<=(sender._y+sender._height/2)+radius; y += radius) { for (x=sender._x-sender._width/2; x<=(sender._x+sender._width/2)+radius; x += radius) { i++; circleContainer.circle.duplicateMovieClip("o"+i, i); created++; o = circleContainer["o"+i]; o._x = x; o._y = y; o._visible = true; switch (mode) { case 1 : o.wait = x*y/2.5; break; case 2 : o.wait = y*sender._height/2; break; case 3 : o.wait = (-y+sender._height+24)*200; break; case 4 : o.wait = (-x+sender._width+24)*150; break; case 5 : o.wait = x*sender._height/2; break; case 6 : o.wait = (-x+sender._width+24)*y/2; break; case 7 : o.wait = (-y+sender._height+24)*x/2; break; case 8 : o.wait = (-y+sender._height+24)*(-x+sender._width)/2; break; } } } enddepth = startdepth+2+i; // Animation f = 0; circleContainer.onEnterFrame = function() { if (done<created) { for (i=startdepth+2; i<=enddepth; i++) { obj = circleContainer["o"+i]; if (obj != undefined) { if (f>obj.wait/(scalespeed*speed)) { obj._width -= speed; obj._height -= speed; } if (obj._height<=2 || obj._width<=2) { obj.removeMovieClip(); done++; } } } } else { CurrentFrame._visible = false; CurrentFrame.gotoAndStop(1); CurrentFrameNumber = CurrentFrameNumber == frames.length-1 ? 0 : CurrentFrameNumber+1; CurrentFrame = frames[CurrentFrameNumber].duplicateMovieClip("cf", 996); CurrentFrame.gotoAndPlay(1); CurrentFrame._visible = true; erasing = false; circleContainer.onEnterFrame = null; circleContainer.unloadMovie(); return; } f++; }; } ///////// // End // /////////
__________________
Большое Вам спасибо! |
|
|||||
|
Скажем так. Хорошо бы увидеть исходник. Сам по себе код работать отказывается.
А то сейчас всё это выглядит как если бы вы выложили фотографию гайки и спросили, почему взорвался Челленджер... |
|
|||||
|
example.rar - изначальный файл с примером
work.rar - мой файл, с которым я работаю
__________________
Большое Вам спасибо! |
|
|||||
|
Ндя. Всё оказалось просто, как апельсин.
Выровняйте свою картинку внутри клипа ( например Edit_Image 1 ) по ЦЕНТРУ энтого клипа. И всё ![]() Сейчас у вас центр клипа выше и левее центра картинки. |
|
|||||
|
Огромное спасибо! Не скоро ,сам бы догадался :о)
__________________
Большое Вам спасибо! |
|
|||||
|
Ха!!! Я сам никак не мог понять в чем дело, пока ролик на весь экран не увеличил. И увидел что кружки за край торчат... И тут все сразу стало ясно.
|
|
|||||
|
А где здесь устанавливается задержка между сменой кадров?
__________________
Большое Вам спасибо! |
|
|||||
|
Длинной таймлайна внутри клипа Edit_Image 1-2-3-4
Корявое решение. Я бы переделал на setInterval всю шнягу. |
|
|||||
|
До этого мне пока далеко. Спасибо :о)
__________________
Большое Вам спасибо! |
![]() |
![]() |
Часовой пояс GMT +4, время: 01:30. |
|
|
« Предыдущая тема | Следующая тема » |
|
|