Articles Tagged 'Event'

jQuery snippets

Verify the existence of an element in the DOM

There will ever need to check the existence of an element of the DOM. With jQuery could be spontaneously try:

Continued ...

How to hide the close button of a dialog jQuery UI

While waiting for the official release of jQuery UI 1.7 (Yeah, the jQuery development team decided that it will release as version 1.7, due to confusion), which may be one option to remove the close button of a box, here's how can quickly resolve the problem with the current 1.6rc6:

Continued ...

Very short trick: ADDED_TO_STAGE

per capire quando il nostro MovieClip è disegnato effettivamente sulla stage: As we have seen several times in the constructor of a class that extends MovieClip may be necessary to add the event ADDED_TO_STAGE to understand when our MovieClip is actually drawn on the Stage:

Continued ...

Actionscript 3.0: MovieClip MovieClip over

Just a Flash Developer / Actionscript is preparing to write a function similar to a tooltip, clashes immediately with the problem of the propagation of events between overlapping MovieClips. In fact, if a MovieClip (B) is superimposed to a MovieClip (A), which responds, for example, an event MouseEvent.Mouse_OVER , by hovering on the MovieClip (B) no event be higher than intercepted by the MovieClip (A):

MovieClip MovieClip over

Continued ...

Creating custom events in ActionScript 3.0

Creating custom events in ActionScript 3.0 is simple. Use them, then, allows you to use the method addEventListener() and make our object of all standards. ) BottoneEvent . If we created a class, such as Bottone , this is correct to associate with one or more events through a special class (derived from the class Event ) BottoneEvent . We could make all the events that affect the operation of our subject: the click, mouse over, or any other event! As well as defining our personal basis. The skeleton - generic - a custom event class is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package {
/ *
** @ Name: BottoneEvent.as
** @ Description: Class derived from Event to manage their own custom event
** @ Author: undo = =
** @ Web: http://www.undolog.com
** @ Email: @ g.fazioli undolog.com
* /
.*; import flash.events .*;

BottoneEvent extends Event { BottoneEvent extends public class Event {

String = 'pluto' ; // codice qualsiasi, anche 'mioevento' in minuscolo public static const MIOEVENTO: String = 'bar', / / any code, even 'mioevento' in lower case

Valore : Number = NaN ; public var value: Number = NaN;
/ *
** @ Name: BottoneEvent
** @ Description: constructor
* /

type , bubbles , cancelable ) ; super (type, bubbles, cancelable);
Value = v ; this. Value = v;
}

/ *
** @ Override
* /
clone ( ) : Event { override public function clone (): Event {
this . type , this . Value , this . bubbles , this . cancelable ) ; KnobEvent return new (this. type, this. Value, this. bubbles, this. cancelable);
}
}
}

Continued ...

Unobtrusive Javascript: a little 'eye for clarity and to impostors

Some scripts, and some Web marketing them use some Javascript functions for non-intrusive (Unobtrusive), even when they are not at all. What makes a script (usually JavaScript) is not intrusive? In principle, a JavaScript script is non-intrusive when you can do without it! Put very simply! When developing a Web site usability of the same should not depend on any kind of script. Only in this case we have a genuine Unobtrusive script.

Continued ...

The new event handling in Flash CS3

I had already spoken in Flash CS3: The new event handling . I'll be back on the issue sublists for the difference of this new approach compared to previous versions of ActionScript. Schematically we have a general situation of this type:

addEventListener

Any object that supports events, ultimately exposing itself the addEventListener (). In the documentation, among other things, we read:

What's new for event listeners in ActionScript 3.0

[...] To add event listeners in ActionScript 2.0 is sometimes uses addListener () and sometimes addEventListener (), whereas in ActionScript 3.0 using addEventListener () in all situations.
[..]

Event management, then, is standardized at the level of real listeners. All the "features" of listening, in fact, have the following structure:

1
2
3
eventObject : EventType ) : void { eventResponse function (eventObject: EventType): void {
/ / The actions in response to the events are defined here.
}

o una sua sottoclasse. EvenType is always an object of class Event or a subclass. . This allows for more informations specific to the particular event in addition to handling standard properties such as target or currentTarget .

An important difference with previous versions of ActionScript, with respect to the listener, is that:

In ActionScript 2.0, event listeners can be either functions, methods or objects, whereas in ActionScript 3.0, event listeners can be only functions or methods.

In short, having used for some 'time to event structure from earlier versions of Flash, I must say that this new approach is really nice. It's a bit 'that development with Actionscript 3.0 and, after a small initial loss (just to regain what was taken for granted) now I can not understand how could I bear the "old" method of the events of the previous versions.

Continued ...

Flash CS3: The new event handling

Finally with ActionScript 3.0 no longer have two different management of events as they did before ActionScript 2.0 (see: Event management: similarities between Flash and Javascript ). The method addEventListener() , ubiquitous in the new architecture allows to manage new and exceptionally clean all possible events, even personal ones. The new organization in the package allows you to import the events that we serve and treat everyone equally:

1
2
3
4
/ / Events
. KeyboardEvent ; import flash.events. KeyboardEvent ;
. MouseEvent ; import flash.events. MouseEvent ;
. Event ; import flash.events. Event ;

Continued ...


Stop SOPA