dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Why do my MC's not go directly to their new position?

  1. #1
    Member
    Join Date
    Sep 2005
    Posts
    62

    [RESOLVED] Why do my MC's not go directly to their new position?

    I have 4 mc's (rectangles).
    When one of them is clicked the other three have to move to another place (either top left, top right, bottom left or bottom right, depending which of the rectangles is clicked)

    I have this code for each of the rectangles:

    Code:
    MC.onRelease = function () {
    new Tween(references_mc, "_x", Elastic.easeOut, 0, 778, 2, true);
    new Tween(references_mc, "_y", Elastic.easeOut, 0, 393, 2, true);
    
    new Tween(CH, "_x", Elastic.easeOut, 0, 778, 2, true);
    new Tween(CH, "_y", Elastic.easeOut, 0, 317, 2, true);
    
    new Tween(parcours_mc, "_x", Elastic.easeOut, 0, 701, 2, true);
    new Tween(parcours_mc, "_y", Elastic.easeOut, 0, 393, 2, true);
    Now my problem is: The rectangles do not always take the direct way to their new position. Sometimes they go for example first to the top and then to the left instead of going diagonally.

    See here: http://www.change-over.fr

    Would anyone know why?

    Thanks!

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    For example, using this line of code:
    code:

    new Tween(references_mc, "_x", Elastic.easeOut, 0, 778, 2, true);


    you have 0 for initial position, and 778 for the final position.
    Instead of 0, you probably want ferences_mc._x.

    The same for all the others, except sometimes it's not _x, but _y.

  3. #3
    Member
    Join Date
    Sep 2005
    Posts
    62

    Thank you!

    Hi!

    Thank you! Works great !!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center