flash as Q
- Started
- Last post
- 41 Responses
- stewart0
okay...
why o why can't i get any further than this:
http://www.kulsdom.com/client/se…have a look at the .fla here:
http://www.kulsdom.com/client/se…
- mimeartist0
what you want to do is not think about centering them to begin with, as that will send you to a funny farm... treat each horizontal line of images seperately, and think of it like text wrapping, depending on how much the x axis is after adding one you then decide if you're going to wrap them or not... when you do adjust the y axis do it by the biggest from the previous line... then with the ones from the previous line work out how much space they take up... eg... if they take up 700 pixels on a 800 screen... then you simply add a buffer of 50 pixels to each of them, and they'll magically centre... with this you can then have as many rows as you like....
- mimeartist0
also... with the previous line... do the buffer to the y axis also... so use the value of the biggest one, and add a buffer to the smaller ones in the y direction...
did something similar for www.cosstores.com but with expanding boxes too... bit of a headf*** to be honest!
- acescence0
i don't think he wanted the y position to be the same for every box on a line though
- mimeartist0
you seem to be getting there... but at times it looks like you could fit the box on the new line, on the previous line
- mimeartist0
read my 2nd bit... that would solve that
- stewart0
"...but at times it looks like you could fit the box on the new line, on the previous line...
mimeartist
(Apr 10 07, 13:33)"yes, that too :(
- mimeartist0
should do a dry run on paper... realy helps to get the idea of things and how they work... you'll end up wrapping yourself i code otherwise
- st33d0
I think it might look nicer working from top left.
http://pastebin.coconut.se/?id=4…
It would be easier to read, and the script I've done works from the biggest height downwards, so that could be changed to size or width or something (I've put an array sort function in there).
A group hug is always going to leave ugly gaps. I don't think that's going to help the rest of your design.
- stewart0
"should do a dry run on paper... realy helps to get the idea of things and how they work...
mimeartist
(Apr 11 07, 11:37)"haha!
believe it or not, but i've cut 20 different sized blocks from a paper and laying them donw on the floor one by one again and again before going back to the actionscript panel.i'm a llittle further now. i think i'll upload it tomorrow.
st33d, sorry, i can't ever READ your script. you must be brilliant.
- st33d0
st33d, sorry, i can't ever READ your script. you must be brilliant.
stewart
(Apr 11 07, 11:46)That would be the case if my code was readable.
- stewart0
in my opinion at this moment it's already brilliant if flashplayer can read it.
i suck at translating my ideas into actionscript code.
should i quit making websites now?
- skt0
I quite like your solution over 2 rows keeping the top of the box's aligned.
- stewart0
aaaargh!
but i'm almost there, at least with a little help of you all...have a look at this:
i only want the blocks on the second line (and the third when there is one) shift up till they're 20px off the block above them.and i want the boxes that don't fit on the stage to be invisible.
here's the latest fla
http://www.kulsdom.com/client/se…thanks for your time again...
- st33d0
The invisibility bit is easy. Just say,
if x + width past the line or
y + height past the line then
_visible = false;The shoving up to meet the stuff bit is quite hard. I've been trying to do that for a Diablo clone for generating a dungeon.
I'm afraid you'll have to do some really annoying math for that.
- enjine0
This is what you want. No hacks:
http://mechanical-bull.com/stuff…
Just be sure to set the width and height of the overall so that you can actually fit in all of the different shapes you need. Otherwise you'll get a script timeout.
- st33d0
Breaks my computer when I change the library.
- st33d0
Damn I'm good:
http://pastebin.coconut.se/?id=4…
It works because the boxes are getting smaller.
If you have the movieclips in an array then you can use Flash's sort method to get them in size order by comparing _height.
- enjine0
yeah, you have to change the output display size if you put larger images in there. otherwise it won't have enough space to place them and loop infinitely.
- stewart0
enjine, i'd love to have a look at the document you posted.
unfortunately i have only access to MX2004 at the moment... is it possible to save it as a MX2004 fla?
thanks!