before i ask my question i just want to say sorry for posting this question in the actionscript foum and this forum but it had been a little while and nobody had posted in there let alone replied to my thread so i went in and found that it was empty so i decided to post the question here. sorry again.
why won’t it work
i had this code in a movie clip food1
PHP:--------------------------------------------------------------------------------
onClipEvent (enterFrame) {
if (_root["food"+y], hitTest(_root.part1)) {
snakelength++;
x++;
y++;
duplicateMovieClip("food"+x, "food"+y, y);
_root["food"+y]._x = (random(55))*10
_root["food"+y]._y = (random(40))*10
}
}
but of course when i duplicated the movieclip it didn’t keep the code because i changed the instace name but i wanted to be able to remove food1, so i put the code in a blank movie clip. I thought i had written the code so that it didn’t matter what movieclip it was in, but it worked in food1 but not in the blank movieclip. someone please help me. thanks.