A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: combining across and down for crossword

  1. #1
    Junior Member
    Join Date
    Sep 2005
    Location
    Scotland
    Posts
    7

    combining across and down for crossword

    Hi
    Need bit of help with combining across and down for crossword. The across is 3 text boxes, first of which is movieclip, actvated when clicked. As type, curser jumps to next box. Works great.

    onClipEvent (enterFrame) {
    var a1 = this.let1_ins.text;
    var a2 = _root.let2_ins.text;
    aListener = new Object();
    aListener.onKeyUp = function() {
    //if box got letter in it (not empty)
    if (a1 !== "") {
    //jump to next box
    Selection.setFocus("_root.let2_ins");
    }
    if (a2 !== "") {
    Selection.setFocus("_root.let3_ins");
    //else, stay in this box
    } else {
    Selection.setFocus("this.let1_ins");
    }
    };
    Key.addListener(aListener);
    }

    The down one is similar, but with 4 boxes. Again, works great.

    onClipEvent (enterFrame) {
    var d1 = this.d1let1_ins.text;
    var d2 = _root.d1let2_ins.text;
    var d3 = _root.d1let3_ins.text;
    var d4 = _root.d1let4_ins.text;
    dListener = new Object();
    dListener.onKeyUp = function() {
    if (d1 !== "") {
    Selection.setFocus("_root.d1let2_ins");
    }
    if (d2 !== "") {
    Selection.setFocus("_root.d1let3_ins");
    }
    if (d3 !== "") {
    Selection.setFocus("_root.d1let4_ins");
    } else {
    selection.setFocus("this.d1let1_ins");
    }
    };
    Key.addListener(dListener);
    }

    I'm having problems combining them, with the first down letter in the middle of across (forming a T-shape). When typing across, the letters jump across the down mc. When typing down, the 3rd letter across fills in. Can anyone help please?
    Many thanks .
    Last edited by zubaran; 01-12-2006 at 08:12 AM.

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