biG frend -> RE: Flash Q&A Thread 5 - Flash Has Shares In Your Soul (4/16/2008 1:52:48)
|
Try this perhaps pony onClipEvent (load) { var grav:Number = 0; var run:Number = 6; var wlk:Number = 2.5; var speed:Number = run; var jumpHeight:Number = 12; var dbl:Number = 10; var tri:Number = 10; var djump:Boolean = false; var tjump:Boolean = false; var slow:Number = .7; var slowspd:Number = speed/2; var setspeed:Number = speed; var scale:Number = _xscale; var ex:Number = 5; this.gotoAndStop(4); } onClipEvent (enterFrame) { grav++; _y += grav; while (_root.ground.hitTest(_x, _y, true)) { djump = false; tjump = false; _y--; grav = 0; } if (_root.water.hitTest(_x, _y, true)) { grav *= slow*1.25; speed = slowspd; } else { speed = setspeed; } if (Key.isDown(Key.RIGHT)) { _x += speed; _xscale = scale; if (_root.ground.hitTest(_x, _y+3, true)) { this.gotoAndStop(2); } else { if (djump == false) { this.gotoAndStop(4); } else if (tjump == false) { this.gotoAndStop(4); } else { this.gotoAndStop(4); } } if (Key.isDown(65)) { this.gotoAndStop (3) } } else if (Key.isDown(Key.LEFT)) { _x -= speed; _xscale = -scale; if (_root.ground.hitTest(_x, _y+3, true)) { this.gotoAndStop(2); } else { if (djump == false) { this.gotoAndStop(4); } else if (tjump == false) { this.gotoAndStop(4); } else { this.gotoAndStop(4); } } } else { if (_root.ground.hitTest(_x, _y+3, true) && !Key.isDown(68) && !Key.isDown(83)) { this.gotoAndStop(1); } } if (Key.isDown(83) && !Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT) && !Key.isDown(Key.UP) && !Key.isDown(68) && _root.ground.hitTest(_x, _y+3, true) && _currentframe != 6) { this.gotoAndStop(7); } else if (Key.isDown(83) && grav>1) { this.gotoAndStop(6); } if (Key.isDown(Key.UP) && _root.ground.hitTest(_x, _y+3, true)) { grav = -jumpHeight; _y -= 4; this.gotoAndStop(4); } else if (Key.isDown(Key.UP) && djump == false && grav>0 && tjump == false) { grav = -dbl; djump = true; this.gotoAndStop(4); } else if (Key.isDown(68) && tjump == false && grav>1) { this.gotoAndStop(3); } if (_root.ground.hitTest(_x+(_width/2)+ex, _y-(_height/2), true) || _root.ground.hitTest(_x+(_width/2)+ex, _y-(_height/6), true) || _root.ground.hitTest(_x+(_width/2)+ex, _y-_height, true)) { _x -= speed; } if (_root.ground.hitTest(_x-(_width/2)-ex, _y-(_height/2), true) || _root.ground.hitTest(_x-(_width/2)-ex, _y-(_height/6), true) || _root.ground.hitTest(_x-(_width/2)-ex, _y-_height, true)) { _x += speed; } if (_root.ground.hitTest(_x, _y-_height-15, true)) { grav = 1; } } Right, guy I know you can add text to a textbox with AS, simple stuff, but Is there anyway I Can do that, without deleting the previous text there until a certain cut off point (so after about 10 lines, the first line disappears for the next line to appear) I'm trying to make a flash chat app so any help is appreciated.
|
|
|
|