Jump to content
Search Community

Image Gallery Flicker via ThrowProps (SOURCE included)

needlemouse test
Moderator Tag

Recommended Posts

Hello Guys,

 

I just recently downloaded the new plugin by master jack called ThrowProps.

 

I hope I'm not asking too much, but im really weak when it comes to mathematical computations. Just wanna ask if there someone who can point me to the right direction :)

 

I basically want to create an image gallery (horizontal) and i want to browse through it like on iOS. Flick once, then it will show the next image, and so on...

 

Master Jack, if youre reading this, can you assist if you have the time :D

 

Thank You Sooo Much!!!

Link to comment
Share on other sites

Actually, the way that type of thing (flicking to the next/previous panel) works on the iOS is much simpler than you might think. As far as I can tell, the logic is as simple as:

 

- Sense the direction of the flick movement (right or left)

- If the velocity is more than a particular (relatively low) threshold, do a simple easeOut tween to the next (or previous) panel. Maybe 0.5 seconds or so.

- If the velocity is below that threshold, just do an easeOut tween to the current panel (to snap it back into position)

 

That's it.

 

Make sense?

 

ThrowPropsPlugin is great for larger areas of content that get smoothly tweened, not so much for panel flicking. It actually could be great for an effect like zooming to further panels based on the flick velocity which might look visually cool but functionally speaking it's not ideal because users get frustrated if they see the panel they wanted fly past! Typically users would rather just always advance one panel at a time.

Link to comment
Share on other sites

Thanks for the super quick reply Master Jack :D

 

I don't want to ask again without doing something first because I have an experience where some people gets easilly pissed off if you ask too much without doing anything first :P

 

So yeah, basically, I assembled a working sample of the Image Flicker and its basically usable (so people out there who likes to use this source, please go ahead :)) You just click and drag and it will basically go to the next image.

 

The only thing I can't make to work is the threshold you mentioned on your previous post.

 

The images will only scroll IF, the X coordinate of the currently active image is greater than the stage / 2. I want it to scroll like the one you mentioned before, using an specific threshold. So if you flick it a bit faster, it will scroll, but if you flick it slow, it will just tween on its original position.

 

The files attached are the FLASH CS4 fla, the images (which are basically my artworks dedicated for Japan earthquake :)), and the XML where the data of the images are stored.

 

And yeah, this source file is usable, I just want to improve it and work similar to the behaviour on iOS :D

 

PS: Im using full greensock library for animation and loading :D it rocks man!

Link to comment
Share on other sites

Hello Master Jack!

 

So I've studied the code and I pretty much understand some of it. The only thing that is a bit new to me is this basic method call of startDrag().

 

_container.startDrag(false, new Rectangle(_panelBounds.x - 9999, _panelBounds.y, 99999, 0));

 

Specifically the 9999 values. What does it mean?

Link to comment
Share on other sites

The 9999 was just a big number that allows the object to slide really far to the right or left. I didn't want to cap it right at the edges because I wanted the user to be able to drag things beyond the edge just like on the iPhone/iPad. Make sense?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...