12 Replies Latest reply on May 31, 2012 9:05 AM by josh_chunick

    stillDown

    community help Level 1
        • 1. Re:  stillDown
          nairkat Level 1

          "This function is useful within a mouseDown script to trigger certain events only after the mouseUp function."

           

          An example would be nice

          • 2. Re:  stillDown
            josh_chunick

            create a sprite and add this code as a behavior:

             

            property spriteNum

             

            on enterFrame me

              if (_mouse.stillDown) then

                sprite(spriteNum).loc = _mouse.mouseLoc

              end if

            end

             

            • 3. Re:  stillDown
              nairkat Level 1

              If i understand the help topic correctly it refers to the on mouseDown event handler, let me use your code for my example now josh, to illustrate what I mean:

               

              property spriteNum

               

              on mouseDown me

                if (_mouse.stillDown) then --> This line wouldnt make any diference as the mouse is already down because we are inside an on mouseDown handler

                  sprite(spriteNum).loc = _mouse.mouseLoc

                end if

              end

               

              basically I see no point in including a _mouse.stillDown in an on mouseDown handler because within an onMouse the mouse it's obviously down for that frame. It mentions the on mouseUp function as well, including it there wouldnt produce any result either from my point of view.

              • 4. Re:  stillDown
                josh_chunick Level 1

                ok, let's cut through all this and spell it out very clearly. Yes, the help doc is wrong. You asked for an example of it's use and I was providing the correct use of it. I really don't know where the help doc was coming from with their wording, but as you've pointed out in a very round about way it couldn't possibly work as described.

                • 5. Re:  stillDown
                  nairkat Level 1

                  If I hadnt, I had run the risk you misundertand me, look at your first post in response of my initial one. I asked for an example within an on mouseDown handler you came up with an on enterFrame example.

                  • 6. Re:  stillDown
                    josh_chunick Level 1

                    Sorry, I wasn't trying to be a dick. I just wanted to be clear and get the correct info to you right away. I should have wrote more in the initial post with the code to explain things better, like I did in my second post.

                    • 7. Re:  stillDown
                      nairkat Level 1

                      Anyhow I dont think your info was wrong, because one of the most useful places to put an stillDown checker could be an on enterFrame handler. So,... peace. It's just that I didnt understand the help topic for reasons that are clear to us now.

                      • 8. Re:  stillDown
                        josh_chunick Level 1

                        lol! Yeah, the help info is quite wrong on that. I wonder if James Newton has fixed that in his help doc re-write?... hmmm, I'll have to contact him about that... or maybe he'll see and comment here.

                        nairkat wrote:

                         

                        Anyhow I dont think your info was wrong, because one of the most useful places to put an stillDown checker could be an on enterFrame handler. So,... peace. It's just that I didnt understand the help topic for reasons that are clear to us now.

                        • 9. Re:  stillDown
                          James Newton, ACP Level 3

                          Hi Josh,

                           

                          No, I didn't re-write the entry for stillDown. However, I did add a section on asynchronous coding.

                           

                          I cannot think of a situation in which I would recommend using the stillDown property.

                           

                          For a very simple drag feature, I would use the actorList and the #stepFrame event instead:

                           

                          on mouseDown(me)

                            (the actorList).append(me)

                          end mouseDown

                           

                          on stepFrame(me)

                            if the mouseDown then

                              sprite(me.spriteNum).loc = the mouseLoc

                            else

                              (the actorList).deleteOne(me)

                            end if

                          end stepFrame

                          • 10. Re:  stillDown
                            josh_chunick Level 1

                            I think it's probably more accurate to state that _mouse.stillDown seems to be redundant since any examples which I can come up with could just as easily use _mouse.mouseDown... btw, in your example you can replace 'if the mouseDown then'... with 'if _mouse.stillDown then'... and it works just the same.

                             

                            It still remains that this line in the help is ambiguous and needs an example to illustrate how it's useful: "This function is useful within a mouseDown script to trigger certain events only after the mouseUp function."

                             

                            OpenSpark wrote:

                             

                            Hi Josh,

                             

                            No, I didn't re-write the entry for stillDown. However, I did add a section on asynchronous coding.

                             

                            I cannot think of a situation in which I would recommend using the stillDown property.

                             

                            For a very simple drag feature, I would use the actorList and the #stepFrame event instead:

                             

                            on mouseDown(me)

                              (the actorList).append(me)

                            end mouseDown

                             

                            on stepFrame(me)

                              if the mouseDown then

                                sprite(me.spriteNum).loc = the mouseLoc

                              else

                                (the actorList).deleteOne(me)

                              end if

                            end stepFrame

                            • 11. Re:  stillDown
                              James Newton, ACP Level 3

                              The stillDown property existed in Director 4, but even then the mouseDown property was considered more useful, since the value of the mouseDown is updated inside a tight repeat loop. Testing for mouse states inside a tight repeat loop is no longer considered good practice.

                               

                              The stillDown is a legacy property. Perhaps the best way to document it would be to remove completely from the documentation, so that no new Director developers are tempted to use it.

                               

                              Here's a movie which shows how to drag (and drop) a sprite, using two different techniques. One is the very simplest possible, the other is more robust and reusable.

                               

                              go movie "http://nonlinear.openspark.com/tips/dragging/DragDrop.dir"

                              • 12. Re:  stillDown
                                josh_chunick Level 1

                                Or another option would be to use 'deprecated' in the help docs with the old commands and even syntax. As a business, Adobe should be pushing for people to upgrade (even if it's not where they make their money on Director, as they're always so quick to say). If they continue to support verbose syntax and old commands then they are keeping that door open that should have been closed with MX2004, when the DOM was cleaned up for inclusion of ECMA.