events

jquery click event not firing... but if I put an alert box in it does...? event bubbling problem?

This is a strange problem. I have two html pop-up windows, just hidden divs that I make visible by removing a css class. One is launched from from the main page, the second is launched from the div that I make visible. This all works great. Then when I try to close them I do this: (from game_ui.js) setUpPopUp: function() { ...

How do I pass a click event along to other children below in actionscript?

One of my decoration bitmaps covers up some important elements in my flex application. The problem is these elements become not clickable. How could make the bitmap not clickable or how could I pass the click event along to those children elements below? ...

jquery/javascript: function(e){.... what is e? why is it needed? what does it actually do/accomplish?

$('#myTable').click(function(e) { var clicked = $(e.target); clicked.css('background', 'red'); }); Can someone explain this to me, and explain why e is needed, and what it actually does.. ...

JQuery base64 function implementation

I can't figure out why is not working a jquery plugin (base64 encode decode) inside an event function. This way works: $(document).ready(function(){ data = $.base64Encode('something'); alert(data); }); But when trying to add in an event function, I get the $.base64Encode is not a function error $(document)....

How to prevent a key from being held down on a button? C#

I am writing a game where you need to click a button as many times as you can in 10 seconds. The problem is that it is possible to hold the Enter key down to superspeed the counter. How can I prevent this? I tried KeyDown Events but it doesn't seem to fire when the key is held down. Thanks. ...

How to know how many event handlers for an event?

Hi All, How to know how many event handlers for an event? I want a way to execute the following code: // if (control.CheckedChanged.Handlers.Length == 0) { control.CheckedChanged += (s, e) => { // code; } } Note: this code is out side the control class. Thanks in advance. ...

Safari 5 Extension: How can I detect when a window's current tab has changed?

I have a Safari 5 extension that contains a toolbar. Whenever the current tab changes, that toolbar should be updated. I would like to do something like this from my bar's script: safari.self.browserWindow.addEventListener("activeTab", tabChanged, false); However, that doesn't seem to work. I have tried a number of other event names a...

Event handling in modal windows (Java swing)

I'm developing the Java Swing application. I'm quite new to Java, so got some questions. I have a modal window with some set of controls (text fields, buttons etc). I want to handle click on the button in the parent window. I think the most efficient and accurate way is first to handle it in modal window, then raise some another event ...

Problem with Android button setonclicklistener

I am having a problem right now with setOnClickListener. When i put this following line: button.setOnClickListener(this); And run the application then it does not run and show a message that "Application closed forcefully". Could you please help me how I can set button onclick event in Android 2.2 Thanks Chandu ...

C# : How to capture events asynchronously and return a value from a function synchronously

This is a C# question I want to do a synchronous call for asynchronous event call backs. See comment in code for the req class User { EventHandler Service1Started() { "Looks like service 1 started as I got event from server class" ; } EventHandler Service2Started() { "Looks like service 2 started as I got...

Problem with c# events

I need to implement Pause and Resume events of a MP3 player inside the same button click event. following is the code i have tried and its not working,Can any one give me the solution private void button3_Click(object sender, EventArgs e) { if (button3.Text == "Pause") { CommandString = "pause mp3file"; mciSendSt...

javascript - events - where to place them?

Hello, I'm hopping that around the community of js developers we can have a consensus around this: Should we declare or onclick, onkeyup... etc... events inside or outside our HTML document? 1) I do prefer to have them separate. True. 2) I'm also aware that HTML5 adds some new interactive elements on the game... Regards, MEM ...

WPF - Detect when UserControl is not visible anymore and prompt user

So, I have a class, which goes as follows: public class EditorUserControl : UserControl { public EditorUserControl() : base() { this.IsVisibleChanged += new DependencyPropertyChangedEventHandler( EditorUserControl_IsVisibleChanged); } void EditorUserControl_IsVisibleChanged( object s...

How can I set the default event to be edited for my custom control in Visual Studio?

I made a custom button by inheriting the Button class. When I double click the custom button in Designer, it makes the event handling function for MyButton.Click: Private Sub MyButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyButton1.Click End Sub How can I make it so that when you double click,...

catching UIPicker selectRow notification of finished animation.

Hi everyone. I am trying to catch when a specific UIPicker animation is finished. I have looked long for an answer to this but it seems that the common answer, which is to ensure the selectRow call is within the beginAnimations and commitAnimations calls, does not work. The problem is that the animationFinished is triggered almost imme...

Does each webcontrol have only one unique event not inherited from System.Web.UI.WebControls?

The reason I want to know this is because it seems that __doPostBack('controlId','eventarg') raises the unique event of the control specified, but I wonder what would happen if the control had multiple unique events. ...

Paste only plain-text into editable div

i need to be able to allow a user to paste into an editable div (via whatever the user chooses: right-click and paste, shortcut key, etc), but i want to discard formatting and only take the plain text. i can't use a textarea since the div will allow basic formatting (bold and italic) if applied by user-initiated events. the onbeforepas...

How to handle events in MVVM

I am new in MVVM. I just learn this pattern and want to use it in my project. I am already understand working principle of this pattern and learned how to use Commands. But I have question how to handle events of another controls for example ListBox SelectionChanged event. ListBox haven't Command attribute ...

How to create an event on property changing and changed event in C#

I created a property public int PK_ButtonNo { get { return PK_ButtonNo; } set { PK_ButtonNo = value; } } Now I want to add events to this property for value changing and changed. I wrote two events. Here I want both the events to contain changing value as well as changed value. i.e When user implements the event. He must ...

Event removal in Mootools, and syntax of event addition

So I have been adding my events thusly: element.addEvent('click', function() { alert('foobar'); }); However, when attempting to remove said event, this syntactically identical code (with "add" switched to "remove") does not work. element.removeEvent('click', function() { alert('foobar'); }); I assume this is because the two...