Re: [Flashcoders] thumbnail panel
you're a STAR Jesse. absolutely perfectly clean and simple!! thnks a million, I had spent a lot of time trying to find a solution based on knowledge I already had, but i simply did not know enough. Again, thanks, Ben On 6/5/07, Jesse Graupmann <[EMAIL PROTECTED]> wrote: // // // VERSION 1 // // var xspace = 20; var yspace = 20; var xmax = 400; var row = 0; var col = 0; var len = 10; for ( var i = 0; i < len; i ++ ) { var depth = this.getNextHighestDepth(); var t = this.attachMovie ( "box", "box_" + i, depth ); var nx = ( t._width + xspace ) * col; if ( nx > xmax ) { col = 0; ++row; nx = ( t._width + xspace ) * col; } var ny = ( t._height + yspace ) * row; ++col; t._x = nx; t._y = ny; } // // // VERSION 2 // // var xspace = 20; var yspace = 20; var width = xspace + 30; var height = yspace + 30; var rows = 5; var len = 10; for ( var i = 0; i < len; i ++ ) { var depth = this.getNextHighestDepth(); var t = this.attachMovie ( "box", "box_" + i, depth ); var col = (i % rows); var row = (Math.floor( i/rows )); t._x = width * col; t._y = height * row; } _ Jesse Graupmann www.jessegraupmann.com www.justgooddesign.com/blog/ _ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ben deroo Sent: Monday, June 04, 2007 5:39 PM To: Flashcoders mailing list Subject: [Flashcoders] thumbnail panel hi, I'm trying to create a simple sample thumbnail panel with movieclips, which i'll later modify, but there seems to be something wrong in the code code: // for (var i:Number = 0; i<10; i++) { var t = attachMovie("box", "box"+i, i+1); var Xspacing:Number = 20; var Xreset:Number = 0; var Yspacing:Number = 20; var counter:Number = 1; t._x += (t._width+Xspacing)*i; if (t._x>400) { //counter++; t._y = (t._height+Yspacing); t._x = Xreset; t._x += (t._width+Xspacing)*(counter); } else { //counter++; } } //end code I'm trying to create several rows, but seem to be failing to do so, is this a conditional logic error? thanks for any help Ben ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] thumbnail panel
// // // VERSION 1 // // var xspace = 20; var yspace = 20; var xmax = 400; var row = 0; var col = 0; var len = 10; for ( var i = 0; i < len; i ++ ) { var depth = this.getNextHighestDepth(); var t = this.attachMovie ( "box", "box_" + i, depth ); var nx = ( t._width + xspace ) * col; if ( nx > xmax ) { col = 0; ++row; nx = ( t._width + xspace ) * col; } var ny = ( t._height + yspace ) * row; ++col; t._x = nx; t._y = ny; } // // // VERSION 2 // // var xspace = 20; var yspace = 20; var width = xspace + 30; var height = yspace + 30; var rows = 5; var len = 10; for ( var i = 0; i < len; i ++ ) { var depth = this.getNextHighestDepth(); var t = this.attachMovie ( "box", "box_" + i, depth ); var col = (i % rows); var row = (Math.floor( i/rows )); t._x = width * col; t._y = height * row; } _ Jesse Graupmann www.jessegraupmann.com www.justgooddesign.com/blog/ _ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ben deroo Sent: Monday, June 04, 2007 5:39 PM To: Flashcoders mailing list Subject: [Flashcoders] thumbnail panel hi, I'm trying to create a simple sample thumbnail panel with movieclips, which i'll later modify, but there seems to be something wrong in the code code: // for (var i:Number = 0; i<10; i++) { var t = attachMovie("box", "box"+i, i+1); var Xspacing:Number = 20; var Xreset:Number = 0; var Yspacing:Number = 20; var counter:Number = 1; t._x += (t._width+Xspacing)*i; if (t._x>400) { //counter++; t._y = (t._height+Yspacing); t._x = Xreset; t._x += (t._width+Xspacing)*(counter); } else { //counter++; } } //end code I'm trying to create several rows, but seem to be failing to do so, is this a conditional logic error? thanks for any help Ben ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] thumbnail panel
Ben, One problem I see with the code right away is this. You are only going to run your second level thumb nails though that if statement when the previous thumb>_x is > 400 That means after placing the first thumb on the second row, your if(){ code } doesn't get read. I would have a look at that. Maybe put in a mini if(t._x>400) { levelCount +=1;}; And then use your t._y var with a multiplier using levelCount. Understand. I am taking a five minute break. I will come back and try to write some of that idea out for you. Vdst. - Original Message - From: "ben deroo" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Monday, June 04, 2007 7:38 PM Subject: [Flashcoders] thumbnail panel > hi, > I'm trying to create a simple sample thumbnail panel with movieclips, which > i'll later modify, but there seems to be something wrong in the code > > > code: > // > for (var i:Number = 0; i<10; i++) { > var t = attachMovie("box", "box"+i, i+1); > var Xspacing:Number = 20; > var Xreset:Number = 0; > var Yspacing:Number = 20; > var counter:Number = 1; > > t._x += (t._width+Xspacing)*i; > > if (t._x>400) { > //counter++; > t._y = (t._height+Yspacing); > t._x = Xreset; > t._x += (t._width+Xspacing)*(counter); > } else { > //counter++; > } > } > > > //end code > > I'm trying to create several rows, but seem to be failing to do so, is this > a conditional logic error? > > thanks for any help > > > Ben > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com