A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: [MX] custom cursor with errors

Threaded View

  1. #1
    astridatflash
    Join Date
    Aug 2002
    Posts
    12

    [MX] custom cursor with errors

    Hi - with the help of tutorials, I have been able to create a custom cursor. My file has two areas "areaLeft" and "areaRight". These should eventually be buttons that scroll images. When mousing over each area the cursor is supposed to be replaced by a left or right arrow (see http://www.fluidesign.com/fluid.html.....work....click on any project)

    Now, the left area is (almost) working, but when mousing over the right area, the cursor doesn't get replaced. The arrow is attached, but the cursor still visible. The cursor also doesn't disappear when outside of either area (which it should and does when I delete the right area).

    Also, when moving fast from left to right the output error " Error: A 'with' action failed because the specified object did not exist." comes up.

    Since I'm not an action scripter and don't understand enough about the code - and even though am glad got that far - I can't figure out how two solve these three issues.

    1) arrrow is supposed to disappear when outside of areas
    2) on right area: cursor should be invisible / replaced by arrow
    2) Error: A!?

    Help would be greatly appreciated. Thanks!!!

    Here the code (I am also attaching the file).

    areaLeft.onMouseMove = function() {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    if (!isAttached) {
    Mouse.hide();
    _root.attachMovie("cursorLeft", "cursorLeft", 1);
    isAttached = true;
    updateAfterEvent;
    }
    with (cursorLeft) {
    _x = _root._xmouse;
    _y = _root._ymouse;
    updateAfterEvent;
    }
    } else {
    if (isAttached) {
    Mouse.show();
    cursorLeft.removeMovieClip();
    isAttached = false;
    updateAfterEvent;
    }
    }
    };
    areaRight.onMouseMove = function() {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    if (!isAttached) {
    Mouse.hide();
    _root.attachMovie("cursorRight", "cursorRight", 1);
    isAttached = true;
    updateAfterEvent;
    }
    with (cursorRight) {
    _x = _root._xmouse;
    _y = _root._ymouse;
    updateAfterEvent;
    }
    } else {
    if (isAttached) {
    Mouse.show();
    cursorRight.removeMovieClip();
    isAttached = false;
    updateAfterEvent;
    }
    }
    };
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center