Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pages that swing

Status
Not open for further replies.

ola123

Technical User
Sep 16, 2005
52
0
0
JM
Good Day!!!

How can i achieve creating pages where u click on the a button the pages slide across.

like for example this site the buttons are at the bottom left corner

hope is something easy. but if not i would love a tutorial
Thanks very much
 
UNTESTED

create a movieclip with all your pages in side by side.

make a mask that show on page where you want to see it.

to make it work ou will need to move you rpages movieclip left and right appropriately. you can do this by always moving the _x attribute of this clip to a certain point.

create a movieclip of the side of the stage (so you can see it in flash, but not in the published swf), this is a good place to put code that needs to run on every frame - which might go something like:

onClipEvent(enterFrame)
{
var d:Number = _root.targetX - pages_mc._x
_root.pages_mc._x += d/3;//the large this number the slower/smoother the movement
}//pages_mc is the mc with your pages in

these code in the buttons which change the page will look something like

on(press)
{
_root.targetX = 56;//or whatever number moves pages_mc to the correct place for this button


in this example, your pages move a third of the was from where they are to where they should be on each frame.
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top