如何为图像添加多点触控缩放功能?
我的应用代码:
<s:Scroller left="0" right="0" top="0" bottom="0">
<s:Group>
<s:Image left="0" right="0" top="0" bottom="-11"
source="@Embed(source='plans/rera.jpg')"/>
</s:Group>
</s:Scroller>
答案 0 :(得分:0)
为您的图片添加ID(在本例中为“img”)并添加以下ActionScript代码
<s:Image id="img"
left="0"
right="0"
top="0"
bottom="-11"
source="@Embed(source='plans/rera.jpg')" />
private function addEventListenerImage() : void
{
// call this function e.g. onCreationComplete Event
img.addEventListener(TransformGestureEvent.GESTURE_ZOOM, onZoomImg);
}
private function onZoomImg($event : TransformGestureEvent) : void
{
img.scaleX = $event.scaleX;
img.scaleY = $event.scaleY;
}