-1
stop();
speed = 10;
initial_width = 75;
target_width = 450;
sp = rect1._x;
this.createEmptyMovieClip("emptymc", 0);
emptymc.onEnterFrame = function() {
for (i=1; i<=6; i++) {
if (_root.hit.hitTest(_root._xmouse, _root._ymouse, true)) {
if (_root["rect"+i].hitTest(_root._xmouse, _root._ymouse, true)) {
new_x = (_root.sp-(75*(i-1)))-rect1._x;
rect1._x += new_x/speed;
n_width = target_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width/speed;
} else {
n_width2 = initial_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width2/speed;
}
} else {
new_x = _root.sp-rect1._x;
rect1._x += new_x/(speed+50);
n_width2 = initial_width-_root["rect"+i]._width;
_root["rect"+i]._width += n_width2/(speed-1);
}
_root["rect"+(i+1)]._x = _root["rect"+i]._x+_root["rect"+i]._width;
_root["movie"+i]._x = _root["rect"+i]._x-1;
}
};
감사합니다. AS3으로 변환하려고하면 모든 것이 좋은 것처럼 보입니다. 사소한 버그가 있지만 아직 찾아 내서 불편을 끼쳐 드려 죄송합니다. :(코드를 AS2에서 AS3으로 변환해야합니다.
다시 감사드립니다. :).
해당 코드를 마이그레이션하는 데 필요한 모든 정보가 여기에 있어야합니다. http://www.adobe.com/devnet/flash/articles/first_as3_application.html 행운을 빕니다! 문제가있을 경우 질문을 업데이트하십시오. –
친애하는 Jonatan Hedborg! 먼저, 대단히 감사합니다. 하지만 방금 Flash로 시작했는데 내일 과제를 제출해야합니다. 이제이 코드를 as3 코드로 번역 해 주시겠습니까? 나는 정말로 감사 할 것이다! :( –
우리는 프로그램을 작성하거나 코드를 번역 할 수 없게 될지도 모릅니다 ... 훨씬 더 구체적인 것에 집착 할 때 여기 저기서만 기능을 수행 할 수 있습니다. 미안하지만, 문제가 생겼을 때 우리에게 먼저 알려 주어야 할 심각한 시도를해야합니다. – Panzercrisis