6 Replies Latest reply on Apr 23, 2012 4:01 PM by nickkapiten

    help! I cant get my remove event listener to work?

    super waffle

      so i made a tween the on rollover plays out a tween i treyed the code below but it does not work, i need to remove the event listener once it is rolled over once but it gives me an error that says

       

      Symbol 'pictures_mc',Layer 'actions', frame2, Line19 1067 :Implict coercion of a value of type.transitions:Tween to an to an unrelated type Function.

       

      I have no idea what this means but i know its about the remove event listener in the code below.

       

      import flash.events.MouseEvent;

      import fl.transitions.Tween;

      import fl.transitions.easing.*;

      import fl.transitions.TweenEvent;

       

      stop();

       

       

      var myTween:Tween = new Tween(sidebar, "x", None.easeIn, 0, -40, 1, false);

       

       

      sidebar.addEventListener(MouseEvent.MOUSE_OVER,showsidebar)

       

       

      function showsidebar(evtobj:MouseEvent){

       

                var Sidebartween:Tween = new Tween(sidebar, "x", None.easeIn, 0, -100, 1, false);

                sidebar.addEventListener(TweenEvent.MOTION_FINISH,deletearrow);

                function deletearrow(evtObj:TweenEvent){

                          delete(sidebar.arrow_mc)

                }

                stage.removeEventListener(TweenEvent.MOTION_START,Sidebartween);

      }

       

      like i said i need to remove the event listener because when i roll over it the tween just keeps playing if i dont can anyone help?