A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8] Drag Problem

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    100

    [F8] Drag Problem

    I have a movie where a textbox clip is attached to an empty mc. This textbox mc can be dragged and resized. All of this works fine. I would like to add as many of these textbox mc to the stage as I want but the problem is when I add the second textbox mc the resize starts working on the new textbox and stops on the one before it. I know it is something I am overlooking and it is probably staring me in the face but I cant see whats wrong. Can someone please take a look and give me a helping hand? Fla attached.

    Thanks
    Attached Files Attached Files
    sgekko

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    100
    Come on guys can't anyone help me on this one?

    Thanks!
    sgekko

  3. #3
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    sounds like your moive clip instance names are the same to me.....therefore they are conflicting with each other

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    100
    nope, movieclip instance name is different everytime. I have attached the fla for review. The linkage name is the same but the instance name is "Text" plus a counter number.
    sgekko

  5. #5
    Senior Member
    Join Date
    Oct 2004
    Location
    London
    Posts
    186
    Hi,

    when you create the function AddTextObject, each time an instance is added, you need to include it in an array. Then apply the functions to the array, so that the functions affect all instances on the stage.

    var newTexts:Array = new Array();

    function AddTextObject() {
    addTextBtn.onPress = function {
    var T = _root.Pane.attachMovie("TextBox", "Text"+iCount, iCount);
    newTexts.push(T);
    trace(newTexts);
    for (var i:Number = 0;i<(insert a value);i++) {
    //put your dragging functions here, referring to the array.
    newTexts.onPress = function() {
    this.startDrag(false);
    }
    }
    }
    }

    HTH

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