A simple "portal defenders" style movement code :
onClipEvent (load) {
speed = 6;
speed2 = 10;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
this._y -= speed2;
this.gotoAndStop(2);
}
if (Key.isDown(Key.DOWN)) {
this._y += speed2;
this.gotoAndStop(2);
}
if (Key.isDown(Key.LEFT)) {
this._x -= speed;
this.gotoAndStop(2);
_xscale = -scale;
}
if (Key.isDown(Key.RIGHT)) {
this._x += speed;
this.gotoAndStop(2);
_xscale = +scale;
}
}
onClipEvent (keyUp) {
this.gotoAndStop(1);
}
Goes on character
========================================
===
Customized right-click menu
stop();
function deadClick () {
}
function highQuality () { _quality = "high"; } function mediumQuality () { _quality = "medium"; } function lowQuality () { _quality = "low"; } var newMenu:ContextMenu = new ContextMenu(); newMenu.hideBuiltInItems(); var lowQ:ContextMenuItem = new ContextMenuItem("High Quality", highQuality); var mediumQ:ContextMenuItem = new ContextMenuItem("Medium Quality", mediumQuality); var highQ:ContextMenuItem = new ContextMenuItem("Low Quality", lowQuality);
function gotoMySite () {
getURL("http://www.newgrounds.com", "_top");
}
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var mySiteLink:ContextMenuItem = new ContextMenuItem("Newgrounds.com", gotoMySite);
myMenu.customItems.push(mySiteLink, highQ, mediumQ, lowQ);
highQ.separatorBefore = true;
_root.menu = myMenu;
goes on first frame.
========================================
========================
Website button
Put this on a button.
on (release) {
getURL("http://www.(link)", "_blank");
}
========================================
=======
Numbering
A=65
B=66
C=67
D=68
E=69
F=70
G=71
H=72
I=73
J=74
K=75
L=76
M=77
N=78
O=79
P=80
Q=81
R=82
S=83
T=84
U=85
V=86
W=87
X=88
Y=89
Z=90
onClipEvent(enterFrame)
{ if(Key.isDown(insert number))(
gotoAndPlay(Frame Label))}
Example
onClipEvent(enterFrame){
if(Key.isDown(90))(
gotoAndPlay("jump"))
}
========================================
That's all if got, the bugs are worked out in these codes.