Welcome to Dream.In.Code
Getting Help is Easy!

Join 109,556 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,344 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Filling a page with Squares

 
Reply to this topicStart new topic

Filling a page with Squares, Filling a page with Squares in a specific pattern

jansiflash
post 26 Jul, 2008 - 02:22 AM
Post #1


New D.I.C Head

*
Joined: 26 Jul, 2008
Posts: 2

CODE

[b]stop ();
xpos=0;
ypos=0;
for (i=1;i<=70;i++)
{
duplicateMovieClip("block","block"+i,i);
if ( i%10==0) {xpos=0; ypos+=50;} else  xpos+=75;
this["block"+i]._x=xpos;
this["block"+i]._y=ypos;
}[/b]


I need to fillup a page with squares in a specific pattern
here "block" is a movieclip (square)

Can u sugguest me a logic for this?
User is offlineProfile CardPM

Go to the top of the page


BetaWar
post 26 Jul, 2008 - 09:37 AM
Post #2


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,266



Thanked 38 times

Dream Kudos: 775
My Contributions


The hardest part of creating a pattern for things to be displayed dynamically is getting an equation that works.

For instance if you wanted to make a diagonal line you would just place the x and y values to the x and y values of the MC before it plus the mc before its with and height respectivly.

I am sure there are equations out there for various patterns, maybe try a google search.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 9/7/08 11:06PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month