Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Tap Listeners Programmatically #7

Open
brycebigger opened this issue Oct 24, 2013 · 0 comments
Open

Multiple Tap Listeners Programmatically #7

brycebigger opened this issue Oct 24, 2013 · 0 comments

Comments

@brycebigger
Copy link

First off, let me say that Gestouch is amazing, works well in Flash, but even better, works well with Scaleform! In doing some FUI interfaces, it has been so easy to test and iterate. It's tough to do quick testing on iOS no matter what- the build/deploy process takes about a minute every time, so that adds up. Testing touch interfaces immediately with a touch monitor is super quick, but typically the cheap ones on have two simultaneous touch points, but I digress.

Here's my issue: I'm building a horizontal, scrolling menu that's populated with the same MovieClip, about 20 of them, so the movieclip container ends up being about 3000px wide. Enter a swipe gesture to make them go back and forth. Done. Now, to select an individual movieclip and get it's id, name, etc. is where I'm slipping up.

Here's my code:

for (var i:int = 0; i < numberOfNodesToAdd; i++) {
var menuItem:MenuItem = new MenuItem();
/* skipping a bunch of formatting stuff */
var singleTap:TapGesture = new TapGesture(menuItem);
singleTap.numTapsRequired = 1;
singleTap.addEventListener(TapGestureEvent.GESTURE_TAP, menuItemTap);

//more code and then finally, container.addChild(menuItem);
}

private function menuItemTap(e:TapGestureEvent):void
{
//The line below doesn't work, but I'm not sure how to target it exactly...
//TweenMax.to(e.currentTarget.bg, 1, {tint:0xff0000});

trace(e.currentTarget);  //returns object

}

This is a project I'm using the Flash IDE (CS6 and CC). Any thoughts/insight on how to figure out what I pressed? I'm sure I'm missing something simple...

Thanks!
Bryce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant