Articles Tagged 'Event'

jQuery snippets

Verify the existence of an element in the DOM

You will ever have to check the existence of an element in the DOM. With jQuery could be spontaneous try:

Read more ...

How to hide the close button of a jQuery UI dialog

While waiting for the official release of jQuery UI 1.7 (oh yeah, the jQuery development team has decided that it will release the version as 1.7, due to confusion), where perhaps one option is to remove the close button of a dialogue, here's how quickly resolve the problem with the current 1.6rc6:

Read more ...

Very short trick: ADDED_TO_STAGE

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

Read more ...

Actionscript 3.0: MovieClip MovieClip over

Just a developer Flash / Actionscript is preparing to write a function similar to a tooltip, clashes immediately with the problem of propagation of events between MovieClip superimposed. In fact if a MovieClip (B) overlaps to a MovieClip (A) that responds, for example, to an event MouseEvent.Mouse_OVER , passing with the mouse on the MovieClip (B) higher no event will more intercepted by MovieClip (A):

MovieClip MovieClip over

Read more ...

Create custom events in Actionscript 3.0

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

package {
/ *
** @ Name:
** @ Description: Class derived from Event to manage their own custom event
** @ Author: = undo =
@ ** Web:
** @ Email: @ g.fazioli
* /
.*; import *;

BottoneEvent extends Event { public class BottoneEvent extends Event {

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

Valore : Number = NaN ; public var value: Number = NaN;
/ *
** @ Name: BottoneEvent
** @ Description: constructor
* /
public function BottoneEvent ( type : String , v : Number , bubbles : Boolean = false , cancelable : Boolean = false ) : void {
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 ) ; return new KnobEvent (this. type, this. Value, this. bubbles, this. cancelable);

Read more ...

Unobtrusive Javascript: a bit 'of clarity and eye imposters

Some scripts, and some Web use some Javascript functions impersonating non-intrusive (Unobtrusive), even when they are not at all. What makes a script (usually JavaScript) non-intrusive? Basically a JavaScript script is non-intrusive when you can do without it! Put very simply! In the development of 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.

Read more ...

The new event handling in Flash CS3

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


Any object that supports events, ultimately, always exposes the addEventListener () method. In the documentation, inter alia, read:

What's new for event listeners in ActionScript 3.0

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

The management of the events, then, is standardized at the level of real listener. All of the "functions" of listening, in fact, have the following structure:

eventObject : EventType ) : void { function eventResponse (eventObject: EventType): void {
/ / Actions incident response must be defined here.

o una sua sottoclasse. EvenType is always an object of class Event or one of its subclasses. . This allows you to get more informations specific to the particular event as well as manipulate the standard properties such as target or currentTarget .

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

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, we have used for quite a while 'time the event structure of previous versions of Flash, I have to 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.

Read more ...

Flash CS3: the new event management

Finally with ActionScript 3.0, we no longer have two different managements of events as happening before ActionScript 2.0 (see: Event Management: similarities between Flash and Javascript ). The method addEventListener() , omnipresent in the new architecture allows to manage in a new and exceptionally clean all possible events, even personal ones. The new organization in package allows you to import the events that we serve and treat them all the same way:

/ / Events
. KeyboardEvent ; import KeyboardEvent ;
. MouseEvent ; import MouseEvent ;
. Event ; import Event ;

Read more ...