Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Minor SharedCursorPane issue

Avatar

Level 2

Greetings

I am using a SharedCursorPane that covers only a part of the screen. I would like to have someone's cursor disappear when moved outside of the SharedCursorPane area. What actually happens is that the cursor is visible but the updates are slower than the default (0.5 sec?) rate, and when the cursor stops, eventually the updates stop also, but the cursor remains visible. Fix?

Thanks

Scott Shumway

9 Replies

Avatar

Level 10

Are you using Absolute mode or relative mode ? I presume you are using relative which is the default. The shared cursor shouldn't be visible out the pane area in that case.

And also, updates always go by poll interval i.e. 0.5 sec.

And we have an inactivity timer that stops and doesn't show the cursor after 2 seconds of inactivity .

Can you help in debug(if u r linking to source files) and see whether u receive items ( in onItemReceive function) even outside the pane area ?

And secondly, can you verify by putting a break point in removeMyCursor() function of SharedCursorPane that if it gets called when you stop ?

Our side looks fine on debug. So, if you can debug and let us know the results , it will be great.

Thanks

Hironmay Basu

Avatar

Level 2

I am using relative mode (default). BTW, those constants are declared as protected, so you can't set the values with editor hints, you just have to know what to set.

I am not linking to source. How would I do that?

Sorry to be dumb.

Avatar

Level 2

Hmm...

I copied the player9/src to make a Flex Library project, but it gets a lot of errors. [Style] must annotate a class, in BorderStyles.as and TextStyles.as.

Sorry, can't get debug info.

Avatar

Level 10

Hi ,

You can always subclass the SharedCursorPane class to set any value you want.

If you are using player 9, then you can link the source we provide in flex builder. In Flex Builder's Project->Properties->Flex Build Path->Source Path and add the source folder. If you are using player 10, you can't do that yet as we don't provide the player 10 source.

You don't make a library project. In your original project, you can add the player9/src folder to your source path.

Thanks

Hironmay Basu

Avatar

Level 2

I tried that too, but I get the same errors.

Also, I shouldn't need to subclass it, those are properties of the SharedCursorPane.

Like I said, minor issue. I don't think I'll worry about it.

Thanks

Avatar

Level 10

Linking source shouldnot give you any error as all users are using it. You might be missing something. But anyways, I will take a look on that whether and see if I can reproduce it.

Thanks

Hironmay Basu

Avatar

Level 2

Yeah, I'm not sure what happened to the style errors, but I refreshed and they went away. I was left with some namespace changes, now it's working.

I subclassed SharedCursorPane and put some traces on overrides of addNewCursor and removeCursor. I am seeing that when I move a remote cursor outside the SharedCursorPane, I get pairs of addNewCursor/removeCursors on mouse moves. The addNewCursor seems to be from onItemReceive.

Avatar

Level 2

This is working:

override protected function onMouseMove(p_evt:MouseEvent):void

{

     if (_inactivityTimer) {

          _inactivityTimer.stop();

          _inactivityTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onInactivity);

          _inactivityTimer = null;

     }

     if (_areaRect) {

          var mousePt:Point = new Point(mouseX, mouseY);

          if (_areaRect.containsPoint(mousePt)) {

               // We're still in the pane area.

               if (!_pointTimer.running) {

                    sendMyCursor();

               }

           } else /*if (_pointTimer.running) removed */ {

               _pointTimer.reset(); /* added */

               // We're outside.

               removeMyCursor();

          }

     }

}

I just always reset _pointTimer.reset when mouse is outside.

Avatar

Level 2

This is better:

           } else if (_pointTimer.running) {

               _pointTimer.reset(); /* added */

               // We're outside.

               removeMyCursor();

          }

That's what i meant....