Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 19th, 2004, 04:53 PM
ahaller ahaller is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 55 ahaller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 18 sec
Reputation Power: 5
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();
}
}

Reply With Quote
  #2  
Old February 19th, 2004, 06:20 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
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;
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old February 24th, 2004, 07:21 AM
ahaller ahaller is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 55 ahaller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 18 sec
Reputation Power: 5
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.

Reply With Quote
  #4  
Old February 24th, 2004, 07:32 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, sorry one of my more famous "slow" moments :¬) try this out:

_root["container"+copy]._y += (50 * copy);

Reply With Quote
  #5  
Old February 25th, 2004, 02:00 PM
ahaller ahaller is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 55 ahaller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 18 sec
Reputation Power: 5
It works! thanks a bunch.

Andrew

Reply With Quote
  #6  
Old February 25th, 2004, 02:21 PM
ahaller ahaller is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 55 ahaller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 18 sec
Reputation Power: 5
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.

Reply With Quote
  #7  
Old February 26th, 2004, 02:37 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, try this:

this._parent.removeMovieClip();

Reply With Quote
  #8  
Old February 26th, 2004, 07:50 AM
ahaller ahaller is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 55 ahaller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 28 m 18 sec
Reputation Power: 5
awesome! thanks for your help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > duplicating a movie clip


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway