attaching "do-all" function to button

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

  1. #1

    Default attaching "do-all" function to button

    not sure how to phrase this, but i hope it makes sense::

    Is there a way to have one function attached to a button that will apply to
    all the different button states (and do different things)? Right now, I have to
    write one function for the over state, one for the down, one for the release,
    etc (and call each of these individually in each instance of the button)...
    Basically, it would be easier if I could put one line of code in my button,
    that calls a function that contains all the scripts for the different states.

    This way, if I create a new button, I only have to attach one thing, and not
    "on press...on release...on...etc..."..you get the point. It sounds like a
    trivial matter, but it would make certain things a little more streamlined.

    Anyway, if anyone has an ideas, or even understands what I'm talking
    about,,,let me know.

    thanks

    asiabackpacker Guest

  2. Similar Questions and Discussions

    1. How to add "..." button to a property to open up "File Open"?
      I am creating a control and thinking about adding a property to the control. I will like a "..." button shown next to the value of this property...
    2. I don't see the "New function" button in RecordSet
      Hi, I've been going through the ColdFusion tutorial for creating a sample database application from...
    3. ListContains function sees "10" as "1"
      I have a problem with the "ListContains" function. I am building a "thermometer" and coloring the cells based on 3 color lists. The problem is when...
    4. Sony DSC-F1 Video Connector?? "Battery adapter attaching part"???
      Sony DSC-F1 Video Connector? What's the connector for the DSC-F1 Video Out? If I stuff in a 1/8" phone plug, I get video out. Problem is that...
    5. Attaching "OnClick" Javascript code to dhtml popup menu links
      I am currently developing a web site using fireworks, and am trying to figure out a way (through hand-coding) of attaching a javascript function...
  3. #2

    Default Re: attaching "do-all" function to button

    function blah(msg){
    trace(msg);
    }
    first_btn.onRelease = function(){
    blah("onrelease")
    }
    first_btn.onRollOver = function(){
    blah("rollover")
    }

    Like that?


    John

    --
    ----------------------------------------------------------------------------
    -----------
    RESOURCES
    [url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
    ----------------------------------------------------------------------------
    -----------
    TUTORIALS at
    [url]www.laiverd.com[/url]
    Flash & PHP Emailform
    Using textfiles in Flash
    ----------------------------------------------------------------------------
    -----------


    Laiverd.COM Guest

  4. #3

    Default Re: attaching "do-all" function to button

    you coud initiate a setInterval loop on(rollOver) that would poll for mouse presses etc and take appropriate action. clear your interval on(rollOut).
    kglad 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