Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.display.Sprite;
- import flash.events.Event;
- public class Main extends Sprite
- { [Embed(source = "../lib/Doctor.svg")]
- private var Doctor:Class;
- private var container:Sprite = new Sprite();
- public function Main():void
- {
- container = new Sprite();
- for (var i:int = 0; i < 10; i++) {
- for (var j:int = 0; j < 10; j++) {
- var s:Sprite = new Doctor();
- s.x = i * 20;
- container.addChild(s);
- }
- }
- this.addChild(container);
- this.parent.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel);
- this.parent.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
- this.addChild(new Stats());
- }
- private function onKey(event:KeyboardEvent):void
- {
- container.x += 0.25;
- }
- private function onMouseWheel(event:MouseEvent):void
- {
- if (event.delta > 0) {
- container.scaleX += 0.1;
- container.scaleY += 0.1;
- }else {
- container.scaleX -= 0.1;
- container.scaleY -= 0.1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement