mikkom
05-20-2005, 03:49 AM
I have the following code:
var id = this.getNodeAttribute("id");
var x = this.getNodeAttribute("x");
var y = this.getNodeAttribute("y");
Debug.write('Move: '+canvas.screen[id]+" to x"+x+" y"+y);
canvas.screen[id].setX(x);
canvas.screen[id].setY(y);
<!--
canvas.screen[id].animate('x', 100, 1000, false, {motion: 'linear'});
canvas.screen[id].animate('y', 100, 1000, false, {motion: 'linear'});
-->
Everything works ok with setX and setY, the object moves to correct position.
With animate however, the object disappears from the screen and sets both x and y positions to some really strange values (like '1090-990NaN')
I even tried to change the x and y to constant values (100 as in above) and I still get same really strange results.
Is this a bug or don't I get something?
EDIT: Oh and the object is dynamically created with:
var c = new LzView(canvas.screen, {width: this.getNodeAttribute("width"),
height: this.getNodeAttribute("height"),
x: this.getNodeAttribute("x"),
y: this.getNodeAttribute("y"),
name: id,
bgcolor: this.getNodeAttribute("bgcolor")});
var id = this.getNodeAttribute("id");
var x = this.getNodeAttribute("x");
var y = this.getNodeAttribute("y");
Debug.write('Move: '+canvas.screen[id]+" to x"+x+" y"+y);
canvas.screen[id].setX(x);
canvas.screen[id].setY(y);
<!--
canvas.screen[id].animate('x', 100, 1000, false, {motion: 'linear'});
canvas.screen[id].animate('y', 100, 1000, false, {motion: 'linear'});
-->
Everything works ok with setX and setY, the object moves to correct position.
With animate however, the object disappears from the screen and sets both x and y positions to some really strange values (like '1090-990NaN')
I even tried to change the x and y to constant values (100 as in above) and I still get same really strange results.
Is this a bug or don't I get something?
EDIT: Oh and the object is dynamically created with:
var c = new LzView(canvas.screen, {width: this.getNodeAttribute("width"),
height: this.getNodeAttribute("height"),
x: this.getNodeAttribute("x"),
y: this.getNodeAttribute("y"),
name: id,
bgcolor: this.getNodeAttribute("bgcolor")});