Search Results

Search found 10381 results on 416 pages for 'delegate and events'.

Page 82/416 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • Actionscript 3 Navigate with Keyboard Between Labels

    - by Sbml
    Hello I need to navigate between labels with arrow keys like a power point presentation. I have an array with labels and a KeyboardEvent. My problem is, if I am in label number four for example and click in arrow click, always goes to first label. So I need help defining my current label to go to the next on key press. My code: import flash.events.KeyboardEvent; var myLabels:Array = [ "label_1", "label_2", "label_3", "label_4"]; var nextLabel:String; var inc:int = 0; stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); function keyPressed(evt:KeyboardEvent):void { switch(evt.keyCode) { case Keyboard.RIGHT : nextLabel = String(myLabels[inc]); gotoAndStop(nextLabel); inc++; break; } } Thanks

    Read the article

  • Making element draggable with Android WebView (ideally, just with Javascript) ?

    - by GJTorikian
    I'm building an app with a build target of 1.5 . I have a variable, WebView browser, that is calling loadUrl to load a static HTML page from my assets folder. In that HTML page, the following JavaScript is defined: var supportsTouch = ('createTouch' in document); ... var w = $('wrapper'); w[supportsTouch ? 'touchmove' : 'onmousemove'] = move; w[supportsTouch ? 'touchend' : 'onmouseup'] = function(event){ dragging = false; }; where move is another function that handles the dragging. Unfortunately, this doesn't seem to work. I cannot figure out a concise list of which touch events are available to Android--is it ontouchmove, or touchmove? Am I supposed to set up an onTouchEvent call back in my Java code, which then launches the JavaScript function?

    Read the article

  • Class as an Event Observer

    - by emi
    I want to do something like this... var Color = Class.create({ initialize: function() { this._color = "white"; this.observe("evt: colorChanged", this.colorChanged.bind(this)); }, changeColor: function(color) { this._color = color; this.fire("evt: colorChanged"); }, colorChanged: function(event) { alert("You change my color!"); } }); var a = new Color().changeColor("blue"); Why the colorChange custom event will never be dispatched and I need to use, instead of this, a DOM element like document.observe? In my code I'd like to know which class dispatches the event using event.target and I can't if I must use document or some other DOM element. :( I've been working in Actionscript 3 and that's the methodology I learned to work with custom events in classes. What about Javascript?

    Read the article

  • How to determine which class has called a function

    - by dannyc
    Hi, I am working on a Flex Front End at the moment, and have been using the Parsley framework for passing messages/events around. I was wondering if there is a simple way for a function (in this case, an event's constructor) to obtain a reference to the object which called it? This is to ensure that a certain event that I am defining can only be dispatched by one specified class. My thinking is to check the caller of the constructor somehow, and throw an error if it is not of the correct type. I am open to suggestions of alternative approaches here, but I would ideally like to stick to using the Parsley 'MessageHandler' approach if at all possible. Thanks for reading guys..

    Read the article

  • Javascript dispatchEvent

    - by xpepermint
    Hey... I'm using Flash a lot and my classes uses EventDispatcher class which allowes me to define custom events of a class. How can I do this in javascript. I would like to do something like this: var MyClass = function() { }; MyClass.prototype = { test : function() { dispatchEvent('ON_TEST'); } }; var mc = new MyClass(); mc.addEventListener('ON_TEST', handler); function handler() { alert('working...') } How is this posible with Javascript?

    Read the article

  • JavaScript onload/onreadystatechange not firing when dynamically adding a script tag to the page.

    - by spoon16
    I am developing a bookmarklet that requires a specific version of jQuery be loaded on the page. When I have to dynamically insert a jQuery script tag to meet the requirments of the bookmarklet I want to wait for the onload or onreadystatechange event on the script tag before executing any function that requires jQuery. For some reason the onload and/or onreadystatechange events do not fire. Any ideas on what I am doing wrong here? var tag = document.createElement("script"); tag.type = "text/javascript"; tag.src = "http://ajax.microsoft.com/ajax/jquery/jquery-" + version + ".min.js"; tag.onload = tag.onreadystatechange = function () { __log("info", "test"); __log("info", this.readyState); }; document.getElementsByTagName('head')[0].appendChild(tag); The FULL code: http://gist.github.com/405215

    Read the article

  • Custom event listener on Android app

    - by Bilthon
    Hi everybody, I need to set up a simple event listener to refresh a listview from once in a while. The problem is I don't know how could I generate an event. I know that for events like key or button pressing I just need to implement the handler. But in this specific case I actually need to generate the event, which will be fired everytime another running thread of my app wakes up and refreshes it's list of news from a rss feed. I've done everything, but got stucked in here. Can I get any suggestion or link with some more info on how to implement this? Thanks Nelson R. Perez

    Read the article

  • jQuery live() and stopPropagation() issue

    - by colourandcode
    I know that the live() event handles event bubbling different than all other jQuery events. jQuery recommends using 'return false', but in my case that doesn't work. The issue is: I have a DIV which contains an anchor tag. The DIV is bound using live(). Whenever I click the anchor tag inside this DIV it bubbles and calls the DIV's event. If I bind an event to that A tag which returns false it prevents the link from opening. Neither stopPropagation() or return false work in this case. Are there any other options? Ideally I'd like to keep the live() event around.

    Read the article

  • onTextChanged Event for many Textboxes c#

    - by Alan Bennett
    Hi, I am currently building a prototype for a new system screen, and i am using c# to build this. The question i have is, i currently have 14 textboxes which are filled from a condition from a couple of other controls on the screen. these 14 textboxes all add up to a total shown in another textbox. as these textboxes are editable (in case the client wishes to increase the value) (cant go into to much detail but they will) I need to have a firable ontextchange event for when the values change so the total box updates. however i have a feeling there must be a way of not having to create 14 different events, is there a way that i can have 1 event which fires if any of the 14 text boxes are fired? thanks Alan

    Read the article

  • Blackberry RepeatRule

    - by Vinay
    Hi All, I am very new to Blackberry development. I am trying to access the Blackberry Events (Calender) list. Currently, I am able to read the basic information from the event list. I am stuck in getting the info regarding the RepeatRule. My code is as below: EventList eventList = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_ONLY); Enumeration e = eventList.items(); while (e.hasMoreElements()) { Event event = (Event)e.nextElement(); RepeatRule rRule = event.getRepeat() ; if (rRule != null) { fieldIds = rRule.getFields() ; // Here I get the values as { 0,128,64,2}. How do I decode this information? } } Can any one help in decoding this information. Any kind of links, examples or pointers would be of great help. Thanks and regards, Vinay

    Read the article

  • EventSetter - error XAML in Visual Studio designer

    - by pileggi
    Hi! I've done my TreeView all with XAML but now I'd like to manage an event with code-behind. The HierarchicalDataTemplate contains an Image. I need to capture the events MouseEnter / MouseLeave on the Image. I've tried in this way: <Image x:Name="imgArticolo" Source="{Binding imgArt}"> <Image.Style> <Style TargetType="{x:Type Image}"> <EventSetter Event="MouseEnter" Handler="iArt_MouseEnter"/> </Style> </Image.Style> </Image> But in the designer of Visual Studio appear the error: "Impossible to load a file XAML with EventSetter". How can I remedy? Thank you! Pileggi

    Read the article

  • Simple iframe editor and oninput event.

    - by teehoo
    I'm writing a simple editor in an iframe, but having trouble registering the "oninput" event to detect when the user modifies the text field such as pasting in data etc. var txtArea = document.getElementById('txtArea'); txtArea.contentWindow.document.designMode="on"; txtArea.contentWindow.document.open(); txtArea.contentWindow.document.write("body{font-size:13px;}"+data.document+""); txtArea.contentWindow.document.close(); $([txtArea.contentWindow.document]).bind("click", updateCaretPosMouse); //fires $([txtArea.contentWindow.document]).bind("keyup", updateCaretPosKeyboard); //fires $([txtArea.contentWindow.document]).bind("input", textChanged); //doesn't fire If I create a plain old textarea element, and add the "input" event to this, then it works. Do 'input" events not work with iframes WYSIWYG editors?

    Read the article

  • Postgres : Post statement (or insert) asynchronous, non-blocking processing.

    - by Hassan Syed
    I'm wondering if it is possible, that after a collection of rows is inserted, to initiate an operation that is executed asynchronously, is non-blocking, and doesn't need to inform the originator of the request - of the result. I am working with large amounts of events and I can guarantee that the post-insert logic will not fail -- I just want to have a single insert thread in my event-sources, and I want this thread to keep flying without blocking, and without being responsible for any post-delivery book-keeping. I can tell you that I would potentially have a 100 of these jobs executing concurrently and each job might operate on 5 tables with anywhere between 200-1000 inserts on each of these tables. A hint in the right direction should be enough.

    Read the article

  • Keypress event on inserted span (jQuery)

    - by Coder
    Hi, I've been researching for a long time, and haven't found a possible solution. The problem I have is that I'm trying to attach an event handler to an span element just inserted. So basically the problem is, when a user performs a particular action that I set (clicking a button by example) I call this function: function AppendSpan() { $('#mydiv').append('<span id="someid" contenteditable="true">Some TExt</span>'); //Then I want to handle the keypress event on the inserted span $('#someid').keypress(function(event){//Do something here}); } The problem is that the keypress event is never triggered on the inserted span, I tried with the click event and it works fine, but not the keypress or keydown,keyup events. I also tried with $('span').live("keypress",function(event){//Do something}); but didn't work. Any suggestions would be appreciated, I need this to work only in FF, so no support for IE required.

    Read the article

  • SQL to display an event on start date, end date and any days in between.

    - by Tim
    Hello, This should be fairly simple, but I can't get my head around it. I have an event in my database with a startDate and an endDate. I need to display this event (based on the current date) on every day the event occurs. So if the event starts on the 3rd of May and finishes on the 7th of May, the SQL query must find it on every single day. How can I achieve this? SELECT * FROM events WHERE startDate ??? Thanks, Tim

    Read the article

  • Does javascript event handling occur inside or outside the program flow?

    - by Carlo Roosen
    This question is related to Javascript event handling and flow control, but it is one step beyond. The question that remains unanswered is: when an event is fired and control is returned to the browser, could the browser decide to handle other events first (fired by other scripts or user action) (A), or will it always handle my event directly (B)? The question is important, because in case (B) you can rely on the fact that nothing has been changed between firing the event and the event handler, while (A) gives no guarantees whatsoever. My first guess is (B), how else could stopPropagation() and preventDefault() work? But giving it a second thought, it is no hard evidence.

    Read the article

  • How to pass event to method?

    - by tomaszs
    I would like to create a method that takes as a argument an event an adds eventHandler to it to handle it properly. Like this: I have 2 events: public event EventHandler Click; public event EventHandler Click2; Now i would like to pass particular event to my method like this (pseudocode): public AttachToHandleEvent(EventHandler MyEvent) { MyEvent += Item_Click; } private void Item_Click(object sender, EventArgs e) { MessageBox.Show("lalala"); } ToolStripMenuItem tool = new ToolStripMenuItem(); AttachToHandleEvent(tool.Click); Is it possible or do I not understand it good? Edit: I've noticed with help of you that this code worked fine, and returned to my project and noticed that when I pass event declared in my class it works, but when I pass event from other class id still does not work. Updated above example to reflect this issue. What I get is this error: The event 'System.Windows.Forms.ToolStripItem.Click' can only appear on the left hand side of += or -=

    Read the article

  • Guaranteeing the onmouseout event to fire

    - by n3rd
    Hello everybody, I'm currently developing a web application and have run into a little problem. I'm using ExtJS, but I believe this to be a general JS question. When the cursor enters an HTML element, the onmouseover event is fired, when the cursor leaves that element, onmouseout is triggered. So far, so good. Unfortunately, it seems one can't fully rely on this behaviour. Very quick mouse movements can cause the event not to fire (as does repositioning the cursor with a pen tablet, for example). What are the best practices to handle these issues? Do I need to monitor all onmousemove events and manually keep track of where the cursor was last and fire the appropriate onmouseout event myself?

    Read the article

  • How to subscribe to EventHandler of a private control outside of Form

    - by randooom
    Hi all, maybe my design is not good, or I don't see the obvious solution, but I want to subscribe to a buttonClick EventHandler of Form1 from outside form1. For example I have a Controller and Form1 who are both instanced in the main function. Now I want to subscribe a function from Controller to the buttonClick event from Button1_Click in Form1. But the button1 is declarded private, so i can't do form1->Button1->Click += gcnew EventHandler(controller->function) Is there any way to get around this? Ok I could write a setter or something in Form1, but is there any other solution? I read some examples, but they are all calling events from within the same class so they don't address my specific problem.

    Read the article

  • What's the cross-browser way to capture all single clicks on a button?

    - by sany
    What's the best way to execute a function exactly once every time a button is clicked, regardless of click speed and browser? Simply binding a "click" handler works perfectly in all browsers except IE. In IE, when the user clicks too fast, only "dblclick" fires, so the "click" handler is never executed. Other browsers trigger both events so it's not a problem for them. The obvious solution/hack (to me at least) is to attach a dblclick handler in IE that triggers my click handler twice. Another idea is to track clicks myself with mousedown/mouseup, which seems pretty primitive and probably belongs in a framework rather than my application. So, what's the best/usual/right way of handling this? (pure javascript or jQuery preferred)

    Read the article

  • Selecting an item in an HTML SELECT list using keyboard doesnt trigger the CLICK event

    - by Jimbo
    I have an HTML select list which, when an item is selected, must show different information beneath it. The onclick or JQuery change events are triggered when a select list item is selected by being clicked on (mouse), but not when the user uses key presses (keyboard). Any idea what event to watch in order to determine when the selected list item has changed? Here is a BASIC test example: <select id="mylist" name="mylist"> <option value="">(none)</option> <option value="1">Test 1</option> <option value="2">Test 2</option> <option value="3">Test 3</option> </select> <span id="myspan"></span> <script type="text/javascript"> $("#mylist").change(function() { $("#myspan").html($("#mylist").attr("selectedIndex")); }); </script>

    Read the article

  • MYSQL Event Scheduler DELIMITER using PHP

    - by user1440918
    I'm having an issue with my PHP code trying to create events within MySQL. I begin with creating a string like this: $sql="DELIMITER $$ CREATE EVENT `$test_name` ON SCHEDULE EVERY $time1 $sched2 STARTS '$start_date $start_time' DO BEGIN "; $sql .="INSERT INTO blah (foo,bar); "; $sql .="END$$ DELIMITER ;" mysql_query($sql,$dbh); But I keep getting Syntax Errors starting with DELIMITER $$ CREATE EVENT. Without the semicolon behind (foo,bar); the event triggers with a unexecuted payload. Any ideas on where I'm going wrong? Thanks!

    Read the article

  • How can I add an event handler to an event by name?

    - by cyclotis04
    I'm attempting to add an event handler for every control on my form. The form is a simple info box which pops up, and clicking anywhere on it does the same thing (sort of like Outlook's email notifier.) To do this, I've written a recursive method to add a MouseClick handler to each control, as follows: private void AddMouseClickHandler(Control control, MouseEventHandler handler) { control.MouseClick += handler; foreach (Control subControl in control.Controls) AddMouseClickHandler(subControl, handler); } However, if I wanted to add a handler for all of the MouseDown and MouseUp events, I'd have to write two more methods. I'm sure there's a way around this, but I can't find it. I want a method like: private void AddRecursiveHandler(Control control, Event event, EventHandler handler) { control.event += handler; foreach (Control subControl in control.Controls) AddRecursiveHandler(subControl, event, handler); }

    Read the article

  • Send post data while opening SSE connection

    - by Prosto Trader
    I'm trying to establish SSE connection and do some long-taking actions on server-side, informing user about how it goes through SSE events. Actually, I don't understand how would I send some data along with new connection. I have to combine regular ajax with new EventSource or there is a way to transfer post data inside that event? Here is what I have so far, and I need to send pretty big JSON with the request. Is it possible or the only way to send data is GET? var source = new EventSource('/terminal/ajax-put-packet-trade-order/');

    Read the article

  • How to raise CComponent event in Yii

    - by srigi
    Let's assume I have Component (say Graph like Yahoo Finance) rendered on the page. Component view template contains bunch of a_hrefs which I wanto to switch period in graph. I created Event and Event handler in Component. I have two questions: How to raise event on Graph Component via those a_hrefs (should they be part of Graph?)? How to redraw Graph without loosing curent page context (section, filter - specified as $_GET values)? My Graph Component look like this: Yii::import('zii.widgets.CPortlet'); class Graph extends CPortlet { private $_period; /* ********************** * * COMPONENT PROPERTIES * * ********************** */ public function getPeriod() { return $this-_period; } public function setPeriod($period) { $this-_period = $period; } /* ********************** * * GENERIC * * ********************** */ public function init() { parent::init(); // assign event handlers $this-onPeriodChange = array($this, 'handlePeriodChange'); } protected function renderContent() { $this-render('graph'); } /* ********************** * * EVENTS * * ********************** */ public function onPeriodChange($event) { $this-raiseEvent('onPeriodChange', $event); } /* ********************** * * EVENT HANDLERS * * ********************** */ public function handlePeriodChange($event) { // CODE } }

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >