Skip to main content
Participant
May 25, 2009
Question

Sliding menu in Fluid layout

  • May 25, 2009
  • 1 reply
  • 573 views

Hi, Ive made a fluid layout
using this tutorial http://www.tutorio.com/tutorial/liquid-flash-layout

I have now recently put a section into it where there are 5 images that slide horizontally when u click on their thumbnails.
Using this tutorial  http://www.kirupa.com/developer/flash5/slidingmenu.htm


I have managed to get everything fluid except for the amount the sliding images move horizontally. The original actionscript for each individual thumbnail is like this:

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


That will work fine for a normal layout, but because mine is a fluid layout it, it wont work properly on different screen resolutions. I was trying to replace the 100 value into the overall width of all of the sliding images divided by 5 but couldnt get it to work.

Any help would be appreciated,

Thanks

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 25, 2009

you'll need to use a variables (whose value will change depending on the stage size).  but those variables values are not determinable with the info you supplied.

flash1980Author
Participant
May 25, 2009

thanks for the answer

The bit ive been struggling with, is finding the right actionscript that lets me use the width of an existing image to adjust the amount the slider moves. I can do it with the stage by using the "Stage.width" code, but it doesnt work if I try "imagename.width"

Whats the equivelant for that code?

kglad
Community Expert
Community Expert
May 25, 2009

all displayobjects have a width property including imagename (if that's a pointer to the display object and not a name string).