This function business is all new to me but it seems fairly simple. What I have is a player controlled movie clip that moves around with the keys w, s, a and d. I have this code on him which makes it so while the left mouse button is down it preforms the createBullet function.
onClipEvent(load){
Mouse.addListener(this);
this.onMouseDown = function(){
_root.onEnterFrame = function(){
_root.createBullet();
}
}
this.onMouseUp = function(){
_root.onEnterFrame = null;
}
}
This code is on the main time line:
i = 0;
k = 0;
function createBullet() {
i++;
k++;
if (k == 10) {
k = 0;
}
if (k == 0) {
duplicateMovieClip(_root.bullet, "bullet_"+i, i);
}
}
My question is that when I try to add onEnterFrame = function(){} onto the main timeline its is directly affected by the code on the player controlled movieclip (_root.onEnterFrame = null;). I want to add another function that loops every frame. How would I do this?