Note that there are some explanatory texts on larger screens.

plurals
  1. PONested Movie Clip Timeline wont work (Depth/targets) in Flash AS2
    primarykey
    data
    text
    <p>My code works fine when all mc are placed on the main time-line(stage) However when I import them into a single Movie Clip called <strong>Container_Mc</strong> the code stops working. I'm sure it has to do with the target/depth</p> <p>Here is the code that works on the time-line</p> <pre><code> stop (); first = 1; import mx.transitions.Tween; import mx.transitions.easing.*; function dragSetup(clip, targ) { clip.onPress = function() { startDrag(this); }; clip.onRelease = clip.onReleaseOutside=function () { stopDrag(); if (eval(this._droptarget) == targ) { var tx:Tween=new Tween(this,'_x',Elastic.easeOut,this._x,this.myFinalX,1,true); var ty:Tween=new Tween(this,'_y',Elastic.easeOut,this._y,this.myFinalY,1,true); targ.gotoAndStop(2); } else { var tx:Tween=new Tween(this,'_x',Elastic.easeOut,this._x,this.myHomeX,1,true); var ty:Tween=new Tween(this,'_y',Elastic.easeOut,this._y,this.myHomeY,1,true); targ.gotoAndStop(2); } }; //the variables below will store the clips starting position clip.myHomeX = clip._x; clip.myHomeY = clip._y; //the variables below will store the clips end position clip.myFinalX = targ._x; clip.myFinalY = targ._y; } dragSetup(drag1,target1) dragSetup(drag2,target2) dragSetup(drag3,target3) btn.onRelease = function() { if ((_root.drag1._droptarget == "/target1") &amp;&amp; (_root.drag2._droptarget == "/target2") &amp;&amp; (_root.drag3._droptarget == "/target3")) { if (first == 1) { first = 0; result += } comment = "Great! correct answer"; _root.attachMovie("glamour", "glamour2", 202); _root.glamour2._x = 226; _root.glamour2._y = 153; } else { comment = "try again!!"; first = 0; } } </code></pre> <p>Im pretty sure the problem lies in the <strong>IF STATMENT</strong> in the <strong>BTN FUNCTION</strong> because the rest of the code above works fine when imported inside <strong>Container_Mc</strong> its just the if statement the else "Try Again" Answer is just returned even though the targets are right??</p> <p>Anyone any Ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload