| Previous | |
mWindowEvent.SCROLL_WHEEL constant
| Support | PC | Mac | Package (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 SCROLL_WHEEL:String = "onScrollWheel";
Defines the value of the type property of an onScrollWheel Event object. This event is fired when the mouse scroll wheel is used.
Register for onScrollWheel events using mWindow.addEventListener().
This event has the following properties:
| Property | Value |
|---|---|
scrollDelta |
|
This AS3.0 onScrollWheel event replaces mProjector's AS2.0 event handler function mWindow.onScrollWheel().
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.onScrollWheel()
| Questions or Feedback? | Previous | |
More Information
Getting Started
ActionScript 3.0 Support
- AS2 Migration
- Getting Started - Flash
- Debugging in Flash
- Building your application from inside Flash
- Getting Started - Flex
- Debugging in Flex
ActionScript 3.0 Samples
Using mProjector
- Using mProjector - Compile Your SWF into an Appli
- Customizing The About Window
- Debugging Your Application
- Launching Application at Startup
- Mac vs. Windows Application Development
- Menus
- Dynamic Window Creation
ActionScript 2.0 Samples
- Application Basics
- mProjector Class Basics
- Add Remove Programs Control Panel
- Fullscreen and Center
- Check Connection and Download File
- Choose Files
- Creating an Installer
- Creating and Controlling Multiple Windows
- Cut, Copy, and Paste (Windows)
- Desktop Shortcut and Start Menu Support
- Drag and Drop Files
- Embedding HTML and other Media types
- Flash-Shaped Windows
- Message Box
- Open Documents
- Project Files
- Reading and Writing to Hard Drive
- Startup Application
- Wallpaper and Screensaver
- Window to Window Communications
- Working with Included Files
- Context Sensitive Menus
- Alert User
- Screen Resolution
