Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DARKiLLUSiON

macrumors 6502
Original poster
Sep 21, 2007
327
25
Toronto, Canada
Hey guys
I need any help I could get anyway
I've been googling this for a awhile and still can't find anything relate to it
or I'm just not searching for the right terms...

http://osaka.cool.ne.jp/iluvayu22/chin3.swf

what's the action script that the person use in order to make the image
scrolls left/right by just clicking on the black icons on the left
is sorta like a carousel but is not looping or anything and it does stop in the center of the image...
 

snickelfritz

macrumors 65816
Oct 24, 2003
1,109
0
Tucson AZ
It's very common for Flash developers to use custom tweening classes for simple animations like this.
I recommend that you download and learn to use TweenMax or TweenLite.
It's very simple to use, once you understand the basics.

Here's the basic timeline code (AS3) for something like this:
PHP:
import gs.TweenLite;

btnGroup.addEventListener(MouseEvent.MOUSE_OVER, btnOver, false, 0, true);
btnGroup.addEventListener(MouseEvent.MOUSE_OUT, btnOut, false, 0, true);
btnGroup.addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
btnGroup.mouseEnabled = false;

var btnName:String = "";
var xVal:Number;

function btnOver(event:MouseEvent):void
{
	TweenLite.to(event.target.btnBase, .5, {tint:0x006699});
}

function btnOut(event:MouseEvent):void
{
	TweenLite.to(event.target.btnBase, .5, {tint:null});
}

function btnClick(event:MouseEvent):void
{
	btnName = event.target.name;
	switch (btnName)
	{
		case "btn1" :
			xVal = 200;
			break;
		case "btn2" :
			xVal = -300;
			break;
		case "btn3" :
			xVal = -800;
			break;
		case "btn4" :
			xVal = -1300;
			break;
	}
	TweenLite.to(pageGroup, 1, {x:xVal});
}

FLA is attached.
GL
 

Attachments

  • as3Slider.fla.zip
    8.7 KB · Views: 229

DARKiLLUSiON

macrumors 6502
Original poster
Sep 21, 2007
327
25
Toronto, Canada
It's very common for Flash developers to use custom tweening classes for simple animations like this.
I recommend that you download and learn to use TweenMax or TweenLite.
It's very simple to use, once you understand the basics.

Here's the basic timeline code (AS3) for something like this:
PHP:
import gs.TweenLite;

btnGroup.addEventListener(MouseEvent.MOUSE_OVER, btnOver, false, 0, true);
btnGroup.addEventListener(MouseEvent.MOUSE_OUT, btnOut, false, 0, true);
btnGroup.addEventListener(MouseEvent.CLICK, btnClick, false, 0, true);
btnGroup.mouseEnabled = false;

var btnName:String = "";
var xVal:Number;

function btnOver(event:MouseEvent):void
{
	TweenLite.to(event.target.btnBase, .5, {tint:0x006699});
}

function btnOut(event:MouseEvent):void
{
	TweenLite.to(event.target.btnBase, .5, {tint:null});
}

function btnClick(event:MouseEvent):void
{
	btnName = event.target.name;
	switch (btnName)
	{
		case "btn1" :
			xVal = 200;
			break;
		case "btn2" :
			xVal = -300;
			break;
		case "btn3" :
			xVal = -800;
			break;
		case "btn4" :
			xVal = -1300;
			break;
	}
	TweenLite.to(pageGroup, 1, {x:xVal});
}

FLA is attached.
GL


thank you so much :D
I'll try that
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.