jcs  
                
                  
                    December 16, 2002,  4:52pm
                   
                  1 
               
             
            
              Howdy all,
Using pom’s drawing board tute  and I need help masking/bounding it.
I am making a geography tutorial in which I want users to be able to draw inside a circle, but not outside it.
Tried making a mask on a layer above the frame w/ AS and tried adjusting the z-index of the AS but think I did it wrong. Is there additional code that can bound the drawing parameters to a circle or another way to mask it?
Thanks much, jc
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 16, 2002,  5:14pm
                   
                  2 
               
             
            
              Put an empty clip on a layer, and mask the layer. Then draw INSIDE that empty clip.
pom 
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 16, 2002,  5:32pm
                   
                  3 
               
             
            
              pom, to my rescue again! Need clarification:
added another layer above a layer containing your code 
masked it 
added this code to the masking layer (in best amateur fashion): 
 
_root.createEmptyMovieClip(“circle”, 1);
Know I am missing something easy. Thanks.
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 16, 2002, 11:27pm
                   
                  4 
               
             
            
              The code we have is
// 1. SETTING THINGS
_root.createEmptyMovieClip("line",1);
// 2. EVENTS IN _ROOT:
_root.onMouseDown = function(){
	line.moveTo(_xmouse,_ymouse);
	line.lineStyle(2,0x000000,100);
	this.onMouseMove = function(){
		line.lineTo(_xmouse,_ymouse);
		updateAfterEvent();
	}
}
_root.onMouseUp = function(){
	this.onMouseMove = null;
}
Now if there’s a circle movie clip on the scene, instance name circle, all you have to do is
line.setMask(circle);
pom :moustache
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 17, 2002, 12:28am
                   
                  5 
               
             
            
              right. Got it and worked it.
Any thoughts?
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 17, 2002,  9:20am
                   
                  6 
               
             
            
              I don’t understand what you’re trying to do :-\ If it’s just filling the shape, it’s beginFill all right.
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 17, 2002,  2:41pm
                   
                  7 
               
             
            
              Not sure where to put endFill() or what its syntax should be. Have this code right now:
// 2. EVENTS IN _ROOT:
}
}
I’ve attached the .fla if you want to see where I’m going.
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 18, 2002,  1:46pm
                   
                  8 
               
             
            
              I couldn’t figure it out, I asked my chinese master :beam:
// thanks to Gorlim from flashxpress.net for the code
this.onMouseDown=function(){
	this.lineStyle(0,0,100);
	this.moveTo(_xmouse,_ymouse);
	tabY=new Array;
	tabX=new Array;
	tabX.push(_xmouse);
	tabY.push(_ymouse);
	this.onMouseMove=function(){
		tabX.push(_xmouse);
		tabY.push(_ymouse);
		this.lineTo(_xmouse,_ymouse);
		}
	}
this.onMouseUp=function(){
	delete this.onMouseMove;
	this.moveTo(tabX[0],tabY[0]);
	this.beginFill(0xffcc66,100);
	for(var i=1;i < tabX.length;i++){
		this.lineTo(tabX*,tabY*);
	}
	delete tabY;
	delete tabX;
	this.endFill();
}
pom 
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 18, 2002,  3:00pm
                   
                  10 
               
             
            
              I’m sorry, there are problem with code display on the forum because of < and >.
Anyway, here’s the complete code
// 1. SETTING THINGS
_root.createEmptyMovieClip("line",1);
line.setMask(circle);
// 2. EVENTS IN _ROOT:
// thanks to Gorlim from flashxpress.net for the code
line.onMouseDown=function(){
	this.lineStyle(0,0,100);
	this.moveTo(_xmouse,_ymouse);
	tabY=new Array;
	tabX=new Array;
	tabX.push(_xmouse);
	tabY.push(_ymouse);
	this.onMouseMove=function(){
		tabX.push(_xmouse);
		tabY.push(_ymouse);
		this.lineTo(_xmouse,_ymouse);
		}
	}
line.onMouseUp=function(){
	delete this.onMouseMove;
	this.moveTo(tabX[0],tabY[0]);
	this.beginFill(0xffcc66,100);
	for(var i=1;i < tabX.length;i++){
		this.lineTo(tabX*,tabY*);
	}
	delete tabY;
	delete tabX;
	this.endFill();
}
// 3. BUTTON "ERASE":
// --------------------
reset.onPress = function(){
	_root.line.clear();
}
And I really like your ideas, man :beam:
pom 
             
            
              
            
           
          
            
              
                system  
              
                  
                    December 18, 2002,  3:36pm
                   
                  11 
               
             
            
              Whoa.
That is even cooler than I thought. Thanks, pom (and Gorlim) for the compliment and for your patience. Awesome work. <:}
To see it in context, go here:http://www.chile2002.org/curriculum/lessonplans/culture/draw_earth.html 
and click the “interactive” button
JC