![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
![]() |
|
|||||
|
Регистрация: Feb 2008
Сообщений: 890
|
Есть что-то вроде порядка 240 кадров анимации, как и во что их лучше собрать минуя Flash IDE? Что мне с ними со всеми делать?)))
__________________
скриптограф |
|
|||||
|
буду краток
модератор форума
Регистрация: Sep 2003
Адрес: Ближайшее Замкадье
Сообщений: 3,110
Записей в блоге: 28
|
Если речь идёт о секвенции битмап, то я использовал идеи
http://blog.hexagonstar.com/animatedbitmapclass/ для склейки сделал скриптик: http://www.flasher.ru/forum/blog.php?b=111
__________________
Отряд Котовскага |
|
|||||
|
Регистрация: Feb 2008
Сообщений: 890
|
Мне не удастся создать какой-нибудь swf со всем содержимым и придется все время картинки держать рядом, чтобы они загружались в динамике?
__________________
скриптограф |
|
|||||
|
буду краток
модератор форума
Регистрация: Sep 2003
Адрес: Ближайшее Замкадье
Сообщений: 3,110
Записей в блоге: 28
|
Embeded + swc- больше добавить нечего
я практически всё делаю в ФД.
__________________
Отряд Котовскага |
|
|||||
|
Регистрация: Feb 2008
Сообщений: 890
|
Ну вот передо мной сейчас FD и 240 картинок, я смотрю то на FD, то на картинки, и не понимаю как мне это все друг с другом связать. Не эмбедить же вручную все 240 картинок)))
Добавлено через 12 минут Если по картинке в менеджере проекта щелкнуть правой мышей и выбрать "Add To Library" - это что такое?
__________________
скриптограф |
|
|||||
|
Можно загружать Loader`ами. В чем причина отказа от Flash IDE?
__________________
Тут мужик танцует и поёт про флэш |
|
|||||
|
буду краток
модератор форума
Регистрация: Sep 2003
Адрес: Ближайшее Замкадье
Сообщений: 3,110
Записей в блоге: 28
|
Объедини мелкие картинки кадров в одну битмапу по моему способу (так будет намного меньше весить)
потом склеенные картинки я всё-таки вшиваю во .fla - потом линкую - делаю swc из них. флэш (иде) использую потому-что он намного лучше сжимает чем ембедед и автоматом гененрит swc, но можно обойтись и без него. Добавлено через 2 минуты Просто часто есть ситуации, когда флэшка должна включать всё и не разрешается подгрузка ресурсов - например: игры для некоторых порталов..
__________________
Отряд Котовскага Последний раз редактировалось Котяра; 03.06.2010 в 00:54. |
|
|||||
|
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
Кстати да, если собрать фотошопом в одну картинку, то с ембедом мороки вообще никакой)) А скрипт чтобы бегать по ней, показывая нужный Rectangle, я думаю ты без труда напишешь. Можно это переделать (240 для ленты слишком много)
http://flasher.ru/forum/showpost.php...83&postcount=8
__________________
Reality.getBounds(this); |
|
|||||
|
Регистрация: Feb 2008
Сообщений: 890
|
Котяра, Wolsh, адский отжиг со склейкой))))) Мне нравится))))))
__________________
скриптограф |
|
|||||
|
буду краток
модератор форума
Регистрация: Sep 2003
Адрес: Ближайшее Замкадье
Сообщений: 3,110
Записей в блоге: 28
|
вот мой пример.
package utils.animation { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.BitmapDataChannel; import flash.events.EventDispatcher; import flash.events.TimerEvent; import flash.geom.ColorTransform; import flash.geom.Point; import flash.geom.Rectangle; /** * An AnimatedBitmap is a bitmap object that uses a sequence of images * from a provided bitmap to play an animation. * * @author Sascha Balkau * @version 1.1.0 */ public class AnimatedBitmap extends EventDispatcher { // Properties ///////////////////////////////////////////////////////////////// /** * The buffer to store the whole bitmap. * @private */ //public var _buffer:BitmapData; /** * Timer used for frame animation. * @private */ private var _timer:FrameRateTimer; /** * The number of frames that the animated bitmap has. * @private */ private var _frameAmount:int; /** * Used for the onTimer function to count loops. * @private */ private var _frameNr:int; /** * Determines if the animTile is already playing or not. * @private */ private var _isPlaying:Boolean; /** * Point object used for copyPixels operation. * @private */ private var _point:Point; /** * Rectangle object used for copyPixels operation. * @private */ private var _rect:Rectangle; private var sourceBitmapData:BitmapData; private var bitmapData:BitmapData; private var col:int; private var raw:int; private var width:int; private var height:int; private var alphaBitmapData:BitmapData; private var nullPoint:Point=new Point(); private var ctAlpha:ColorTransform; private var alphaMultiplier:Number =0.55; // Constructor //////////////////////////////////////////////////////////////// /** * Creates a new AnimatedBitmap instance. * * @param bitmap The bitmapData object that contains the image sequence * for the animated bitmap. * @param w The width of the animated bitmap. * @param h The height of the animated bitmap. * @param timer The frame rate timer used for the animated bitmap. */ public function AnimatedBitmap($sourceBitmapData:BitmapData,$bitmapData:BitmapData,timer:FrameRateTimer,$col:int,$raw:int) { sourceBitmapData = $sourceBitmapData; bitmapData = $bitmapData; bitmapData.lock(); // TODO: указывать кол-во кадров отдельно /* _buffer = bitmap; _frameAmount = _buffer.width / width; */ _frameNr = 1; col=$col; raw = $raw; _frameAmount = col*raw; _isPlaying = false; _timer = timer; _point = new Point(0, 0); width = bitmapData.width; height = bitmapData.height; alphaBitmapData = new BitmapData(width, height, true, 0xFF10FFFF); _rect = new Rectangle(0, 0, width, height); ctAlpha = new ColorTransform(); ctAlpha.alphaMultiplier = alphaMultiplier; } // Public Methods ///////////////////////////////////////////////////////////// /** * Sets the frame rate timer object used for the animated * bitmap. This method is useful when it is desired to change * the framerate at a later timer. * * @param timer The frame rate timer used for the animated bitmap. */ public function setFrameRateTimer(timer:FrameRateTimer):void { if (_isPlaying) { stop(); _timer = timer; play(); } else { _timer = timer; } } /** * Returns the frame rate with that the animated bitmap is playing. * * @return The fps value of the animated bitmap. */ public function getFrameRate():int { return _timer.getFrameRate(); } /** * Returns the current frame position of the animated bitmap. * * @return The current frame position. */ public function getCurrentFrame():int { return _frameNr; } /** * Returns the total amount of frames that the animated bitmap has. * * @return The total frame amount. */ public function getTotalFrames():int { return _frameAmount; } /** * Returns whether the animated bitmap is playing or not. * * @return true if the animated bitmap is playing, else false. */ public function isPlaying():Boolean { return _isPlaying; } /** * Starts the playback of the animated bitmap. If the animated * bitmap is already playing while calling this method, it calls * stop() and then play again instantly to allow for framerate * changes during playback. */ public function play():void { if (!_isPlaying) { _isPlaying = true; _timer.addEventListener(TimerEvent.TIMER, playForward); _timer.start(); // bitmapData.unlock(); } else { stop(); play(); } } /** * Stops the playback of the animated bitmap. */ public function stop():void { if (_isPlaying) { _timer.stop(); _timer.removeEventListener(TimerEvent.TIMER, playForward); _isPlaying = false; } } /** * Jumps to the specified frameNr and plays the animated * bitmap from that position. Note that the frames of an * animated bitmap start at 1. * * @param frameNr The frame number to which to jump. */ public function gotoAndPlay(frameNr:int):void { _frameNr = frameNr - 1; play(); } /** * Jumps to the specified frameNr and stops the animated * bitmap at that position. Note that the frames of an * animated bitmap start at 1. * * @param frameNr The frame number to which to jump. */ public function gotoAndStop(frameNr:int):void { if (frameNr >= _frameNr) { _frameNr = frameNr - 1; nextFrame(); } else { _frameNr = frameNr + 1; prevFrame(); } } /** * Moves the animation to the next of the current frame. * If the animated bitmap is playing, the playback is * stopped by this operation. */ public function nextFrame():void { if (_isPlaying) stop(); _frameNr++; if (_frameNr > _frameAmount) _frameNr = _frameAmount; draw(); } /** * Moves the animation to the previous of the current frame. * If the animated bitmap is playing, the playback is * stopped by this operation. */ public function prevFrame():void { if (_isPlaying) stop(); _frameNr--; if (_frameNr < 1) _frameNr = 1; draw(); } // Private Methods //////////////////////////////////////////////////////////// /** * Plays the animation forward by one frame. * @private */ private function playForward(event:TimerEvent = null):void { _frameNr++; if (_frameNr > _frameAmount) { dispatchEvent(new FrameEvent(FrameEvent.END_LINE)); _frameNr = 1; } else if (_frameNr < 1) _frameNr = _frameAmount; draw(); //event.updateAfterEvent(); } /** * Plays the animation backwards by one frame. * @private */ private function playBackward():void { _frameNr--; if (_frameNr < 1) _frameNr = _frameAmount; draw(); } /** * Draws the next bitmap frame from the buffer to the animated bitmap. * @private */ private function draw():void { dispatchEvent(new FrameEvent(FrameEvent.ENTER)); var i:int = _frameNr % col; var j:int = _frameNr / col; _rect = new Rectangle((i-1) * width, j * height, width, height); //var tmpData:BitmapData = bitmapData.clone(); //tmpData.copyChannel(alphaBitmapData, tmpData.rect, nullPoint, BitmapDataChannel.RED, BitmapDataChannel.ALPHA); //bitmapData.copyChannel(alphaBitmapData, bitmapData.rect, nullPoint, BitmapDataChannel.RED, BitmapDataChannel.ALPHA); //bitmapData.merge(bitmapData, bitmapData.rect, nullPoint, 1,1,1,.3); //bitmapData.copyPixels(sourceBitmapData, _rect, _point, null, null, true); /*bitmapData.lock(); bitmapData.colorTransform(bitmapData.rect, ctAlpha); bitmapData.copyPixels(sourceBitmapData, _rect, _point, null, null, true); bitmapData.unlock();*/ bitmapData.copyPixels(sourceBitmapData, _rect, _point); } public function remove():void { _timer.stop(); _timer.removeEventListener(TimerEvent.TIMER, playForward); bitmapData.dispose(); } } }
__________________
Отряд Котовскага Последний раз редактировалось Котяра; 03.06.2010 в 01:19. |
![]() |
![]() |
Часовой пояс GMT +4, время: 18:03. |
|
|
« Предыдущая тема | Следующая тема » |
|
|