Sliding Menu actionscript

Folks,

I was lucky to find Kirupa’s site recently, and the tutorials are excellent. I tried the Flash 5 sliding menu tutorial and am wondering about the code as my first try worked out right, while the second, which was a larger size, did not work out right. While the first try worked perfectly, the sections do not slide the way the are supposed to in the second one.

I don’t understand what part of the code I would adjust to make it work, mainly because the explanations in the tutorial (in the Sliding Menu as well as both Draggable Menu tutorials) were not very clear. Would someone mind explaining to me what I need to do to fix the problem? I’ve attached the file that doesn’t work - the code is identical to the one that does, except rather than being a 100x120 document, this one is 200x240.

peace,

Arp

You can refer to this thread, hopefully it will shed some light. =)

http://www.kirupaforum.com/showthread.php?s=&threadid=11829

Thanks - I am checking it out.

Is there any formula to adjusting the numbers? I’m doing it by trial and error right now, but am wondering if there is a formula to figure it out.

I am having exactly the same problem with using 700x100 menus and have posted to this effect. The thread that elecGeek mentioned no longer seems to be available. Is there any chance that the code was cracked. I really need to get into Illy’s head on this one.

I messed with it a bit and doubled the size (attatched)
…the clipGeneral slides in proportion to the “mask2”
in the btn’s in “scroller” …here::

on (press) {
_root.xnew = _root.mask2._x+color=red*100/2[/color];
}

taking the “/2” out worked for doubling - w/alittle tweaking of lining things up on stage

So was it trial and error or do you understand the basis of the code. I am still having real trouble. Thanks for the fla. I’ll check it out and post back if that’s OK.

a point to point measurement of
the registration point and starting coordinates of “clipGeneral” (open info panel) in relationship to the same of “mask2”…

…you could basically do the math in that equation and just put in the result as a straight number

where:: color=red*100/2[/color] [color=blue]= -50[/color]
then:: [color=red]_root.mask2._x+ -50;[/color]

ie::300/2=150 , 100/2=50 , -100/2= -50 , -300/2= -150 respectively for each btn on the original
( my [ver3] one I just removed the “/2” from the existing script for the sake of doubling the size of the objects )

ok, that’s my simplified shortcut way of looking at and undoing it… the math in the original is a little more sophisticated than that… but this does work…

thought about it some more and this might make a little more sense … the simple way may not work so well for odd sized bits in a scrolling panel or at least be too awkward to adjust

on (press) {
_root.xnew = _root.mask2._x+(0-1)*100/2;
}

  1. [ _root.xnew= ] begins the statement to give “xnew” a new position
  2. [ _root.mask2.x+ ] means “where-ever mask2 is” plus the following equation…
  3. [ (n-n) ] gives a multiplier based on how many panels to left and right there are and which designates “-” or “+” direction from mask2 (each btn would have a diff # here)
  4. [ *100 ] is multiply by the width of the panels to be scrolled, divided by two

hope that helps… (?)

fixed link:
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=11829

OK, my comprehension on this is gaining pace, more snail like, but hey. Originally when I said I wanted to use 700x100 menus, what I actually meant was I wanted each panel to be 700x100.

I wanted to have 3 panels each of 700x100, therefore the total length would be 2100x100.

With your obvious grasp on the formula, any idea how this would work in the sense of adjusting the formula.

ok…here is a quick’N’dirty stretch job::

cut down to three panels & buttons

[note code difference on each button and on the movieClip “clipGeneral” (in the onLoad) re: starting position]