![]() |
|
||||||||||
|
|||||
|
Регистрация: Jan 2010
Сообщений: 7
|
В архиве лежит исходник с очень приятным текстовым эффектом.
hack50_fadeIn.swf Но текст только появляется. Что нужно добавить, чтобы текст появлялся, а через определенное время точно так же пропадал? (от первой буквы к последней) Думаю данный эффект многим начинающим (типа меня) будет интересен ![]() |
|
|||||
|
Регистрация: Jan 2010
Сообщений: 7
|
Что, никто так и не поможет?
|
|
|||||
|
блогер
Регистрация: Feb 2008
Адрес: Россия, Новосибирск, Академгородок
Сообщений: 2,113
Записей в блоге: 1
|
Я помогу. Замените код:
function fadeZoom(target:MovieClip, delay:Number):Void { target.interval = function() { target._visible = true; clearInterval(target.intervalID); target.onEnterFrame = function() { target._xscale -= (target._xscale-100)/3; target._yscale -= (target._yscale-100)/3; target._alpha -= (target._alpha-100)/3; if (Math.abs(target._xscale-100)<1) { target._xscale = 100; target._yscale = 100; target._alpha = 100; delete target.onEnterFrame; target.fadeOutInterval = setInterval(fadeOut, 1000, target); } }; }; target.intervalID = setInterval(target, "interval", delay); target._xscale = 2000; target._yscale = 2000; target._alpha = 0; } function fadeOut(target) { clearInterval(target.fadeOutInterval); target.onEnterFrame = function() { target._xscale -= (target._xscale)/3; target._yscale -= (target._yscale)/3; target._alpha -= (target._alpha)/3; if (target._xscale<2) { target._xscale = 0; target._yscale = 0; target._alpha = 0; delete target.onEnterFrame; } }; } function placeText(target:MovieClip, x:Number, y:Number, banner:String, tFormat:TextFormat, effectFunction:Function, delay:Number):Void { // For each character... for (var i = 0; i<banner.length; i++) { // Create a clip and place the current // character in the text field inside it. var char:MovieClip = target.attachMovie("letter", "char"+i, target.getNextHighestDepth()); char.field.text = banner.substr(i, 1); char._x = x; char._y = y; // Add the width of the current text character to the // next letter's x position. x += tFormat.getTextExtent(char.field.text).width; // // Here is the effect function call, passed in as a parameter effectFunction(char, i*delay); } } var format:TextFormat = new TextFormat(); format.font = "Arial"; format.size = 24; placeText(this, 100, 200, "This is a text effect", format, fadeZoom, 100);
__________________
hauts.ru |
|
|||||
|
Регистрация: Jan 2010
Сообщений: 7
|
Спасибо огромное :-)
|
![]() |
![]() |
Часовой пояс GMT +4, время: 22:42. |
|
|
« Предыдущая тема | Следующая тема » |
|
|