A Flash Developer Resource Site

1. ## Mathematics +preloader

I just don't get it.

I have this preloader where I get % loaded (start: 0 completed: 100%)
Now I need to move a movieclip _x cordinate from _x 65 to 200

How can I move the clip based on percent loaded?
eg.
start: 0% mc._x = 65
end: 100% mc._x = 200

best regards T

2. When you want something to go from a to b as a percentage goes from 0 to 100, the basic formula is:

x = a + (percentage/100) * (b-a);

So your example would be:

mc._x = 65 + (percentLoaded/100) * (200-65);

which can be reduced to:

mc._x = 65 + (percentLoaded*(200-65))/100;

mc._x = 65 + percentLoaded*135/100;

mc._x = 65 + percentLoaded*1.35;

3. ## Thanks

Thanks for helping jbum, I got the same formula from a person at the Macromedia Forums

Thanks again,

best regards T

#### Posting Permissions

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

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap

Click Here to Expand Forum to Full Width