Ok, so I have been wondering recently, if I could make Achievements for a game in flash. I started by trying to make a code that basically shows text when you do something. Here is the code I made;
onClipEvent(load){
var achievement1 = 0;
var achievement2 = 0;
var achievement3 = 0;
var achievement4 = 0;
var achievement5 = 0;
}
onClipEvent(enterFrame){
if(this.hitTest(_root.box)){
_root.achievement1 = 1
}
}
onClipEvent(enterFrame){
if(achievement1 = 1){
trace ("Achievement1 Unlocked!");
}
}
The problem is that the text appears even when you don't do anything, the trace says 'Achievement1 Unlocked!' Over and over.
I am not yet very good at creating my own actionscript codes, and would like a point in the right direction and an explanation on how to make this work.
Details: I use AS2 and Flash player 8
~Rabjab