jinx-events

1.0.0 • Public • Published

Imgur

Jinx module for chaining prototype events

Example

 
var myMc = new foo();
 
myMc.x = 250;
myMc.y = 100;
addChild(myMc);
 
myMc.$bind('enterFrame',function(){
    this.rotation+=0.5; // it will spin
}).$bind('click',function(){
    this.y+=5; // it will go down a when clicked
}).$hover(function(){
    this.alpha=0.5; // it will be 50% alpha when mouse hover
},function(){
    this.alpha=1; // it will be 0% alpha when mouse out
})
 

Events suported.

  • enterFrame
  • removed
  • load
  • mouseMove
  • mouseUp
  • mouseDown
  • mouseOver
  • mouseOut
  • releaseOutside
  • click
  • mouseWhell
  • rollOut
  • rollOver
  • rightClick

Alias

  • $click = $bind('click');
  • $hover([function mouseOver],[function mouseOut]) = $bind('mouseOver')
  • $mouseOver([function mouseOver],[function mouseOut]) = $bind('mouseOver')
  • $mouseMove = $bind('mouseMove');
  • $mouseOut = $bind('mouseOut');
  • $mouseUp = $bind('mouseUp');
  • $enterFrame = $bind('enterFrame');
  • $mouseDown([function mouseDown],[function release || releaseOutside]) = $bind('mouseDown')

The MIT License

Package Sidebar

Install

npm i jinx-events

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • webcaetano