# Flash 5 drag/getproperty/random

**URL:** <https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945>\
**Category:** Uncategorized\
**Created:** [June 24, 2003, 4:50pm UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945 "2003-06-24T16:50:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![OhSuzie](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@OhSuzie](https://forum.kirupa.com/u/OhSuzie)\
**Post date:** [June 24, 2003, 4:50pm UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945/1 "2003-06-24T16:50:51Z")

</div>

Ok. I am making a website: left hand side= color samples.  
RHS= 40 polka dots to make your own design.

click on the color samples and they setRGB the dots. I got that part.

The dots however have to be individually draggable. The dots currently are instances of one movie clip. They don’t drag individually. They drag as a group!  
Furthermore, I want to make a scramble function using Math.random, so when you press a button the polka dots arrange in a random pattern AND change colors from a ten color-sample spectrum.

I have individual bits of code but nothing works in conjunction with each other.

Should I just make a basket of lots of dots for each color sample so the user can individually drag them out and create his design, instead of having a set number of dots? What the hell should I do. Anyone with help would be saving my arse.

Another problem–lets say the user creates a design with the dots and wants exactly those colors he’s chosen? How do I retrieve the properties and load them for my viewing?  
🔗

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 24, 2003, 6:21pm UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945/2 "2003-06-24T18:21:34Z")

</div>

Try duplicating the polka dot mc and giving it a new mc and setting \_x and \_y respectivley.Then i think it should work

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 24, 2003, 7:47pm UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945/3 "2003-06-24T19:47:33Z")

</div>

Thanks for your reply.

What I want to know is—do the dots have to be named individually?

If I duplicate mc how do I get them to drag AND change color?

Sorry-----!  
Suzie

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 25, 2003, 5:56am UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945/4 "2003-06-25T05:56:33Z")

</div>

first make just ONE polka dot mc. Inside it put an invisible mc which covers the entire polkadot with object actions-

onClipEvent(MouseDown){  
\_parent.startDrag()

}

i think that should work, or something like that. I haven’t tested it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 25, 2003, 11:27am UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945/5 "2003-06-25T11:27:09Z")

</div>

Juse a button, much easier.  
on(press){  
startDrag(this);  
}  
on(release){  
stopDrag();  
}

Or you could hang this on the polka mc straightaway (don’t know if it will work though in Flash 5):

on(press){  
startDrag(this);  
}  
on(release){  
stopDrag();  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 25, 2003, 2:51pm UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945/6 "2003-06-25T14:51:50Z")

</div>

Ok—I already got the dragging part, figured out I couldn’t do it with onClipEvent, had to put buttons in the mc’s. But question–where do I hang the Duplicate mc code, AND how do I get the dots to change color according to a 10 color spectrum? Let’s say I have 24 dots and they could randomly be any set of 10 colors. I looked at the random color tutorial but this has a completely random spectrum–I just need it to be limited to 10 colors.

THANK YOU anyone who takes the time to figure this bs out.  
Suzie

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 25, 2003, 3:02pm UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945/7 "2003-06-25T15:02:09Z")

</div>

Put ur 10 predefined colors in an array say colArr[] the do random(10) to randomly select the element so

colArr=new Array();  
colArr[0]=color1…  
…

setRGB(colArr[random(10)]);

would this do the trick?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 25, 2003, 3:50pm UTC](https://forum.kirupa.com/t/flash-5-drag-getproperty-random/23945/8 "2003-06-25T15:50:12Z")

</div>

Ok, does the new array go onto the main timeline or onto the polka dots or onto the button that duplicates the polka dots? I am confused. Sorry.

plus, the duplicate mc code is just not working for me. I am putting it on the dot, enterFrame it should duplicate. AND it should become draggable, but that’s not happening either. I have no idea what I’m doing wrong. I tried putting hte code on the main timeline, changing the mc’s to buttons, etc, but nothing seems to work. ARGH.
