Gallery

1/remove the line this.enabled = false;
2/I`m pretty sure there are fadein type tutorials on here and it should be fairly easy to combine; at least have a go and see if you run into problems.
3/Not really sure what you mean, if you mean the speed at which they move, just alter the value of myClip.speed = 1+random(20);

stringy,
will the altering value of myClip.speed = 1+random(20); give me the smooth shuffling like in the site eccentris?
I don’t seem to get the magic number.
thank you

sorry hamidb4, eccentris.com is taking too long to load for me to look. The original site you posted are using 2 functions(or at least 1 function used on 2 different arrays), one similar to mine which is the second to be called.You could probably do away with the random speed/random count altogether.
If you changed the code to this, you`ll see something like the first function which they use
function shuffle() {
return Math.round(Math.random());
}
createEmptyMovieClip(“paper”, 1);
createEmptyMovieClip(“paper2”, 2);
myArray.sort(shuffle);
function move() {
paper2.loadMovie(“pic”+this.k+“.jpg”);
this.swapDepths(-200-this.k);
this.gotoAndStop(5);
this.enabled = false;
for (var k = 5; k<15; k++) {
goOn.apply(clipa[k]);
}
}
function goOn() {
this.num = Math.round(Math.random()4)-2;
this.onEnterFrame = function() {
this.counter–;
if (this.counter<=0) {
this.counter = 0;
this._x += ((myArray[this.k+this.num][0])-this._x)/this.speed;
if (Math.abs(myArray[this.k][0]-this._x)<1 && Math.abs(myArray[this.k][1]-this._y)<1) {
this._x = myArray[this.k][0];
this._y = myArray[this.k][1];
delete this.onEnterFrame;
this.counter = random(5);
}
}
};
}
clipa = [];
function init() {
for (var i = 0; i<20; i++) {
myClip = paper.attachMovie(“mc”, “mc”+i, i
2);
myclip.myText.text = i;
myClip.k = i;
myClip._y = myArray[myClip.k][1];
myClip._x = myArray[myClip.k][0];
myClip.speed = 10;
myClip.counter = random(5);
myClip.onPress = move;
clipa.push(myClip);
}
}
init();

at the end of this “goOn” function you would have to call the other function.
I made the original file in just a few mins, it was never ment to be a finished thing; was just to give you an idea of how it was made. If I have time later on in the week i`ll try and replicate the movement.

stringy,
Original post had the same smooth look to it too. It would be great to see your file improved if you have time. Also some comment is helpful even if it is to mention what each section of the code does. A newbie here you know. LOL
Thank you.

tq stringy and scotty ur guy’s are really great help…and nice work too… :thumb:

//edit:

eventhough there is misunderstanding here…actually i just wanna place the button to right side only not to keep moving button everytime i click…because i 'm using 800x600 movie stage…anyway it’s nice work…

pixeldude,
if you replace the first portion of stringy’s code with scotty’s code, all you have to do then is to adjust: var start X=50, and: var start Y=50 to where you wish on the stage.

http://www.gifsrus.com/testfile/gridbuttons2.swf
getting any nearer?

I checked the swf in post#25, and yes it is getting much better.
I know it is just a test but for those who are following this thread as you click on each thumb nail they overlap each other because you start with 20 thumbs. I don’t know what the relationship between the number of thumbs for 5 rows and 4 column would be.

I have commented the code to a point but if there is anything you specifically dont understand just ask. Ive mad a simple masking transition and simple preloader(easy to swap with loading bar/animation etc).
The file i have uploaded will stop working if you try press any buttons above 4 as i have only made swf`s 0 ->4.
http://www.gifsrus.com/testfile/fadeinout/gridbuttons2.swf
in each swf first frame is blank with a stop() action, second frame contains the picture.

tq hamidb4 for the hint but i just got figure out myself…without replacing the code …anyway tq…

edit:// btw…really nice work stringy…

stringy,
any specific reason you used swf’s instead of regular jpg files?
can you use any swf file?
the overlapping issue still exists.
as far as the code, with the changes you have made, i’m too **** confuse now. as soon as i can stop my head from spinning out of control, I’m gonna ask some questions.LOL
Thank you so much for your efforts.

This site reminds me of a site I saw a while ago, http://www.eccentris.com :smiley:

I just thought swf would be more flexible, regular jpg will work too.I think any swf should work( as long as you have not used references to _root etc.)
The best i could offer for the overlapping is just to swapDepths() without drasticly altering the file.

nice work stringy…but i just curious which part in ur code if i wanna add row and column to the button…i try to figure out but it’s seem stuck up…so can u point to me where to put in ur code…

thx…

delete the arraypush() things and the attachmovie code and replace with
myArray = ;
aArray = ;
bArray = ;
for (var y = 0; y<4; y++) {
for (var x = 0; x<6; x++) {
i++;
myclip = attachMovie(“mc”, “mc”+i, i);
myclip._x = 200+x*(myclip._width+10);
myclip._y = 200+y*(myclip._height+10);
myArray.push([myclip._x, myclip._y]);
myclip.ivar = i;
myclip.ivar%2 != 1 ? aArray.push(myclip) : bArray.push(myclip);
myClip.onPress = sideMoveset;
}
}

just change the y<4,x<6 to what you want.
position is determined by the 200s space between by 10s.

tq stringy …nice work…one more question stringy then i will shut my mouth :gm: …if i wanna load pic just replace…
[AS]loadMovie(“movie”+this.ivar+".swf", loader);[/AS]
with this…
[AS]loadMovie(“pic”+this.ivar+".jpg", loader);[/AS]
am i rite …but when i click to load the pic it seem’s not show all…it’s only show half of it…is that my replacement code totally wrong?..

p/s:if u don’t mind just put the numbering to the each button…

Im not sure what is wrong,ive just tried the same with a number of different sized pictures and it seems ok
http://www.gifsrus.com/testfile/fadeinout/gridbuttons2.swf
(only put 0->6 pictures on)
check that your pictures are not progressive.

Not sure what you mean by the numbering. This is the line which controls the numbers myclip.myText.text = i;
if you don`t want numbers, delete it.

tq…stringy…great works…and great help…tq

You are welcome