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.
 
 
 
 
 

40 lines
896 B

// Entry component with image and sound
enyo.kind({
name: "TamTam.Item",
kind: enyo.Control,
published: { name: "" },
classes: "item",
components: [
{ name: "itemImage", classes: "itemImage", kind: "Image", ontap: "play" }
],
// Constructor
create: function() {
this.inherited(arguments);
this.nameChanged();
this.sound = null;
},
// Item setup
nameChanged: function() {
this.$.itemImage.setAttribute("src", "images/database/"+this.name+".png");
},
// Play sound using the media
play: function() {
this.$.itemImage.setAttribute("src", "images/database/"+this.name+"sel.png");
if (this.name != null) {
this.sound = "audio/database/"+this.name;
sound.play(this);
}
},
endofsound: function() {
if (this.$.itemImage)
this.$.itemImage.setAttribute("src", "images/database/"+this.name+".png");
},
abort: function() {
this.endofsound();
}
});