A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: AS2 - Tween class CENTER?

  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    49

    AS2 - Tween class CENTER?

    I'm familiar with using the Tween class...however, is there a "easy" way to center a mc using tween class...

    i know using:

    ..."_x", regular, 0, 20, 0, true)...

    will position the image to the X=20...however what is the best way to center the mc on the screen (horizantally) using tween class...

    not even sure if there is a way...thanks in advance

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    var myCenter:Number = (Stage.width - mc._width)/2;

    ..."_x", regular, 0, myCenter, 0, true)...

    gparis

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