Menu

MoveOnPath

Help
Markus
2005-05-18
2013-04-01
  • Markus

    Markus - 2005-05-18

    I'm trying to integrate AnimationPackage into my project. Drawing CubicBezierPaths works great. I just wish that there would be a way to define a dash style.

    Unfortunately I'm having several problems with the MoveOnPath Class. Ether the endvalue isn't correct or the animation doesn't do anything. I'll try to create a test class which works outside my project in the evening. Perhaps it's a problem with my environment.

    Is it possible to create a path with mixed curve and line components? Adding a Move Class as a child doesn't seem to work.

    Thank you for you help!

     
    • Alex Uhlmann

      Alex Uhlmann - 2005-05-18

      to your dash style idea: That's feasible. At the moment you draw straight lines one after the other. You could of course leave spaces in between. In case you get to it, I suggest looking at how the parameters in the DashLine class work and apply them. Let me know if you actually take time on this. I don't have time for this at the moment.

      to MoveOnPath: Have you tried the newest version 1.06 Beta 1?
      http://www.alex-uhlmann.de/flash/animationpackage/unstable/

      It uses a new version of Ivan Dembicki's Path class, which is used my MoveOnPath.

      To your mixed curve: Have you checked the Drawer class?

      Alex

       
    • Markus

      Markus - 2005-05-20

      Hello Alex,
      Thank you for your quick response.

      dashed curves: This is not my priority at the moment, but if I have some time I'll have a look at it.

      1.06 Beta 1: This didn't solve my problem. I'm not sure what I'm doing wrong:

      // ICNavigationTrail class - I have a APCore.initialize(); call in the constructor
          public function getTrail(canvas:ICCanvas) {
              var object:Object = null;
              var trail:MoveOnPath = new MoveOnPath(canvas);
             
              var x:Number = canvas._aF.getX();
              var y:Number = canvas._aF.getY();
             
              for (var i:Number = 0; i < _components.length; i++) {
                  object = _components[i];
                  trail.addChild(new MoveOnCubicCurve(canvas, -x, -y, -x+1, -y+1, -object.x+1, -object.y+1, -object.x, -object.y));
                  trace(-x + " " + -y + " " +  -object.x + " " +  -object.y);

                  x = object.x;
                  y = object.y;
              }

              trail.orientToPath(false);
              return trail;
          }
      // this is the trace output:
      907 -817 547 -197
      547 -197 -598 -677
      -598 -677 188 -982
      188 -982 -965 -960

      // ICCanvas Class
      // animation package init
      APCore.initialize();
      _listener = new Object(); // _listener is a class var
      var owner:ICCanvas = this;
      _listener.onFinish = function(source, value) {
          owner.finished();
      }
      APCore.addListener(_listener);

      // this is where I start the animation
      var trail:MoveOnPath = _aT.getTrail(_controller._canvas);
      trail.animationStyle(8000,Sine.easeInOut,"onFinish");
      trail.animate(0, 100);

      mixed curve: I was thinking of something like this. This code doesn't work.
      var myMoveOnCubicCurve:MoveOnCubicCurve = new MoveOnCubicCurve(myRectangle.movieclip,400,100,100,0,100,100);
      var myMove:Move = new Move(myRectangle.movieclip,100,100,500,500);
                             
      var myMOP:MoveOnPath = new MoveOnPath(myRectangle.movieclip);
      myMOP.addChild(myMoveOnCubicCurve);
      myMOP.addChild(myMove);

       
    • Markus

      Markus - 2005-05-20

      Interesting, my code works when replacing

      trail.addChild(new MoveOnCubicCurve(canvas, -x, -y, -x+1, -y+1, -object.x+1, -object.y+1, -object.x, -object.y));

      with

      trail.addChild(new MoveOnQuadCurve(canvas, -x, -y, -x+1, -y+1, -object.x, -object.y));

      Does MoveOnPath support Move and MoveOnCubicCurve? I know I could take a look at the code, but it can be difficult to understand the code from someone else.

      I have an other question. I thought that QuadCurve and MoveOnQuadCurve don't use bezier control points by default. Why don't you set MoveOnQuadCurve to true in this example (MoveOnPath documentation):

      new QuadCurve(450,380,0,100,400,100,true).draw();
      var myMoveOnQuadCurve1:MoveOnQuadCurve = new MoveOnQuadCurve(mc,400,100,100,0,100,100);

      Thank you for you patience :)

       
    • Alex Uhlmann

      Alex Uhlmann - 2005-05-26

      Hi Markus,

      At the moment MoveOnPath only supports MoveOnQuadCurve as childs. Also, MoveOnPath treats all MoveOnQuadCurve childs with their control points. See MoveOnPath.invokeAnimation > child.useControlPoints(true);

      Therefore you don't need to set the withControlpoints parameter to true. Nevertheless, I should have done it in the example, for code clarity. Therefore, thanks for mentioning.

      I don't have time to look into your specific problem with MoveOnPath. You have to look into the source code for yourself. MoveOnPath is actually quite straight forward. The workhorse behind this is Ivan Dembicki's excellent Path class. Try to isolate the problem to Ivan's Path class. If it still occurs, tell Ivan about it. You can find information about Path here: http://www.dembicki.org/index-eng.html

      Best,
      Alex

       
    • Alex Uhlmann

      Alex Uhlmann - 2005-05-26

      and if you've problems with Ivan's Path class, make sure you've read his extensive tutorials.

      http://www.dembicki.org/path/index-eng.html

      Best,
      Alex

       

Log in to post a comment.