2011 07-hiyoko
Upcoming SlideShare
Loading in...5
×
 

2011 07-hiyoko

on

  • 723 views

 

Statistics

Views

Total Views
723
Views on SlideShare
723
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

2011 07-hiyoko 2011 07-hiyoko Presentation Transcript

  • www.inazumatv.com/contents/ me.beginsprite.com2011 7 2
  • www.sidevision.co.jp2011 7 2
  • Signals Event2011 7 2 View slide
  • Flash Event Events2011 7 2 View slide
  • Event Event Event2011 7 2
  • 01 Sample start_btn.addEventListener(MouseEvent.CLICK, onStartClicked); stop_btn.addEventListener(MouseEvent.CLICK, onStopClicked); function onStartClicked (e:MouseEvent):void { addEventListener(Event.EXIT_FRAME, onLoop); } function onStopClicked (e:MouseEvent):void { removeEventListener(Event.EXIT_FRAME, onLoop); } function onLoop (e:Event):void { fan_mc.rotation += 5; }2011 7 2
  • 01 Sample addEventListener(Event.EXIT_FRAME, onLoop); removeEventListener(Event.EXIT_FRAME, onLoop);2011 7 2
  • 02 Sample package com.inazumatv.events { import flash.events.Event; public class FanEvent extends Event { public static const FAN_START:String = "fanStart"; public static const FAN_STOP:String = "fanStop"; public function FanEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) { super(type, bubbles, cancelable); } override public function clone():Event { return new FanEvent(type, bubbles, cancelable); } } }2011 7 2
  • 02 Sample package com.inazumatv.events { import flash.events.Event; public class FanEvent extends Event { public static const FAN_START:String = "fanStart"; public static const FAN_STOP:String = "fanStop"; public function FanEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false) { super(type, bubbles, cancelable); } override public function clone():Event { return new FanEvent(type, bubbles, cancelable); } } }2011 7 2
  • 03 Sample package com.inazumatv.events { import flash.events.Event; public class FanSpeedEvent extends Event { public static const CHANGE_SPEED:String = "changeSpeed"; private var _speed:Number; public function FanSpeedEvent(speed:Number, type:String, bubbles:Boolean=true, cancelable:Boolean=false) { _speed = speed; super(type, bubbles, cancelable); } override public function clone():Event { return new FanSpeedEvent(speed, type, bubbles, cancelable); } override public function toString():String { return formatToString("FanSpeedEvent", "speed", "type", "bubbles", "cancelable", "eventPhase") } public function get speed():Number { return _speed; } } }2011 7 2
  • 03 Sample package com.inazumatv.events { import flash.events.Event; public class FanSpeedEvent extends Event { public static const CHANGE_SPEED:String = "changeSpeed"; private var _speed:Number; public function FanSpeedEvent(speed:Number, type:String, bubbles:Boolean=true, cancelable:Boolean=false) { _speed = speed; super(type, bubbles, cancelable); } override public function clone():Event { return new FanSpeedEvent(speed, type, bubbles, cancelable); } override public function toString():String { return formatToString("FanSpeedEvent", "speed", "type", "bubbles", "cancelable", "eventPhase") } public function get speed():Number { return _speed; } } }2011 7 2
  • Signals Event2011 7 2
  • Signals addEventListener(listener:Function) removeEventListener(listener:Function) dispatchEvent(new ExampleEvent(ExampleEvent.EVENT_TYPE)) add(listener:Function) addOnce(listener:Function) remove(listener:Function) removeAll() dispatch(... valueObjects)2011 7 2
  • Signals add(listener:Function) addOnce(listener:Function) remove(listener:Function) removeAll() dispatch(... valueObjects) addWithPriority(listener:Function, priority:int=0) addOnceWithPriority(listener:Function, priority:int=0)2011 7 2
  • Signals if (stage) init(); else new NativeSignal(this, Event.ADDED_TO_STAGE, Event ).addOnce(init); init2011 7 2
  • Signals var accelerate:Signal = new Signal(Number); accelerate.dispatch(speed); function onAccelerate(speed:Number) { } accelerate.add(onAccelerate);2011 7 2
  • Signals NativeSignal Signal DeluxeSignal Class2011 7 2
  • Signals github : as3-signals https://github.com/robertpenner/as3-signals Robert Penner Programming Macromedia Flash MX mx.motion.easing.* fl.motion.easing.*2011 7 2
  • Signals github : as3-signals https://github.com/robertpenner/as3-signals/wiki https://github.com/robertpenner/as3-signals/wiki/_pages http://www.himco.jp/articles.php inzumatv.com http://www.inazumatv.com/contents/archives/tag/signals2011 7 2
  • www.inazumatv.com/contents/ me.beginsprite.com www.sidevision.co.jp @taikiken2011 7 2