|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
duplicating a movie clip
i have a movie clip that a user can duplicate by pressing a button. i want the new duplicated movie clip's ._y attribute to be 50 pixels offset. the first duplicate i make is offset, but all the others just duplicate in the same place.
cna someone please tell me what i'm doing wrong and how to get each new movie clip to be offset from the previous one here is my code: // initial container name is "container0" copy=0; apply_drag(copy); //copy button _root.more.onRelease=function() { duplicate_container(); } //duplication functionality function duplicate_container() { copy++; container0.duplicateMovieClip("container"+copy,copy); _root["container"+copy]._y+=50; apply_drag(copy); } //dragging function apply_drag(copy) { _root["container"+copy].frame.onPress=function() { _root["container"+copy].startDrag(false); } _root["container"+copy].frame.onRelease=function() { _root["container"+copy].stopDrag(); } } |
|
#2
|
|||
|
|||
|
Hi, what your doing is saying _y = 50...well theres a bit more to it but in this case that explanation will do :¬) try this out:
_root["container"+copy]._y = _root["container"+copy]._y + 50; |
|
#3
|
|||
|
|||
|
thanks for the help, but this doesn't seem to work.
a=a+50 is essentially a+=50. i appreciate you taking the time to answer, though. |
|
#4
|
|||
|
|||
|
Hi, sorry one of my more famous "slow" moments :¬) try this out:
_root["container"+copy]._y += (50 * copy); |
|
#5
|
|||
|
|||
|
It works! thanks a bunch.
Andrew |
|
#6
|
|||
|
|||
|
heres the reall tricky question.
i've been thinking about how i should do this, but nothing brilliant seems to come to mind. now that i have a potential for numerous movie clips (i will refer to them as boxes) how can i close a specific one by clicking a close button i created on the box. this is what i have, but i don't understand why it wouldn't work. function close_container() { for(c=0;c<=copy;c++) { _root["container"+c].closeBox.onRelease=function() { _root["container"+c].removeMovieClip(); } } } thanks Last edited by ahaller : February 25th, 2004 at 02:33 PM. |
|
#7
|
|||
|
|||
|
Hi, try this:
this._parent.removeMovieClip(); |
|
#8
|
|||
|
|||
|
awesome! thanks for your help.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > duplicating a movie clip |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|