Jump to content


Key problem


  • You cannot reply to this topic
5 replies to this topic

#1 Eibbie

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 26 March 2007 - 05:48 PM

_root.save = true;
//Save Keys   
if (Key.isDown(Key.BACKSPACE) && _root.save == true) {
 save.goatoAndStop(2);
 _root.left = false;
 _root.up = false;
 _root.right = false;
 _root.down = false;
 _root.shift = false;
 _root.save = false;
} else if (Key.isDown(Key.BACKSPACE) && _root.save == false) {
 save.gotoAndStop(1);
 _root.right = true;
 _root.left = true;
 _root.up = true;
 _root.down = true;
 _root.shift = true;
}

When I press backspace, nothing happens.. It was supposed to be on frame 2. Would anyone help me?

#2 gostmn26

    Young Padawan

  • Members
  • Pip
  • 12 posts
  • Gender:Male
  • Location:14560

Posted 26 March 2007 - 08:17 PM

First did you mispell this here in your script

save.goatoAndStop(2);

Have you tried putting it below your root timeline as you have before like this?
_root.save.gotoAndStop(2)

Edited by gostmn26, 26 March 2007 - 08:20 PM.


#3 Eibbie

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 27 March 2007 - 04:23 PM

Woops, I didn't notice that thanks, but still.. It won't appear even I try to put the script inside save MC.

onClipEvent (load) {
	_root.save = true;
}
onClipEvent (enterFrame) {
	//Save Keys   
	if (Key.isDown(Key.BACKSPACE) && _root.save == true) {
		_root.save.gotoAndStop(2);
		_root.left = false;
		_root.up = false;
		_root.right = false;
		_root.down = false;
		_root.shift = false;
		_root.save = false;
	} else if (Key.isDown(Key.BACKSPACE) && _root.save == false) {
		_root.save.gotoAndStop(1);
		_root.right = true;
		_root.left = true;
		_root.up = true;
		_root.down = true;
		_root.shift = true;
	}
}


#4 bezz

    Young Padawan

  • Members
  • Pip
  • 23 posts
  • Gender:Male
  • Location:Berlin, NJ
  • Interests:Flash, Snowboarding, Paintball, Learning Guitar

Posted 28 March 2007 - 10:23 AM

what is _root.save? a movie clip or a variable? You set it to false in one section of the code and tell it to got to frame 2 in another part of the code. If it is a movie clip, make sure the instance name of that movieclip is set to 'save'. The instance name box can be located by clicking the movie clip and opening the properties tab.

#5 gostmn26

    Young Padawan

  • Members
  • Pip
  • 12 posts
  • Gender:Male
  • Location:14560

Posted 28 March 2007 - 11:01 AM

Bezz.....you gave me an euphoric moment when i read what you said....lol.....

I sat here and motors clicked and solved a problem for me in another program. DOH.....
Well thanks ;)
YTBG


#6 Eibbie

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 28 March 2007 - 03:09 PM

View Postbezz, on Mar 28 2007, 11:23 AM, said:

what is _root.save? a movie clip or a variable? You set it to false in one section of the code and tell it to got to frame 2 in another part of the code. If it is a movie clip, make sure the instance name of that movieclip is set to 'save'. The instance name box can be located by clicking the movie clip and opening the properties tab.


Woops, both. I changed a movie clip's instance name to sm. A variable is same, but even after I changed the code and pressed backspace, the movieclip won't show! ._.
onClipEvent (load) {
 _root.save = true;
}
onClipEvent (enterFrame) {
 //Save Keys   
 if (Key.isDown(Key.BACKSPACE) && _root.save == true) {
  _root.sm.gotoAndStop(2);
  _root.left = false;
  _root.up = false;
  _root.right = false;
  _root.down = false;
  _root.shift = false;
  _root.save = false;
 } else if (Key.isDown(Key.BACKSPACE) && _root.save == false) {
  _root.sm.gotoAndStop(1);
  _root.right = true;
  _root.left = true;
  _root.up = true;
  _root.down = true;
  _root.shift = true;
  _root.save = true;
 }
}






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users