To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-11-2004, 05:09 PM   #1
spiderLab
Member
 
Join Date: May 2004
Posts: 47
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

can anyone please help me out

thanks in advance,
best regards T
spiderLab is offline   Reply With Quote
Old 10-11-2004, 06:01 PM   #2
jbum
Senior Member
 
jbum's Avatar
 
Join Date: Feb 2004
Location: Los Angeles
Posts: 2,920
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;
__________________
jbum is offline   Reply With Quote
Old 10-11-2004, 06:20 PM   #3
spiderLab
Member
 
Join Date: May 2004
Posts: 47
Thanks

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

Thanks again,

best regards T
spiderLab is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:17 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.