6 Replies Latest reply on Apr 13, 2010 9:25 AM by henry_ford

    Menu causing error 1034.

    henry_ford

      So I have an accordion menu  that has 5 panels, all move clips, click on one and it will slide to the right like a drawer. The issues is that I cannot get it it slide. I have the actionscript files sitting in the same location as my flash file. I get error #1034 Type Coercion failed.

       

      stop ();

       

      import gs.*;
      import gs.easing.*;

       

      pane1.props = {lx:0, rx:550, ind:1};
      pane2.props = {lx:30, rx:580, ind:2};
      pane3.props = {lx:60, rx:610, ind:3};
      pane4.props = {lx:90, rx:640, ind:4};
      pane5.props = {lx:120, rx:670, ind:5};

       

      pane1.addEventListener(MouseEvent.CLICK, onClick);
      pane2.addEventListener(MouseEvent.CLICK, onClick);
      pane3.addEventListener(MouseEvent.CLICK, onClick);
      pane4.addEventListener(MouseEvent.CLICK, onClick);
      pane5.addEventListener(MouseEvent.CLICK, onClick);

       

      function onClick(e:MouseEvent):void
      {
          var clicked:MovieClip = MovieClip(e.target);
          for(var i:int=0; i<numChildren; i++)
          {
              var mc:MovieClip = MovieClip(getChildAt(i));
              if(mc.props.ind <= clicked.props.ind)
                  TweenLite.to(mc, 1, {x:mc.props.lx, ease:Bounce.easeOut});
              else
                  TweenLite.to(mc, 1, {x:mc.props.rx, ease:Bounce.easeOut});
          }
      }