I've got xml thumbnail grid, i creaded mask for it and now i want to scroll the grid but don't have idea how.
I wan't to have two arrows previous and next to scroll my thumbnail grid to next column.
here is my code :
var maskHeight:int = (my_thumb_height+10)*y_counter;
var maskWidth:int = (my_thumb_width+10) *3 ;
var x_counter:Number = 0;
var y_counter:Number = 0;
var myXMLLoader:URLLoader = new URLLoader();
var myXML:XML = new XML(e.target.data);
columns = myXML. @ COLUMNS;
rows = myXML. @ ROWS;
my_x = 20;
my_y = 20;
my_thumb_width = myXML. @ WIDTH;
my_thumb_height = myXML. @ HEIGHT;
my_images = myXML.IMAGE;
my_total = my_images.length();
container_mc = new MovieClip();
container_mc.x = my_x;
container_mc.y = my_y;
container_mc.buttonMode = true;
mask_mc = new Sprite();
mask_mc.x = my_x;
mask_mc.y = my_y;
container_mc.mask = mask_mc;
mask_mc.cacheAsBitmap = true;
container_mc.cacheAsBitmap = true;
for (var i:Number = 0; i < my_total; i++)
var thumb_url = my_images[i]. @ image;
var thumb_loader = new Loader();
thumb_loader.x = (my_thumb_width+10)*x_counter;
thumb_loader.y = (my_thumb_height+10)*y_counter;
if (y_counter + 1 < rows)
y_counter = 0;
var my_thumb:Loader = Loader(e.target.loader);
And now i don't have an idea how to move my thumbnail grid after click to arrow to next column or previous column.
I need to add something here but i don't know what:
Please help !!!
What you do with those functions depends on how you want things to scroll. For starters you can just try using something like the following, and after you see what it does then you might be able to think about what you really want it to do.
container_mc.x += 100; // arbitrarily chose 100 pixels
container_mc.x -= 100;
Yes i alredy make something like this:) and it work i want have effect like this but i wan't to use tween lite for scroll.
But with this script is a problem when you click two or three times to arrow it will scroll the grid by about 230 pixels. I want to always scroll grid one column next and previous and when i want to click three times fast i want to scroll three columns.
I know that have to add var index for column and then scroll grid for that index but i don't know how to start do it.
And i also want to have limit of scroll to not have a free spaces. Like when my grid is on x=0 previous button musst be disable and also when i scroll it to max next button have to be disable.
Any Idea how to do it ??
Your first posting should have offered the detail your second posting does... that is why my response offered only a basic solution.
If you images are all different widths, because of your desire to base the amount of scrolling on how many times you click, it will be necessary to store the location of each image in an array and use a counter to keep track of the clicks. That counter will coincide with the index of the array. So if you start at 0 clicks, when you have clicked three times you will go to the location designated by the x value defined in the array at index 3.