Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic drawing 1

Status
Not open for further replies.

law78

Technical User
Apr 23, 2004
78
GB
Hi people,

I am not a genius when it comes to ActionScript but I trying to create a simple patterned background to my movie, basically just a series of evenly spaced digonal lines, similar to the ones found at
I have managed to create a diagonal line using the following code:

_root.createEmptyMovieClip( "diagonal", 1 );
with ( _root.diagonal )
{
lineStyle( 0, 0xff00ff, 100 );
moveTo( 0, 0 );
lineTo( 760,540 );
}

How do I reuse this code without copying and pasting it for each additional line (that would be a lot of code).

Basically need the lines to fill an area of 750 x 500 with a 0.5 pixel space between any ideas?

Thanks
 
Code:
_root.createEmptyMovieClip("diagonal", 1);
with (_root.diagonal) {
	for (var i = 0; i<200; i+=4) {
		lineStyle(.5, 0xff00ff, 100);
		moveTo(i, 0);
		lineTo(760+i, 540);
	}
}

Will do loads of lines by looping the drawing section - you can aler the values in the 'for' statement to get what you need but I think the 2Advanced stuff is actually done in Photoshop and imported as a bitmap.
 
thanks for that, I had done it with the imported image and will try it with the code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top