8 Replies Latest reply on Jun 11, 2009 7:39 PM by FlashTapper

    Checking for 2 conditions in an "if/then" statement - HELP!

    FlashTapper Level 1



      I've created a simple drag n drop activitiy but there is a small problem. There is a repeat of a word within the activity (the words are the drag objects). Now I want the user to be able to drag the first instance of the word onto either drop target when it first appears. When the second instance appears I have told the expression to look to confirm the location of the first instance of the word (which target it sits within) and make the word snap back if the user drags the word onto a drop target where the first instance already sits - and allow it to snap to the drop target where the first instance does not appear. (I HOPE THIS MAKES SOME SENSE) - if it does not make sense, I have cut and paste the script below:



      on(press) {
      var startx = this._x;
      var starty = this._y;


      on(release) {
      if (eval ((this._droptarget) == _root.target4) &&  _root.drag15._x != 31;) {
        this._x = 439.1;
        this._y = 285.9;
        _global.totalCorrect ++


      }else if (eval ((this._droptarget) == _root.target3) &&  _root.drag15._x != 439.1;) {
        this._x = 31;
        this._y = 349;
        _global.totalCorrect ++


      } else {
        this._x = startx;
        this._y = starty;




      I seem to be having some real issues with the placement of brackets....and I'm really bad at mathematics. Can anyone offer any suggestions?