Lars!
11-29-2007, 12:11 PM
Hi first of all i hope you can help me, no one else could :(
I made an adventure game, where you colloct letters, you can move freely through all the scenes, and look for letters. Each letter is a Movie Clip, which contains the following code:
keyListener = new Object();
keyListener.onKeyDown = function() {
var keyCode = Key.getCode();
if (keyCode == 71) {
i = i + 1;
testi();
gotoAndStop(2);
}
};
Key.addListener(keyListener);
I want to load a scene when all the letters are collected (ending scene)
so i made a variable which is what the line: "testi();" refers to.
In my timeline i have tried to create a global variable with a function:
var (i = 0);
function (testi) {
if (i > 6)
gotoAndPlay(256)
}
There are 7 letters so far, which i why i want the "gotoAndPlay(256)" to load if i>6
But it doesent seem to work, is this a way to do it?
If this is not enough info, please tell me and i'll try to explain...
Thank you very much
I made an adventure game, where you colloct letters, you can move freely through all the scenes, and look for letters. Each letter is a Movie Clip, which contains the following code:
keyListener = new Object();
keyListener.onKeyDown = function() {
var keyCode = Key.getCode();
if (keyCode == 71) {
i = i + 1;
testi();
gotoAndStop(2);
}
};
Key.addListener(keyListener);
I want to load a scene when all the letters are collected (ending scene)
so i made a variable which is what the line: "testi();" refers to.
In my timeline i have tried to create a global variable with a function:
var (i = 0);
function (testi) {
if (i > 6)
gotoAndPlay(256)
}
There are 7 letters so far, which i why i want the "gotoAndPlay(256)" to load if i>6
But it doesent seem to work, is this a way to do it?
If this is not enough info, please tell me and i'll try to explain...
Thank you very much