Help: Flash of course
- Started
- Last post
- 10 Responses
- normal
Alright guys here is the problem that i'm trying to solve.
I've got a load of swf thumbnails (thumb01, 02, 03, etc) of different _x sizes and the same _y height. I want to load all of the movies in a horizontal line that steps from one to the next and from left to right keeping in mind that the x size is different from one to the next.
Any suggestions on how to execute this manuever? Or am I going about it the wrong way?
- ganon0
//make all thumbs MCs and have the linkage properties set to "sq01", "sq02", etc....
//max # of thumbnails
this.maxThumbs = 4;
//space between each thumb
this.myBuffer = 10;
//starting x
this.startX = 0;
//yPos
this.startY = 25;//replace { with "less than" sign
for (i=1; i{this.maxThumbs + 1; i++) {
this.attachMovie (["sq0"+i], ["sq0"+i+"_mc"], i);
this["sq0"+i+"_mc"]._y = this.startY;
this["sq0"+i+"_mc"]._x = this.startX;
this.startX += myBuffer + this["sq0"+i+"_mc"]._width;
}
- normal0
Ahh.. right, MCs would be better.
Because then flash can calculate the sizes as opposed to SWF's.
Duh!
Okay, I'll give it a run and see if I can make it work. Thanks for the push in the right direction Ganon.
- normal0
Okay, i've got it working beautifully.
The only problem being that the MCs are all different x widths so i'm getting some overlay. I obviously need to keep some sort've x width tally as the script goes through the motions and I actually want them to butt next to eachother so buffer space isn't necessary.
Possible?
- ganon0
//thats what this line does in my code, you can remove the buffer or set it to 0
this.startX += myBuffer + this["sq0"+i+"_mc"]. _width;
- normal0
Not working, my remedial yet improving skills cannot yet divine the reason.
I've tried this:
this.startX += this["sq0"+i+"_mc"]._width
translated roughly to me as I'm learning here:
TheCurrentMC.startX (add and append) TheCurrentMC._width
Perhaps it should spit out a new StartX for the next loop to use?
- ganon0
whats happening?..that works fine for me....
- normal0
Should I have it built into a function and call the function? It's just a timeline code scrap now.
seems they just pile on top of one another.
Oh yeah, and if I want to change something on the movie clip once it's loaded I would use sq01_mc to make that call correct?
- ganon0
post your code..."sq01_mc", "sq02_mc" etc are the instance names....
- normal0
I changed the "sq0" to "sq" so that it would iterate through more than 9. If I use that code and remove the mybuffer they just lay on top of eachother.
//max # of thumbnails
this.maxThumbs = 10;
//space between each thumb
this.myBuffer = 50;
//starting x
this.startX = 0;
//yPos
this.startY = 100;//replace { with "less than" sign
for (i=1; i
- normal0
Thanks for the help Ganon.
It's sorted now.