Mousedown/OnRelease for each dynamically generated movieclip

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Mousedown/OnRelease for each dynamically generated movieclip

    I am dynamically creating movieclips on stage with this code. Each movieclip
    has a textfield txtInfo inside that will display some information.

    for (var i = 1; i<j; i++) {
    myClip = _root.attachMovie("mcInfo", "mc_info"+i, i);
    eval("mc_info"+i).txtInfo.Text = "Assign Text depending on i ";
    }

    With this code assuming j = 5, I now have 5 movieclips on stage each with
    different text displayed in them.
    I want to be able to perform an action depending on which movie clip I
    click.

    How can I track my mousedown/onRelease for each movieclip dynamically placed
    on stage so that it is

    eval("mc_info"+i).onRelease = function() {
    -- perform action
    };
    here , i can be any value from 1 through j (from previous code line)

    -Smitha


    GSB Guest

  2. Similar Questions and Discussions

    1. Dynamically Generated Forms
      My company has a database-driven system of web forms, each of which consists of many questions in various layouts (2-column radio, 1 column...
    2. onRelease function on a movieclip that is dynamically generated
      I am dynamically generating movieclips. j = 5; for (var i = 1; i<j; i++) { _root.attachMovie("mcInfo", "mc_info"+i, i); _root._y = yposition;...
    3. Using textfields that are dynamically generated
      Hi, I have a question about using textfields that I'm generating dynamically. I am generating textfields depending on the number of records in...
    4. lingering movieclip, will not go back to label onRelease
      Hi. I'm having a problem with a movieclip on my main timeline that I want to appear on each click of my nav. buttons, it's a page transistion that...
    5. dynamically creating instances of a movieclip
      Hi, I'm using MX on Win98 to create a movie that allows a user to rearrange the order of their image files stored on my server for use in a...
  3. #2

    Default Re: Mousedown/OnRelease for each dynamically generatedmovieclip

    put an invisible button in the movie clip.
    dk_says_hey Guest

  4. #3

    Default Re: Mousedown/OnRelease for each dynamically generated movieclip


    "dk_says_hey" <webforumsuser@macromedia.com> wrote in message
    news:c231ub$qnq$1@forums.macromedia.com...
    > put an invisible button in the movie clip.

    Thanks. That worked


    GSB Guest

  5. #4

    Default Re: Mousedown/OnRelease for each dynamically generatedmovieclip

    another method is -

    for(var i=1; i<6; i++){
    myClip = _root.attachMovie("mcInfo","mc_info"+i,i);
    myClip._y = i*30;
    myClip.txtInfo.Text = i;
    pressed(myClip);
    }

    function pressed(ref){
    ref.onPress = function(){
    trace(this);
    };
    };

    Jack. Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139