Moving border

hello i got 2 qns

1)i want to make the border of the frame that houses a picture move. like the line that frames the picture, i want to make it expand from a dot to a full line… like making it flash across. the thing is i can do it by using frame and erasing alittle bits of the line on each frame but i was wondering if there is a code behind it to make it more professional looking.

  1. i tried the movement code

onClipEvent(enterFrame) {
speed = 10;
this._x += speed

and i was wondering how do u end it? the movieclip which i apply the code to keeps moving.

If you want it to expand you want to use _width not _x so you’ll get:

onClipEvent (enterFrame) {
speed = 10;
if (_width >= maxWidth) {
speed = 0;
} else {
_width += speed;