mWindowEvent.ACTIVATE constant

SupportPCMacPackage (AS3) / Scope (AS2)
ActionScript 3.0

4.0 or later

4.0 or later

stm.mprojector.mWindow stm.mprojector.mWindowEvent

ActionScript 2.0

public static const ACTIVATE:String = "onActivate";

Defines the value of the type property of an onActivate Event object. This event is fired when the application becomes the active desktop application.

Register for onActivate events using mWindow.addEventListener().

This AS3.0 onActivate event replaces mProjector's AS2.0 event handler function mWindow.onActivate().

Property Value
active

Boolean; true=active window, false = not the active window

ActionScript 3.0 Example:

The following example code sets up event listeners for the mWindowEvent events.

import stm.mprojector.mWindow;
import stm.mprojector.mWindowEvent;

function windowEventHandler(e:mWindowEvent):void {
	switch (e.type) {
		case mWindowEvent.ACTIVATE :
			//doSomethingCoolToMakeWindowStatesDistinct (e.active);
			break;
		case mWindowEvent.DOCUMENT_COMPLETE :
			//if (!e.error)
			//	doSomethingWithDocumentURL (e.documentURL);
			break;
		case mWindowEvent.DRAG_FILES :
			//isThisTheKindOfFileWeCanPlay_switchCursor (e.files);
			break;
		case mWindowEvent.DROP_FILES :
			//doSomethingWithFiles (e.files);
			break;
		case mWindowEvent.MAXIMIZED :
			//doSomethingMaximized ();
			break;
		case mWindowEvent.MINIMIZED :
			//doSomethingMinimized ();
			break;
		case mWindowEvent.RESTORED :
			//doSomethingRestored ();
			break;
		case mWindowEvent.SCROLL_WHEEL :
			//doSomethingScrollWheelie (e.scrollDelta);
			break;
		default:
			break;
	}
}

// == initialize listeners ====

function initListeners():void {
	// window events
	
	mWindow.addEventListener(mWindowEvent.ACTIVATE, windowEventHandler);
	mWindow.addEventListener(mWindowEvent.DOCUMENT_COMPLETE, windowEventHandler);
	mWindow.addEventListener(mWindowEvent.DRAG_FILES, windowEventHandler);
	mWindow.addEventListener(mWindowEvent.DROP_FILES, windowEventHandler);
	mWindow.addEventListener(mWindowEvent.MAXIMIZED, windowEventHandler);
	mWindow.addEventListener(mWindowEvent.MINIMIZED, windowEventHandler);
	mWindow.addEventListener(mWindowEvent.RESTORED, windowEventHandler);
	mWindow.addEventListener(mWindowEvent.SCROLL_WHEEL, windowEventHandler);
}

initListeners();

See Also

mWindow.addEventListener(), mWindow.onActivate()

levitra rezeptfrei buy viagra for women online uk