title: how to send message to actor akka
body: <p>I'm beginner in Scala and akka, and I want to send message to MessageSender actor if the keybutton was pressed, I draw a field and 2 objects, but when I run a program and then press up arrow, message in actor is not printing </p>
  
  <pre><code>//Boot
  import akka.actor.{ActorSystem, Props}
  import scalafx.Includes._
  import scalafx.application
  import scalafx.application.JFXApp
  import scalafx.scene.Scene
  import scalafx.scene.canvas.{Canvas, GraphicsContext}
  import scalafx.scene.input.{KeyCode, KeyEvent}
  
  object Boot extends JFXApp {
  
  
  
    val system = ActorSystem("MYsystem")
    val messageSender = system.actorOf(Props[MessageSender],"MessageSender")
    val wiDth = 500
    val heiDth = 500
    stage = new application.JFXApp.PrimaryStage {
      title = "Tanks"
      scene = new Scene(wiDth,heiDth) {
          val canvas = new Canvas(wiDth,heiDth)
          var g = canvas.graphicsContext2D
          val tank = new Objects(g)
          val thisTank = tank.drawTank(0,0)
          val thisBullet = tank.drawBullet(60,20)
          canvas.onKeyPressed = (e: KeyEvent) =&gt; {
              e.code match {
                case KeyCode.Up =&gt; messageSender ! MessageSender.Up
  
              }}
       content=canvas
  
      }
      }
    }
  </code></pre>
  
  <p>Message sender</p>
  
  <pre><code>object MessageSender {
  
    case object Left
    case object Right
    case object Up
    case object Down
    case object StartGame
    case object MakeShoot
  
  }
  
  class MessageSender extends Actor with ActorLogging{
  import  MessageSender._
    override def receive: Receive = {
      case Up =&gt; println("sent up")
  
  
  
    }
  
  }
  </code></pre>