1 Reply Latest reply on Nov 5, 2012 4:59 AM by dhosford

    Play Animation

    Aiesyaah

      I want to play the animation from the stage. I used this -> sym.play("complete");
      to call the animation.
      "complete" refers to the label which I put in the timeline. I do not know why this does not work. The animation will not play. Usually the animations will work fine when I used that set of codes to call for it.

       

      I have also tried this set of codes -> sym.getSymbol("tower_sym").play("fade-in");
      : this is because, the animation is actually the tower_sym, and it will play accordingly at the "complete" mark in the animation.

       

       

      These are a portion of my codes.

       

      //BOX FOR RIVET

       

                                  }else if(_this.name=="box-for-rivet"){

                                              //console.log("drag :"+model.get("draggedRivet")+" heated: "+model.get("heatedRivet")+" dropped: "+model.get("droppedRivet"));

                                              if(item==="rivet"&&rivetHeated==true){

                                                        //console.log("hahaha4");

                                                        controller.setRivetPlaced(true);

                                                        sym.getComposition().getStage().getSymbol("down-arrow").play("st and-still");

                                                        if(rivetHeadHeated==false){

                                                                  sym.getComposition().getStage().getSymbol("flame-arrow").pl ay("indicate-burn");

                                                        }else if(rivetHeadPlaced==false){

                                                                  sym.getComposition().getStage().getSymbol("up-arrow").play( "indicate-up");

                                                        }else{          //both heated and placed

                                                                  sym.$("datadiv").data("progress","done");

                                                                  sym.getComposition().getStage().getSymbol("flame-arrow").pl ay("disappear");

                                                                  sym.getComposition().getStage().getSymbol("box").play("disa ppear");

                                                                  sym.getComposition().getStage().getSymbol("box-for-rivet"). play("disappear");

                                                                  sym.getComposition().getStage().getSymbol("box-for-head").p lay("disappear");

                                                                  sym.getComposition().getStage().getSymbol("down-arrow").pla y("indicate-press");

                                                                  sym.$("rivet").draggable( "option", "disabled", true );

                                                                  sym.$("rivet-head").draggable( "option", "disabled", true );

       

      //PLAY THE TOWER ANIMATION - i want the tower animation to play here

      sym.getComposition().getStage().getSymbol("tower").play();

       

       

                                                        } //end of BOX FOR RIVET

       

       

                                                        sym.$("rivet").css({top:-170,left:-180});

                                              }else if(item==="rivet-head"&&rivetHeadHeated===true){

                                                        sym.getComposition().getStage().getSymbol("up-arrow").play("indi cate-up");

                                              }else if(rivetHeated==false||rivetHeadHeated==false){

                                                        sym.getComposition().getStage().getSymbol("flame-arrow").play("i ndicate-burn");

       

       

                                              }

       

       

       

                //BOX FOR RIVET HEAD: EDIT CURSOR POSITION HERE

                              }else if(_this.name=="box-for-head"){

       

       

                          if(item==="rivet-head"&&rivetHeadHeated==true){

       

                                                        controller.setRivetHeadPlaced(true);

                                                        sym.getComposition().getStage().getSymbol("up-arrow").play("stan d-still");

                                                        if(rivetHeated==false){

                                                                  sym.getComposition().getStage().getSymbol("flame-arrow").pl ay("indicate-burn");

                                                        }else if(rivetPlaced==false){

                                                                  sym.getComposition().getStage().getSymbol("down-arrow").pla y("indicate-down");

       

       

                                                        }else{          //both heated and placed

                                                                  sym.$("datadiv").data("progress","done");

                                                                  sym.getComposition().getStage().getSymbol("flame-arrow").pl ay("disappear");

                                                                  sym.getComposition().getStage().getSymbol("box").play("disa ppear");

                                                                  sym.getComposition().getStage().getSymbol("box-for-rivet"). play("disappear");

                                                                  sym.getComposition().getStage().getSymbol("box-for-head").p lay("disappear");

                                                                  sym.getComposition().getStage().getSymbol("down-arrow").pla y("indicate-press");

                                                                  sym.$("rivet").draggable( "option", "disabled", true );

                                                                  sym.$("rivet-head").draggable( "option", "disabled", true );

       

      //but the animation will only play here, but it will gove me other errors then. Like displaying text overlays on click reset.

       

       

                                                        sym.$("rivet-head").css({top:210,left:250});

                                              }else if(item==="rivet"&&rivetHeated===true){

                                                        sym.getComposition().getStage().getSymbol("down-arrow").play("in dicate-down");

       

       

                                              }else if(rivetHeated==false||rivetHeadHeated==false){

                                                        sym.getComposition().getStage().getSymbol("flame-arrow").play("i ndicate-burn");

       

       

                                  }

       

       

      }//end of box for rivet head

       

       

       

       

       

      Does anyone ever encounter this kind of error?

       

      Thank you.