I am stuck in a problem with Adobe Flex 4 and ActionScript 3.
I have a TileList in Flex 4, for example:
<mx:TileList id="myList" change="test(event)" paddingLeft="28" width="1080" wordWrap="true" height="1420" rowHeight="475" columnWidth="350" dataProvider="{floorPlans}" itemRenderer="FloorplanItems" selectionColor="#ffffff" rollOverColor="#ffffff">
</mx:TileList>
And I'm trying to make it scrollable with a touch, as it happens on the touch screen. I tried two different ways to make it scrollable with a touch, wrapping it in a spark. Scrolling like this:
<s:Scroller>
<s:Group>
<mx:TileList id="myList" change="test(event)" paddingLeft="28" width="1080" wordWrap="true" height="1420" rowHeight="475" columnWidth="350" dataProvider="{floorPlans}" itemRenderer="FloorplanItems" selectionColor="#ffffff" rollOverColor="#ffffff">
</mx:TileList>
</s:Group>
</s:Scroller>
But when I test my touch screen, nothing happens.
Another approach was to add a TransformGestureEvent.GESTURE_SWIPE event listener as follows:
<mx:Script>
<![CDATA[
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
Multitouch.inputMode = MultitouchInputMode.GESTURE;
import flash.events.Event;
public function init(): void
{
trace("here");
myList.addEventListener(TransformGestureEvent.GESTURE_SWIPE, onSwipe);
}
public function onSwipe (e:TransformGestureEvent):void{
if (e.offsetY == 1) {
myList.y += 100;
}
if (e.offsetY == -1) {
myList.y -= 100;
}
}
]]>
</mx:Script>
But then again, it does nothing .... I'm running out of ideas ... how can I make my TileList scrollable with a touch?
source
share