[font=Arial]this.onPress = function(){
I get two errors:
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Statement must appear within on/onClipEvent handler
Anyone know what I might be doing wrong?  I’m placing the code on the symbol-movie that I want to duplicate and haven’t added any other script
             
            
              
            
           
          
            
              
                Ubik  
              
                  
                    August 4, 2004,  8:10am
                   
                  2 
               
             
            
              i suppose you have this code on a movieclip, so you have to use onClipEvent, something like this
onClipEvent (enterframe){
this.onPress = function(){
if(this._name == "myClip"){
counter++;
this.duplicateMovieClip("myClip" + counter, counter);
}else{
this.startDrag();
}
}
this.onRelease = function(){
stopDrag();
}
}
 
            
              
            
           
          
            
              
                Ubik  
              
                  
                    August 4, 2004, 10:39am
                   
                  5 
               
             
            
              I got it working just if you click on the square, i tried something with Key.isDown to use the del key but it won’t work, so here’s the code
onClipEvent (load){
this.onPress = function(){
if(this._name == "myClip"){
counter++;
this.duplicateMovieClip("myClip" +counter, counter);
trace("myClip"+counter)}else{
this.startDrag();
this.onPress=function(){
	this.removeMovieClip()
}
}
}
this.onRelease = function(){
stopDrag();
}
}
 
            
              
            
           
          
            
              
                pom  
              
                  
                    August 4, 2004,  1:30pm
                   
                  6 
               
             
            
              UBIK >> There’s no point using dynamic event handlers if you’re going to put them inside static event handlers 
             
            
              
            
           
          
            
              
                Ubik  
              
                  
                    August 4, 2004,  1:34pm
                   
                  7 
               
             
            
              eeh,so what would it look like? still trying to learn this d*mn language :ne:
             
            
              
            
           
          
            
              
                pom  
              
                  
                    August 4, 2004,  2:54pm
                   
                  8 
               
             
            
              You could either write directly on the clip on(press) {…} or put the clip.onPress = function () {…} declaration in the main timeline 
http://www.kirupa.com/developer/actionscript/tricks/dynamicevent.htm 
             
            
              
            
           
          
            
              
                bobdoe  
              
                  
                    August 4, 2004,  4:24pm
                   
                  9 
               
             
            
              haha, yeh the code posted above seems a little redundant.
             
            
              
            
           
          
            
              
                Ubik  
              
                  
                    August 5, 2004,  7:54am
                   
                  10 
               
             
            
              
You could either write directly on the clip on(press) {…} or put the clip.onPress = function () {…} declaration in the main timeline
 
ok, i understand ! et merde…[SIZE=1](juste pour le plaisir, i can put bad words in french, it won’t filter :P) [/SIZE] my english understanding isn’t that good :beam: