| Previous | Next |
mProjector 4 Quick Start
mProjector is a powerful tool that enables you to create full-blown desktop applications using Flash. mProjector 4 Mac supports Mac OS X 10.4.0 and later. mProjector 4 Windows supports Windows 2000 and later.
If you know Flash and a little ActionScript, creating a desktop application with mProjector is easy. We've included a few short tutorial videos and step-by-step instructions that will get you up and running in a few minutes.
mProjector Tutorial Videos
-
Using Flash, AS 3.0 and mProjector to build a simple desktop application. -
Using Flex, AS 3.0, and mProjector to build a simple desktop application.
Basic Step-by-Step Instructions:
1a) Install mProjector.
Download and install mProjector.
1b) Install the Flash Extension for mProjector. (The installer will attempt to do this automatically)
Click mProjector's menu button and select "Install Flash Extension for mProjector" menu item to install mProjector's Flash Extension. This extension installs mProjector ActionScript classes and documentation into the Flash IDE. Once the extension is installed, Flash will recognize mProjector ActionScript and you will be ready to design you first application. Without this extension, the Flash compiler will fail when compiling mProjector commands.
2) Add the mProjector to your Flash FLA or Flex Project
In Flash, code completion and function parameter tips for mProjector commands are active once you install the Flash mProjector mxp (see Step 1b) making it easy to write mProjector code.
If you are developing in AS 3.0, you need the mProjector component in your Flash FLA or Flex project to enable mProjector commands in your application.
To enable mProjector commands in your Flash SWF application, drag and drop the mProjector component from Flash's Components Panel into your FLA's Library.
To enable mProjector commands in your Flex application, add the mProjector Flex SWC to your project's library paths.
- With a project selected in the Navigator view, select Project > Properties > Flex Build Path.
Select the Library tab.
The core library (SWC) files, such as frameworks.swc and playerglobal.swc, appear. - Select Add SWC.
- Enter or browse to and select the location of the SWC file. It's installed in next to mProjector.
Windows: C:/Program Files/mProjector 4.x.x/mprojector_4_flex.swc
Mac: /Applications/mProjector 4.x.x/Flex/mprojector_4_flex.swc
NOTE: mProjector commands become effective once the SWF is compiled into an application with the mProjector compiler. mProjector commands have no effect when the SWF is played by the Flash player.
3) Design your application in Flash or Flex.
Design your application in Flash or Flex as you would any web application. Include mProjector functions and event handlers to create any extra functionality you require, such as displaying an icon in the system tray, creating a shortcut, controlling multiple windows, or choosing files. The mProjector classes follow ActionScript (AS) syntax.
Sample mProjector ActionScript
To center your application's window on the the primary monitor add the mProjector command mWindow.center() to your ActionScript.
// Sets window position to the center of the primary monitor mWindow.center();
To add the ability to minimize your window by clicking your own custom minimize button, add the mProjector command mWindow.minimize() to the button's onPress event handler.
// Minimize button
minimize_btn.onPress = function() {
mWindow.minimize();
}
To make your window draggable, add a drag brag in the form of a button or movieclip and add mWindow.startDrag() to it's onPress event handler. Dragging stops automatically when the user releases the mouse or when you call mWindow.stopDrag()
// Draggable window frame
window_frame_mc.onPress = function () {
mWindow.startDrag();
}
To enable the user to quit the application, you can add a quit button and call mApplication.quit() in it's onPress event handler.
// Quit button
quit_btn.onPress = function() {
mApplication.quit();
}
More mProjector ActionScript...
mApplication.enableAutoTrace(true); // Tells mProjector to trace all commands.
mWindow.setZOrder("STANDARD"); // Sets window Z-order behavior to normal
mWindow.setTitle("Basic Application"); // Sets window application and window title
mApplication.showOnTaskBar(true); // Adds a button in the Windows taskbar for the application.
mApplication.trace("initialization complete"); // trace message
mProjector documentation is available in the Flash CS3 Help Panel, Flash CS4 Flash Help Directory, and online.
To find the mProjector documentation in Flash CS3, open the Help panel, select the "Help" tab, open the Help Contents pane by clicking the arrow on the left-most window border of the Help panel, and scroll the Contents pane until you see the "mProjector" book.
If you are a Flash CS4 user, mProjector documentation installs into the Flash Configuration/HelpPanel/Help directory. Open the index file in your favorite browser and bookmark the page for later use or highlight any mProjector command in your code, right click, and select
Mac: file:///Users/[username]/Library/Application Support/Adobe/Flash CS4/[language code]/Configuration/HelpPanel/Help/mProjector/index.html
XP: file://C/Documents and Settings/[username]/Application Data/Adobe/Flash CS4/[language code]/Configuration/HelpPanel/Help/mProjector/index.html
Vista: file://C/ProgramData/[username]/Application Data/Adobe/Flash CS4/[language code]/Configuration/HelpPanel/Help/mProjector/index.html
4) Compile your SWF into an application.
Once you complete the development of your application's SWF(s), launch the mProjector compiler from the Start menu on Windows, or from the Applications Folder on the Mac.
Specify your SWF as the Main Application SWF.
Click "Build" in the mProjector compiler to build your application.
That's all there is to it.
For detailed information on using mProjector, please read Getting Started - Flash and Getting Started - Flex
For information on debugging your mProjector commands, please read Debugging in Flash and Debugging in Flex.
Visit DevCenter for more sample code and documentation.
| Questions or Feedback? | Previous | Next |
- AS2 Migration
- Getting Started - Flash
- Debugging in Flash
- Building your application from inside Flash
- Getting Started - Flex
- Debugging in Flex
- 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
- 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
