# Dynamic duplication + calculation

**URL:** <https://forum.kirupa.com/t/dynamic-duplication-calculation/257118>\
**Category:** flash\
**Created:** [April 10, 2008, 12:38pm UTC](https://forum.kirupa.com/t/dynamic-duplication-calculation/257118 "2008-04-10T12:38:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [April 10, 2008, 12:38pm UTC](https://forum.kirupa.com/t/dynamic-duplication-calculation/257118/1 "2008-04-10T12:38:54Z")

</div>

I wanted to create a calculation script. Buts its not normal calculator.

1. The script would 1st randomize out the amount (15-150)
2. I will have 5 movie clip. Each represent an exact number. (1, 5, 10, 20, 50)
3. According to that 5 specific numbers, the area/movie clip will be duplicated in order to makes the amount of any of the 5 number, total up as the randomize amount.
4. The amount of the area duplicate would be 4-10

Exp:

I would 1st randomize out the amount: 124  
So in order to have either of that 5numbers total up as 124, It would duplicate out 7 area()

( )+( )+( )+( )+( )+( )+( )=124

Now from here I would drag in the 5 numbers given to sum up to 124

(50)+(50)+(20)+(1)+(1)+(1)+(1)=124

Any ideas or guide on how to do this?
