Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would do it this way: every time you drop an element you store this event somewhere and you check if all the elements are dropped. For example:</p> <pre><code>// Initial state: not dropped sym.setVariable("dropped", "false"); sym.$('scrambled_target').droppable({ accept:sym.$("scrambled_egg"), drop: function () { sym.getSymbol("scrambled_egg").play(); // Store that you dropped it sym.setVariable("dropped", "true"); // Call a function to check if all the symbols are dropped // and fire event "done" checkIfAllDropped(); } } ); sym.$('scrambled_default').droppable({ accept:sym.$("scrambled_egg"), drop: function () { // Back to not dropped state // EDIT HERE! Dind't get that sym was your stage. // AND EDIT EVERYWHERE ELSE. sym.getSymbol("scrambled_egg").setVariable("dropped", "false"); } } ); </code></pre> <p>The checkIfAllDropped() function will look something like this:</p> <pre><code>checkIfAllDropped = function(){ var stage = AdobeEdge.getComposition("COMPOSITION_CLASS_NAME").getStage(); var sym1 = stage.getSymbol("sym1"); var sym2 = stage.getSymbol("sym2"); if(sym1.getVariable("dropped") === "true" &amp;&amp; sym2.getVariable("dropped") === "true"){ // Fire event done! stage.play("done"); } }; </code></pre> <p>Be careful on your checkIfAllDropped function you are assigning var sym2 multiple times.</p> <pre><code>checkIfAllDropped = function(){ var stage = AdobeEdge.getComposition("How_do_you_eat_yours").getStage(); var sym1 = stage.getSymbol("scrambled_target"); // Here... var sym2 = stage.getSymbol("fried_target"); // Here... var sym2 = stage.getSymbol("boiled_target"); // Here... var sym2 = stage.getSymbol("poached_target"); if(sym1.getVariable("dropped") === "true" &amp;&amp; sym2.getVariable("dropped") === "true" &amp;&amp; sym3.getVariable("dropped") === "true" &amp;&amp; sym4.getVariable("dropped") === "true"){ // Fire event done! stage.play("welldone"); } }; </code></pre> <p>Please debug your code before posting it again!</p>
 

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