![]() |
|
||||||||||
|
|||||
|
Регистрация: Aug 2011
Сообщений: 100
|
Подскажите пожалуйста, ктор аботал с этой библиотекой.
Хочу применить эффект к тексту Скопировал весь скрипт из туториала. // Import the necessary classes. import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.text.magneticWind.FETMagneticWind; import com.jumpeye.flashEff2.text.xyscale.FETXYScale; import com.jumpeye.flashEff2.text.emerge.FETEmerge; // Create the text format for the font. var txtFormat:TextFormat = new TextFormat(); txtFormat.font = "Arial"; txtFormat.align = "center"; txtFormat.color = 0x0099FF; txtFormat.size = 40; // Create the text field, set it up and add it to the display list. var myText:TextField = new TextField(); myText.type = "dynamic"; myText.embedFonts = true; myText.antiAliasType = "advanced"; myText.multiline = true; myText.wordWrap = true; myText.autoSize = "center"; addChild(myText); // Add the text into the text field (text should be as HTML). myText.defaultTextFormat = txtFormat; myText.htmlText = "The quick brown fox jumps over the lazy dog"; // Center the text field on the stage. myText.width = 350; myText.x = (stage.stageWidth - myText.width) / 2; myText.y = (stage.stageHeight - myText.height) / 2; // Create the FlashEff2Code instance and add it to the stage. The FlashEff2Code // component must be in the display list in order for it to work. var effect:FlashEff2Code = new FlashEff2Code(); effect.addEventListener(FLASHEFFEvents.TRANSITION_END, replay); addChild(effect); // Create the show pattern instance (FESBrightSquares) and set it // so the effect looks as you like. var showEffect:FETMagneticWind = new FETMagneticWind(); showEffect.randomX = 200; showEffect.randomY = 50; showEffect.groupDuration = 1.5; showEffect.tweenDuration = 2; // Create the hide pattern instance (FESEqualizer) and set it // so the effect looks as you like. var hideEffect:FETXYScale = new FETXYScale(); hideEffect.positionX = -15; hideEffect.positionY = -50; hideEffect.preset = 9; // char: random hideEffect.groupDuration = 1.5; hideEffect.tweenDuration = 2; // Assign the show and hide transitions to the FlashEff2Code instance. effect.showTransition = showEffect; effect.hideTransition = hideEffect; // There will be a 3 seconds pause between the show and hide transitions. effect.hideDelay = 3; // Set the target text field to the FlashEff2Code instance. Once you do this, // the show effect will start immediately (except the case when the // show effect has a delay too). effect.target = myText; // When the "hide" transition ends, start the show effect again. function replay(evt:FLASHEFFEvents):void { if (effect.currentTransitionType == "hide") effect.show(); } ![]() Объяните пожалуйста, что не так... |
|
|||||
|
Модрон-ветеринар
|
С этой библиотекой не работал, но может быть у вас шрифт не внедрен?
Не в смысле строки embedFonts = true, а "физически" шрифт не внедрен в проект? Без этого действия такое объявление внедрения приведет как раз к пустому полю. Попробуйте просто для начала убрать строку
__________________
Идите первым! |
|
|||||
|
Регистрация: Aug 2011
Сообщений: 100
|
Точно ! Спасибо!
|
|
|||||
|
Модрон-ветеринар
|
Но внедрить все-таки желательно, хотя Arial в общем-то везде есть.
Где-нибудь просто вне области видимости создайте динамическое поле и внедрите в него все наборы глифов, какие надо. Тогда эта строка заработает.
__________________
Идите первым! |
|
|||||
|
Регистрация: Aug 2011
Сообщений: 100
|
Цитата:
Может вы подскажете, как мне вызвать эффект в этом коде FETEmerge ? Что нужно поменять в as ? |
|
|||||
|
Модрон-ветеринар
|
Увы, не в курсе.
__________________
Идите первым! |
|
|||||
|
Регистрация: Aug 2011
Сообщений: 100
|
Понял
Спасибо за помощь! |
![]() |
![]() |
Часовой пояс GMT +4, время: 01:59. |
|
|
« Предыдущая тема | Следующая тема » |
| Теги |
| FlashEff2 |
|
|