8 Replies Latest reply on Sep 4, 2007 5:47 PM by clbeech

    Movieclip onRelease

      Hi everyone

      my problim is:

      I change my cursor with othe movielip and i want, when i rollOver to movieclip wich one has function release, my cursors's movieclip make something.
      How to catch wich movieclip has onRelease function?

        • 1. Re: Movieclip onRelease
          OS_Design Level 1
          Can enyone help me
          • 2. Re: Movieclip onRelease
            clbeech Level 3
            It's not quite clear what you want ot have happen, but if you're saying that when you hover over a MC that can be clicked you want to change the MC of the cursor, then you would need to add another handler to the buttons/MCs that have an onRelease function.

            use an 'onRollOver' handler to 'tell' the cursor that this is happening. Here's an example: FILE
            • 3. Re: Movieclip onRelease
              OS_Design Level 1
              Thanks clbeech but i don't want this,

              In my scene i have f.e. 10 movieclips, some of them has onRollOver and onRollOut functions some of them has onRelease too. when i roll over the movieclip which has onRelease function than i want to cursor's movieclip do somethink.
              • 4. Movieclip onRelease
                clbeech Level 3
                that's what this file is doing. You'll have to specify in the onRollOver of a button that has an onRelease event, to tell the cursor to change. You'll just need to add the call to the cursor to the buttons you want this to happen on.

                PS. I didn't add an onRelease call tot he big red dot on the Stage, but it is a button and could have that handler applied to it.
                • 5. Movieclip onRelease
                  OS_Design Level 1
                  no i don't want like this because maybe i have 200 movieclip, than i must write in each rollOver to change my cursor's movieclip.

                  one way is to get on rollOver rolled movieclip assegned functions, but i dont know how.
                  Movieclip.prototype.onRollOver = function(){
                  here to get this.(function's list)
                  • 6. Movieclip onRelease
                    clbeech Level 3
                    if you wanted to add this function to all MCs you could do something like that, maybe, not sure if you can prototype an 'on' handler. But doing it with a prototype you would still need to add the prototype call to each MC/button. However, if all the MC/buttons are within another MC you could do something like this (where MC is the name of the 'master' container):

                    for(var name in MC) {
                    if(typeof (MC[name]) == 'movieclip') {
                    MC[name].onRollOver = function() {
                    //the cursor change code here and other functions

                    you can use 'this' instead of 'MC' but it would apply to all MCs throughout the doc.
                    • 7. Re: Movieclip onRelease
                      OS_Design Level 1
                      You don't understand...

                      I want to change my cursor if the mc has release function.
                      When i make rollOver on mc i want to read from mc if it has onRelease function.
                      Tell me if you know how can i get a list of functions assigned on mc?
                      • 8. Re: Movieclip onRelease
                        clbeech Level 3
                        OK, got it now. you can use the Object.hasOwnProperty();

                        in the cursor, run a check like this: