Показать сообщение отдельно
Старый 26.07.2011, 17:41
tsarapkabel вне форума Посмотреть профиль Отправить личное сообщение для tsarapkabel Найти все сообщения от tsarapkabel
  № 3  
Ответить с цитированием
tsarapkabel
 
Аватар для tsarapkabel

Регистрация: Nov 2009
Адрес: в златоглавой
Сообщений: 745
Код AS3:
package {
 
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
 
	public class DeltaRotation extends Sprite {
 
		private var rotatingSprite:Sprite;
 
		public function DeltaRotation() {
			addEventListener(Event.ADDED_TO_STAGE, init);
		}
 
		private function init(event:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, init);
 
			rotatingSprite = new Sprite();
			rotatingSprite.graphics.lineStyle(1, 0x0000FF, 1, true);
			rotatingSprite.graphics.beginFill(0x889988);
			rotatingSprite.graphics.drawRoundRect(0, 0, 200, 45, 10, 10);
			rotatingSprite.graphics.endFill();
			stage.addChild(rotatingSprite);
			rotatingSprite.x = rotatingSprite.y = 250;
 
			stage.addEventListener(MouseEvent.MOUSE_WHEEL, rotateOnWheel);
		}
 
		private function rotateOnWheel(event:MouseEvent):void {
			rotatingSprite.rotation += event.delta; //вращение скролом тут
		}	
	}
}
__________________
Нормально делай — нормально будет!