Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-28-2007, 10:31 AM
Member
 
Join Date: May 2007
Posts: 53
Default Cant make Application.captureMouse work

In Initialize script i've typed Application.captureMouse = true; and wrote a simple test script in flash.
Code:
_root.onMouseUp = function() {
myTextField.text = Math.random();
};
Then, while the app is running, i press left mouse button inside the app window, move mouse cursor outside and release the button. And my app is unable to fix this event. What's wrong?

Thx in advance.
__________________
#define true false //happy debugging, friends
Reply With Quote
  #2 (permalink)  
Old 05-28-2007, 03:25 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Cant make Application.captureMouse work

When you click the swf movie, if there is not any component, in the mouse down event handler, the flash player will release capture. Therefore you cannot capture mouse, although you have set capture in the "initialize" script. In fact, even if you set capture in the onMouseDown function, it does not work.

To solve the problem, you will have to set capture in the onMouseMove event handler, as shown in the following actionscript 2 code

Code:
import SWFKit.*;

clicked = false;

_root.onMouseDown = function () {
clicked = true;
_root.onMouseMove = function() {
if (clicked) {
Application.captureMouse = true;
delete _root.onMouseMove;
}
}
}

_root.onMouseUp = function () {
clicked = false;
Application.captureMouse = false;
Dialogs.msgBox("hello");
}
Reply With Quote
  #3 (permalink)  
Old 05-28-2007, 03:40 PM
Member
 
Join Date: May 2007
Posts: 53
Default Re:Cant make Application.captureMouse work

What a tricky method! -)
Thank you.
__________________
#define true false //happy debugging, friends
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:20 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.