not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
896 B

  1. // Entry component with image and sound
  2. enyo.kind({
  3. name: "TamTam.Item",
  4. kind: enyo.Control,
  5. published: { name: "" },
  6. classes: "item",
  7. components: [
  8. { name: "itemImage", classes: "itemImage", kind: "Image", ontap: "play" }
  9. ],
  10. // Constructor
  11. create: function() {
  12. this.inherited(arguments);
  13. this.nameChanged();
  14. this.sound = null;
  15. },
  16. // Item setup
  17. nameChanged: function() {
  18. this.$.itemImage.setAttribute("src", "images/database/"+this.name+".png");
  19. },
  20. // Play sound using the media
  21. play: function() {
  22. this.$.itemImage.setAttribute("src", "images/database/"+this.name+"sel.png");
  23. if (this.name != null) {
  24. this.sound = "audio/database/"+this.name;
  25. sound.play(this);
  26. }
  27. },
  28. endofsound: function() {
  29. if (this.$.itemImage)
  30. this.$.itemImage.setAttribute("src", "images/database/"+this.name+".png");
  31. },
  32. abort: function() {
  33. this.endofsound();
  34. }
  35. });