Reputation: 23
I want to make an image clickable/tap , so when the user clicks/taps it a sound can be played.
I,m working on flex SDK version 12 and using s:BitmapImage for images.
Upvotes: 0
Views: 182
Reputation: 23018
BitmapImage does not support touch events, but you can put it into a Group:
<s:Group click="zoomAvatar(event)">
<s:BitmapImage id="_avatar"
width="{AVATAR_WIDTH}"
height="{AVATAR_HEIGHT}"
scaleMode="letterbox"
source="{male_happy}"
contentLoader="{AVATAR_CACHE}" />
</s:Group>
Upvotes: 1
Reputation: 3200
s:BitmapImage is a primitive component that doesn't support interactivity. If you want interactivity, you need to use a component that extends InteractiveObject. Use s:Image instead.
s:Image is also skinnable, giving you a lot more flexibility. Of course the footprint will be heavier than that of s:BitmapImage, so I would recommend still using s:BitmapImage when you don't require the extra functionalty.
Upvotes: 1