School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 308,424 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,227 people online right now. Registration is fast and FREE... Join Now!




Filling a page with Squares

 

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

jansiflash

26 Jul, 2008 - 01: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
+Quote Post

 
Reply to this topicStart new topic
Replies(1 - 1)

BetaWar

RE: Filling A Page With Squares

26 Jul, 2008 - 08:37 AM
Post #2

#include <soul.h>
Group Icon

Joined: 7 Sep, 2006
Posts: 4,779



Thanked: 277 times
Dream Kudos: 1400
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
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/24/09 01:37PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month