A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Simple: Drag and duplicate MC

Hybrid View

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Location
    Copenhagen
    Posts
    228

    [F8] Simple: Drag and duplicate MC

    Hi

    Heres probably a simple one: I've got three buttons, wich I each assign an onPress function: I want to drag the MC/BTN and when this MC is dragged from it's position, a new MC is copied and placed in where the old MC where placed before it was dragged. This new MC has the exact same function attached, wich means, that you can copy and drag as many of this MC as you wish. Can anyone tell me, what I'm doing wrong?

    Code:
    for(var i:Number = 0; i < 3; i++){
    	MyMovieClip_int = this["test_mc_" + i]._name.substr(8)
    	this["test_mc_" + i].onPress = function(){
    		duplicateMovieClip(this["test_mc_" + MyMovieClip_int], "new_mc" + MyMovieClip_int , _root.getNextHighestDepth())
    		startDrag(this["test_mc_" + MyMovieClip_int])	
    	}
    
    }

  2. #2
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    Please see the attached FLA (F8) from my library
    Last edited by Eager Beaver; 08-19-2007 at 02:25 PM.
    <signature removed by admin>

  3. #3
    Senior Member
    Join Date
    Oct 2002
    Location
    Copenhagen
    Posts
    228
    well, I've downloaded your exampel, but can't really recognize my problem in your file. I repeat my function in a 'for-loop', and need to integrate this duplicate-function in this loop ..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center