popnfresh24
07-06-2009, 09:18 AM
Hey everyone... So i started making a game in AS3 after taking a tutorial and i figured i could do it... only to the remember the tutorial was in AS2...
and i have no idea how to change it to AS3...
2nd thing is... you can navigate around the room... say you collect a "pen" on the first frame... it's meant to dissapear from the scene and appear in the inventory... then you go to the 2nd frame... it stays in the inventory...
but when you go back to frame 1... the AS runs again and makes it reappear in the scene and dissapear from the inventory...
i have the AS running for the whole 6 frames of the scene... but that doesn't help... so does anyone know how to fix both my problems??? here is the coding i'm using which i need to convert into AS3
stop();
var door:Button;
door.enabled = false;
var keylocated:String;
var bananalocated:String;
var spoonlocated:String;
keylocated = "hidden";
bananalocated = "hidden";
spoonlocated = "hidden";
var cat1_mc:MovieClip;
var cat_mc:MovieClip;
var water_mc:MovieClip;
var flower_mc:MovieClip;
key2_mc._visible = false;
banana2_mc._visible = false;
spoon2_mc._visible = false;
key1_mc.onPress = function(){
key2_mc._visible = true;
key1_mc._visible = false;
keylocated = "found";
}
spoon1_mc.onPress = function(){
spoon2_mc._visible = true;
spoon1_mc._visible = false;
spoonlocated = "found";
}
banana1_mc.onPress = function(){
banana2_mc._visible = true;
banana1_mc._visible = false;
bananalocated = "found";
}
door_btn.onPress = function(){
gotoAndStop("youescaped",1);
}
key1_mc.onEnterFrame = function(){
if((keylocated eq "found")& (spoonlocated eq "found")&
(bananalocated eq "found")){
door.enabled = true;
}
}
this isn't my actual code... this is the one from the tutorial... but if you help me with this i can figure out the rest hopefully... :)
if the coding repeates you don't have to explain it 3 times just tell me one thing and i'll apply it to the rest
thanx everyone
and i have no idea how to change it to AS3...
2nd thing is... you can navigate around the room... say you collect a "pen" on the first frame... it's meant to dissapear from the scene and appear in the inventory... then you go to the 2nd frame... it stays in the inventory...
but when you go back to frame 1... the AS runs again and makes it reappear in the scene and dissapear from the inventory...
i have the AS running for the whole 6 frames of the scene... but that doesn't help... so does anyone know how to fix both my problems??? here is the coding i'm using which i need to convert into AS3
stop();
var door:Button;
door.enabled = false;
var keylocated:String;
var bananalocated:String;
var spoonlocated:String;
keylocated = "hidden";
bananalocated = "hidden";
spoonlocated = "hidden";
var cat1_mc:MovieClip;
var cat_mc:MovieClip;
var water_mc:MovieClip;
var flower_mc:MovieClip;
key2_mc._visible = false;
banana2_mc._visible = false;
spoon2_mc._visible = false;
key1_mc.onPress = function(){
key2_mc._visible = true;
key1_mc._visible = false;
keylocated = "found";
}
spoon1_mc.onPress = function(){
spoon2_mc._visible = true;
spoon1_mc._visible = false;
spoonlocated = "found";
}
banana1_mc.onPress = function(){
banana2_mc._visible = true;
banana1_mc._visible = false;
bananalocated = "found";
}
door_btn.onPress = function(){
gotoAndStop("youescaped",1);
}
key1_mc.onEnterFrame = function(){
if((keylocated eq "found")& (spoonlocated eq "found")&
(bananalocated eq "found")){
door.enabled = true;
}
}
this isn't my actual code... this is the one from the tutorial... but if you help me with this i can figure out the rest hopefully... :)
if the coding repeates you don't have to explain it 3 times just tell me one thing and i'll apply it to the rest
thanx everyone