3 Replies Latest reply on Sep 29, 2011 5:33 PM by Ron Colmen

    ._parent._name.indexOf("mymain")

    Ron Colmen Level 2

      The existing code: The structure of 2 movieclips (_root.mymainA_mc.lxP_mc   and  _root.mymainB_mc.lxT_mc)

       

      items are dragged in to the above mentioned 2 movieclips. For both movieclips, the droptarget is controlled by a single code.

       

      this._parent.stopDrag();

              if(eval(this._parent._droptarget)._parent._name.indexOf("lx")==0 || eval(this._parent._droptarget)._name.indexOf("lx")==0 || eval(this._parent._droptarget)._parent._name.indexOf("mymain")==0 || eval(this._parent._droptarget)._name.indexOf("mymain")==0){

                  if(tf_mc._parent==tl){

                     var mc:MovieClip = eval(this._parent._droptarget)._parent; \\  if the above condition is true, drop only to either mymainA_mc or to mymainB_mc  (not inside lxP_mc or lxT_mc)

       

      I want the user to be allowed to drop items in to any area within mymainA_mc or mymainB_mc regardless if it's drop onto lxP_mc or lxT_mc. But when it's dropped, I want the item to always be in mymainA_mc or mymainB_mc and not in lxP_mc or lxT_mc. Hope this makes sense.

       

      Basically anything dropped on to the droptarget (mymainA_mc or mymainB_mc) should be inside mymainA_mc or mymainB_mc.

       

      The above code works except for the droptarget always being mymainA_mc or mymainB_mc.

       

      Message was edited by: Ron Colmen