Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 3.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 02.06.2010, 22:27
orcpochta вне форума Посмотреть профиль Отправить личное сообщение для orcpochta Найти все сообщения от orcpochta
  № 1  
Ответить с цитированием
orcpochta

Регистрация: Feb 2008
Сообщений: 890
По умолчанию Собрать ~240 кадров в анимацию без Flash IDE

Есть что-то вроде порядка 240 кадров анимации, как и во что их лучше собрать минуя Flash IDE? Что мне с ними со всеми делать?)))
__________________
скриптограф

Старый 02.06.2010, 22:48
Котяра вне форума Посмотреть профиль Отправить личное сообщение для Котяра Посетить домашнюю страницу Котяра Найти все сообщения от Котяра
  № 2  
Ответить с цитированием
Котяра
буду краток
 
Аватар для Котяра

модератор форума
Регистрация: Sep 2003
Адрес: Ближайшее Замкадье
Сообщений: 3,110
Записей в блоге: 28
Отправить сообщение для Котяра с помощью ICQ Отправить сообщение для Котяра с помощью Skype™
Если речь идёт о секвенции битмап, то я использовал идеи
http://blog.hexagonstar.com/animatedbitmapclass/
для склейки сделал скриптик:
http://www.flasher.ru/forum/blog.php?b=111
__________________
Отряд Котовскага

Старый 02.06.2010, 23:19
orcpochta вне форума Посмотреть профиль Отправить личное сообщение для orcpochta Найти все сообщения от orcpochta
  № 3  
Ответить с цитированием
orcpochta

Регистрация: Feb 2008
Сообщений: 890
Мне не удастся создать какой-нибудь swf со всем содержимым и придется все время картинки держать рядом, чтобы они загружались в динамике?
__________________
скриптограф

Старый 02.06.2010, 23:30
Котяра вне форума Посмотреть профиль Отправить личное сообщение для Котяра Посетить домашнюю страницу Котяра Найти все сообщения от Котяра
  № 4  
Ответить с цитированием
Котяра
буду краток
 
Аватар для Котяра

модератор форума
Регистрация: Sep 2003
Адрес: Ближайшее Замкадье
Сообщений: 3,110
Записей в блоге: 28
Отправить сообщение для Котяра с помощью ICQ Отправить сообщение для Котяра с помощью Skype™
Embeded + swc- больше добавить нечего
я практически всё делаю в ФД.
__________________
Отряд Котовскага

Старый 02.06.2010, 23:38
orcpochta вне форума Посмотреть профиль Отправить личное сообщение для orcpochta Найти все сообщения от orcpochta
  № 5  
Ответить с цитированием
orcpochta

Регистрация: Feb 2008
Сообщений: 890
Цитата:
Сообщение от Котяра Посмотреть сообщение
Embeded + swc- больше добавить нечего
я практически всё делаю в ФД.
Ну вот передо мной сейчас FD и 240 картинок, я смотрю то на FD, то на картинки, и не понимаю как мне это все друг с другом связать. Не эмбедить же вручную все 240 картинок)))

Добавлено через 12 минут
Если по картинке в менеджере проекта щелкнуть правой мышей и выбрать "Add To Library" - это что такое?
__________________
скриптограф

Старый 03.06.2010, 00:12
Psycho Tiger вне форума Посмотреть профиль Отправить личное сообщение для Psycho Tiger Найти все сообщения от Psycho Tiger
  № 6  
Ответить с цитированием
Psycho Tiger
 
Аватар для Psycho Tiger

блогер
Регистрация: Jun 2005
Адрес: Toronto
Сообщений: 6,599
Записей в блоге: 17
Можно загружать Loader`ами. В чем причина отказа от Flash IDE?

Старый 03.06.2010, 00:17
Котяра вне форума Посмотреть профиль Отправить личное сообщение для Котяра Посетить домашнюю страницу Котяра Найти все сообщения от Котяра
  № 7  
Ответить с цитированием
Котяра
буду краток
 
Аватар для Котяра

модератор форума
Регистрация: Sep 2003
Адрес: Ближайшее Замкадье
Сообщений: 3,110
Записей в блоге: 28
Отправить сообщение для Котяра с помощью ICQ Отправить сообщение для Котяра с помощью Skype™
Объедини мелкие картинки кадров в одну битмапу по моему способу (так будет намного меньше весить)
потом склеенные картинки я всё-таки вшиваю во .fla - потом линкую - делаю swc из них. флэш (иде) использую потому-что он намного лучше сжимает чем ембедед и автоматом гененрит swc, но можно обойтись и без него.

Добавлено через 2 минуты
Цитата:
Сообщение от Psycho Tiger Посмотреть сообщение
Можно загружать Loader`ами. В чем причина отказа от Flash IDE?
Просто часто есть ситуации, когда флэшка должна включать всё и не разрешается подгрузка ресурсов - например: игры для некоторых порталов..
__________________
Отряд Котовскага


Последний раз редактировалось Котяра; 03.06.2010 в 00:54.
Старый 03.06.2010, 00:46
Wolsh вне форума Посмотреть профиль Отправить личное сообщение для Wolsh Найти все сообщения от Wolsh
  № 8  
Ответить с цитированием
Wolsh
Нуб нубам
 
Аватар для Wolsh

модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
Кстати да, если собрать фотошопом в одну картинку, то с ембедом мороки вообще никакой)) А скрипт чтобы бегать по ней, показывая нужный Rectangle, я думаю ты без труда напишешь. Можно это переделать (240 для ленты слишком много)
http://flasher.ru/forum/showpost.php...83&postcount=8
__________________
Reality.getBounds(this);

Старый 03.06.2010, 00:56
orcpochta вне форума Посмотреть профиль Отправить личное сообщение для orcpochta Найти все сообщения от orcpochta
  № 9  
Ответить с цитированием
orcpochta

Регистрация: Feb 2008
Сообщений: 890
Котяра, Wolsh, адский отжиг со склейкой))))) Мне нравится))))))
__________________
скриптограф

Старый 03.06.2010, 01:02
Котяра вне форума Посмотреть профиль Отправить личное сообщение для Котяра Посетить домашнюю страницу Котяра Найти все сообщения от Котяра
  № 10  
Ответить с цитированием
Котяра
буду краток
 
Аватар для Котяра

модератор форума
Регистрация: Sep 2003
Адрес: Ближайшее Замкадье
Сообщений: 3,110
Записей в блоге: 28
Отправить сообщение для Котяра с помощью ICQ Отправить сообщение для Котяра с помощью Skype™
вот мой пример.
Код AS3:
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();			
		}
	}
}
тут у меня, правда, битмапдата может меняться на ходу, а ссылка на отрисованную битмапу уходит в материалы для 3д движка (дракон снижается по колёсику)..
__________________
Отряд Котовскага


Последний раз редактировалось Котяра; 03.06.2010 в 01:19.
Создать новую тему Ответ Часовой пояс GMT +4, время: 18:03.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 18:03.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.