Đang Thực Hiện

327365 onEnterFrame problem

Hi, experts

I have one question. I have the following code that take a lot CPU usage and make computer runs hot. I wonder if there is better code to have better performance

Code:

var myConstant = 2;

var myConstant2 = 4;

var half = [url removed, login to view];

var multiplier;

var rotatex;

function moveMe(speed) {

bg._x += (speed*multiplier)/myConstant;

if (bg._x>0) {

bg._x = -1937;

}

if (bg._x<-1937) {

bg._x =0;

}

//

bg2._x += (speed*multiplier)/myConstant2;

if (bg2._x>0) {

bg2._x = -1781;

}

if (bg2._x<-1781) {

bg2._x =0;

}

}

function callback() {

// Background movement

if (_root._xmouse>1100) {

multiplier = -1;

} else if (_root._xmouse<400) {

multiplier = 1;

rotatex = 1

} else {

//multiplier = -1;

//rotatex = -1

}

buttons.hp.pattern._rotation -= rotatex;

moveMe(2)

//clearInterval( intervalID );

}

var intervalID;

intervalID = setInterval( callback, 100 );

Kĩ năng: Adobe Flash, Bất kì công việc gì

Xem nhiều hơn: cpu 100, performance problem, background pattern, speed movement, cpu usage, cpu performance, question computer, flash background 100 100, callback, flash var problem

Về Bên Thuê:
( 31 nhận xét ) San Francisco, United States

ID dự án: #2073172