some TIMes (Work in progress) Hi everyone. I have written a TIMe that I needed and thought I could share it with you. I have not really -*test*-('")ed it, but it seems to work.
When a character is disabled, I needed some way to make the room scroll automatically when the cursor reaches one of the rooms corners.
see it in action:
http://server2.hostpoint.ch/~novamvia/philip/scrollExample/
//TIMe to enable a scrollable room
_root.TIMe.enablescroll = function(){
_root.room.onEnterFrame = function(){
var radius = 80; //How close on screen edges will be the action triggered
var speed = 30; //pixels per frame movement
if(_root._xmouse > Stage.width - radius && _root.room._x-speed >= -_root.room.bg_mc._width+Stage.width){//&& _root.room._x <= 0 && _root.room._x >= -_root.room.bg_img._width+Stage.width
_root.TIMe.setCursorDisplay(null,null,3);
_root.room._x = _root.room._x-speed;
this.updated = false;
}else if(_root._xmouse < radius && _root.room._x+speed <= 0){
_root.TIMe.setCursorDisplay(null,null,7);
_root.room._x = _root.room._x+speed;
this.updated = false;
}else{
_root.room.nachrichten.img_mc.textField.text = updated;
if(this.updated == false){
this.updated = true;
_root.TIMe.setCursorDisplay(null,null,-1)
}
}
}
}
Just put it into the first frame of _data.fla in your library/system folder and use it as the room enter action: autoscroll().
You could of course expand it to scroll up and down as well. I don't need it. But if somebody does, just drop a line.
JohnGreenArt- 09-03-2007
Awesome!
bigmac- 09-03-2007
Nicely done!! Handy little script.
From an optimization standpoint, the only thing that I might suggest would be to use an onMouseMove as a status messenger to enable and disable the EnterFrame.
phwhitfield- 09-06-2007
From an optimization standpoint, the only thing that I might suggest would be to use an onMouseMove as a status messenger to enable and disable the EnterFrame.
Yes you are absolutely right about that. If anyone needs this script in a production, I'd rewrite it. then I should also implement that the Inventory is ignored. But right now I don't have the time. Thank you
Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.