Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualDeft

Posted 29 August 2012 - 04:15 PM

Any other way to do this?

Yeap, you can do this by implementing your own class for inventory item.
You need to extend your item from internal ActionScript Sprite class (that classes has event listeners by default). By extending it you gain opportunity to draw an object and use it events. And moreover you can implement your own data and methods for storing data about inventory item.
For example:
[source lang="delphi"]class InventoryItem extends Sprite{ private: var _itemId: int; InventoryItem(itemId: int) { _itemId = itemId; addEventListener(MouseEvent.CLICK, onItemClick); } function onItemClick(...) { // Your own code }}[/source]

Just like this Posted Image

#1Deft

Posted 29 August 2012 - 04:14 PM

Any other way to do this?

Yeap, you can do this by implementing your own class for inventory item.
You need to extend your item from internal ActionScript Sprite class (that classes has event listeners by default). By extending it you gain opportunity to draw an object and use it events. And moreover you can implement your own data and methods for storing data about inventory item.
For example:
[source lang="java"]class InventoryItem extends Sprite{ private: var _itemId: int; InventoryItem(itemId: int) { _itemId = itemId; addEventListener(MouseEvent.CLICK, onItemClick); } function onItemClick(...) { // Your own code }}[/source]

Just like this :)

PARTNERS