FORUMS: list search recent posts

Flash "Click and Toss" wheel

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Cassie Brooke
Flash "Click and Toss" wheel
on Dec 10, 2009 at 4:24:34 pm

I'm looking for an example of a "Price is right" style wheel that the user can click, drag and toss; the wheel spins at a different velocity depending on how fast the user tossed it. Any ideas where I can find an example of this kind of interaction? Thanks.


Return to posts index

Marcus Geduld
Re: Flash "Click and Toss" wheel
on Dec 10, 2009 at 5:04:32 pm

Does it have to be 3D? Or can it be as if you're looking at the wheel from the side? (Or from above, like on "Wheel of Fortune"?)

Author "After Effects Expressions"
Co-author "After Effects For Flash, Flash For After Effects"
Artistic Director, Folding Chair Classical Theatre, Inc
Senior Flash Developer, Zeitbyte.com


Return to posts index

Cassie Brooke
Re: Flash "Click and Toss" wheel
on Dec 10, 2009 at 6:14:48 pm

It doesn't need to be 3D. In fact it doesn't even need to look like a wheel. I'm mainly interested in finding an infinitly scrollable image loop where click and drag is the interaction method to scroll through the list rather than mouse position.

I've found a lot of examples that scroll an image loop via mouse position, (ex: http://www.kirupa.com/developer/mx/infinite.htm) but none that do so with click and drag. Any ideas? Thanks!


Return to posts index


Marcus Geduld
Re: Flash "Click and Toss" wheel
on Dec 11, 2009 at 2:35:41 pm

I am looking for a solution. I'll post here when I have one.

Author "After Effects Expressions"
Co-author "After Effects For Flash, Flash For After Effects"
Artistic Director, Folding Chair Classical Theatre, Inc
Senior Flash Developer, Zeitbyte.com


Return to posts index

Adam Ashby
Re: Flash "Click and Toss" wheel
on Dec 14, 2009 at 5:53:56 am





I've been messing around making something similar to what you're talking about, making a shuttle/jog wheel (Example above). This is in 3D. Though, I use a MovieClip/Class export called Side in a for loop to create the wheel, you could easily put you images in an XML and use a similar for loop to create it. I based it off of these two tutorials by Lee Brimelow:

The Throw Slider

Click and Zoom 3D Carousel

and used this SimpleZSorter class from theflashblog.com

I'll add my code below for reference. I hope it helps.

import com.theflashblog.fp10.SimpleZSorter;

var container:Sprite;
var anglePer:Number;
var numSides:int=52;
var isDragging:Boolean = false;
var vr:Number = 0;
var currentR:Number = (mouseX * -1) / 10;
var lastR:Number = (mouseX * -1) / 10;

init();
this.addEventListener(Event.ENTER_FRAME, loop);

function init():void
{
container = new Sprite();
container.x = 300;
container.y = 55;
container.z = 300;
shuttle.addChild(container);//shuttle is a MC I have on stage.
anglePer = (Math.PI*2) / numSides;

for(var i:int=0; i<numSides; i++)
{
var side:Side = new Side();
side.angle = (i*anglePer) - Math.PI/2;
side.rotationY = (360/numSides) * -i;
side.x = Math.cos(side.angle) * 374; //these two lines define size/depth of the wheel
side.z = Math.sin(side.angle) * 374;
container.addChild(side);
SimpleZSorter.sortClips(container);
}

shuttle.addEventListener(MouseEvent.MOUSE_DOWN, onOver);
shuttle.addEventListener(MouseEvent.MOUSE_OUT, onOut);
shuttle.addEventListener(MouseEvent.MOUSE_UP, onOut);
shuttle.buttonMode=true;
}

function onOver(e:MouseEvent):void
{
isDragging = true;
this.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
}

function onOut(e:MouseEvent):void
{
isDragging = false;
this.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
}

function onMove(e:MouseEvent):void
{
container.rotationY = (mouseX * -1) / 10;
SimpleZSorter.sortClips(container);
}

function loop(e:Event):void
{
//gets last and current mouseX locations to define the velocity
if(isDragging)
{
lastR = currentR;
currentR = (mouseX * -1) / 10;
vr = currentR - lastR;
}
else
{
//adds velocity to rotation
container.rotationY += vr;
}
//slows down rotation until velocity is 0
vr *= 0.85;
if(Math.abs(vr) < 0.5) vr = 0;
SimpleZSorter.sortClips(container);
}



Adam Ashby
mutli-media artist
http://www.adamashby.com


Return to posts index

Marcus Geduld
Re: Flash "Click and Toss" wheel
on Dec 14, 2009 at 3:14:59 pm

I took a stab at it, too. You can check out my files here: http://www.grumblebee.com/stuff/cow/throwNav.zip

Author "After Effects Expressions"
Co-author "After Effects For Flash, Flash For After Effects"
Artistic Director, Folding Chair Classical Theatre, Inc
Senior Flash Developer, Zeitbyte.com


Return to posts index


Cassie Brooke
Re: Flash "Click and Toss" wheel
on Dec 17, 2009 at 10:47:33 pm

Thanks so much for the responses, these are incredibly helpful!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]