Question about drawing board tut

Hey Kirupa, I love the site and have found the tutorials to be a great resource.

My question is this. I’m modifying the drawing board to do a spray can effect. I’ve been able to attach a small movie clip of several dots instead of the line, have removed the scaling effect, and a couple of other mods.

The problem comes when I try to change the color of the “paint”. What I want to do is draw with one color, and then be able to click a button to alter the color of the upcoming paint movie clips (without affecting the ones already on the stage). It seems simple enough, but I can’t get the color object to find the attached movie clip!

Any help would be greatly appreciated. Thanks!

-=e=-

I assume you’re talking about the Flash 5 tute here. Well, you could also attach different movie clips each time. Lines of different colors.

pom :slight_smile:

*Originally posted by ilyaslamasse *
**I assume you’re talking about the Flash 5 tute here. Well, you could also attach different movie clips each time. Lines of different colors.
**

Yes, I’m using the Flash 5 version.
I’ve used attachMovie scripted in the invisible “controller” movie clip as specified in the tute. I’ve also created a series of different colored buttons. Would I script the attachment of new movie clips on the buttons or on the controller?

I’m just starting to get my feet wet with more advanced actionscripting, and while I understand the concepts, the execution still challenges me.

Thanks for your help!
-=e=-

Well, he’re the line where we attach the line movie clip.

this.attachMovie("mcLine","line"+i,i);

So basically we need to attach mcLineRed, or mcLineBlue, or mcLineGreen and so on (which you’ll have to do).

onClipEvent (load) {
	**clipToAttach="mcLine";**
	function draw () {
		i++ ;
		this.attachMovie(**clipToAttach**,"line"+i,i);
		var mc = this["line"+i] ;
		//...

And then on a button:

on (press) {
	_root.controller.clipToAttach="lineYellow";
}

I hope it helps. I have made a file, tell me if you want it.

Cheers.

pom :cowboy:

I think I understand. Each color gets a movie clip with linkage named MCLineRed, MCLineBlue, etc. Also, the attachMovie includes a variable that can be called from the color picker buttons?

I’d like to see the file if you wouldn’t mind; I’ll try this tonight and let you know how it works!

Thanks again for getting back to me, I’m new to this board, and I appreciate the support and positive attitude!

-=e=-

Worked perfectly, I owe you a beer. Thanks much.

-=e=-

Cheers, man. :cowboy:

Btw, did you vote for the contest?