6 Replies Latest reply on Feb 21, 2007 8:25 PM by hwa-jun yu

    help on rollOver and publishing work

    hwa-jun yu Level 1
      hi
      it's hwa-jun again.
      This topic needs help on rollOver problem and about publishing work.
      Everytime I check mouse interaction with certain sprite using rollOver, director checks by the sprite's bounding box. How do I make it checks by pixels, to make the sprite react when my mouse is over the sprite's pixel, not around it's bounding box?
      I've done a simple game, now I want to publish it into a stand alone application with protected casts. It didn't turn out good the first time I tried. I'm gonna read more help and retry. Is there any technical issue related to this problem? Oh yah, I also had a problem with the fullscreen setting. The application is not "fully fullscreen" and I can see my project's title bar. How am I supposed to do with that?
      Please anyone post a helping reply. Thank you.
        • 1. Re: help on rollOver and publishing work
          Level 7
          To have your rollovers react to only the visible parts of the sprite,
          set the sprite's ink to "matte".

          To get full screen, make sure that you turn off all of the items that
          you don't want to see in the Display Template tab of the Property
          Inspector.

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: help on rollOver and publishing work
            hwa-jun yu Level 1
            quote:

            Originally posted by: Newsgroup User
            To have your rollovers react to only the visible parts of the sprite,
            set the sprite's ink to "matte".

            To get full screen, make sure that you turn off all of the items that
            you don't want to see in the Display Template tab of the Property
            Inspector.



            Thanks for the info about the Display Tempate, Rob. I didn't notice it at the first place.
            But the trick to set the ink to "Matte" is not working. Here is the detail of my problem.
            I'm working with png files with transparent background. It looks okay when I use "Background Transparent" ink like this ...
            sprite(2).ink = 36
            The problem is, when I use the rollOver method to check hitTest with the mouse, it checks the bounding box. I want the rollOver to check only the visible pixels.
            When I set the sprite's ink to Matte ...
            sprite(2).ink = 8
            And I work on the mouse hitTest with the rollOver method, it still reacts to the bounding box..
            Is there another way to solve this or is it a problem with my javascript?
            • 3. Re: help on rollOver and publishing work
              Level 7
              Select your .png image sprite on the stage. Go to the Property Inspector
              window and select the Bitmap tab. There is a "Use Alpha" check box
              toward the top. It should be checked.

              You should see a slider at the bottom titled "Alpha Threshold". The
              value is probably set to 0. Set it to 255. The "clear" parts of your
              image should now not trigger the cursor. You can adjust this setting as
              you like to get the sensitivity that you need.

              --
              Rob
              _______
              Rob Dillon
              Adobe Community Expert
              http://www.ddg-designs.com
              412-243-9119

              http://www.macromedia.com/software/trial/
              • 4. Re: help on rollOver and publishing work
                hwa-jun yu Level 1
                quote:

                Originally posted by: Newsgroup User
                Select your .png image sprite on the stage. Go to the Property Inspector
                window and select the Bitmap tab. There is a "Use Alpha" check box
                toward the top. It should be checked.



                Yes it is already checked.

                quote:


                You should see a slider at the bottom titled "Alpha Threshold". The
                value is probably set to 0. Set it to 255. The "clear" parts of your
                image should now not trigger the cursor. You can adjust this setting as
                you like to get the sensitivity that you need.



                Nope. Still not working.

                Sorry for being stupid.. But it really is not working.
                I read about the alpha threshold.. It seems that it is the answer. But.. I still can't figure it out why it isn't working.
                here is my code
                // =========== javascript ==============================
                var clikmouse;

                function mouseDown(me){
                clikmouse = true;
                }

                function enterFrame(me) {
                if(_movie.rollOver(1)){
                if(clikmouse == true){
                trace("asdf")
                clikmouse = false;
                }
                }
                }

                I use javascript because I'm more familiar with it than lingo. I've been coding ActionScript all this time and just a few weeks ago I started learning director.
                Back to my game project..
                Usually I don't directly use score to put sprite. I use the method "makeScriptedSprite". Is there a problem with that?
                about my bitmap.. It is a png file with transparent background. I export the files from Flash. Because its background is already transparent, I leave the ink setting to Copy. I got a nice result with the image on the score.. except the part with the rollOver. I was thinking.. maybe it's the problem with my bitmap?
                • 5. Re: help on rollOver and publishing work
                  Level 7
                  Yes, it's most likely the bitmap itself. You may not have a proper 32
                  bit .png file and Director can't work with the alpha. Try opening the
                  .png in Photoshop or Fireworks and resave it.

                  --
                  Rob
                  _______
                  Rob Dillon
                  Adobe Community Expert
                  http://www.ddg-designs.com
                  412-243-9119

                  http://www.macromedia.com/software/trial/
                  • 6. Re: help on rollOver and publishing work
                    hwa-jun yu Level 1
                    Hi there, Rob.
                    Thanks again for the reply.
                    I've figured out the problem with rollOver.
                    It is very true what you told me that setting the Sprite's Ink to Matte will make director checks for visible pixel when rollOver syntax is invoked.
                    But it is working in some condition.
                    It is only working if I put script directly to the Cast Member (right click the cast member, choose Cast Member Script...)
                    It is not working if we try to put the rollOver syntax in anywhere else, like in FrameScript.

                    Is this correct?