| Previous | Next |
Getting Started with mProjector and Flex
- Download and install mProjector v4.
- Create a new MXML application. HelloWorld
- In Flex Builder, select File > New> Flex Project,
If the New Flex Project dialog box asks you to select a Flex Server Technology, select Basic, and then click Next.
Type HelloWorld as the Project Name, and then click Finish.
Your new project will be created and should be showing in the Navigator panel. By default the project should already contain a file named HelloWorld.mxml, and that file should be open in the Editor panel. - Open the HelloWorld.mxml file, and type the following code:
To access mProjector classes and methods add an import statement stm.mprojector.mClassName then utilize the class. All mProjector classes and methods are listed in the Flash Help Panel and online in our Dev Center. In this example the initApp() function sets the window title and centers the window. Also add scriptTimeLimit="65000" to the mx:mApplication tag to avoid Flash timeout limits.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="vertical" scriptTimeLimit="65000" creationComplete = "initApp()" > <mx:Script> <![CDATA[ public function initApp():void { //set window title and center the application on the desktop. import stm.mprojector.mWindow; mWindow.setTitle("Hello mProjector"); mWindow.center(); } ]]> </mx:Script> <mx:TextArea id = "mainTxt" width="400" /> </mx:Application>
- In Flex Builder, select File > New> Flex Project,
- Select File > Save to save the application.
- Add the mProjector Desktop Classes (SWC File) to your project's library path:
- 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/mprojector_flex.swc
Mac: /Applications/mProjector 4/Flex/mprojector_flex.swc - Set your "link-type" option to merger the SWC into the application SWF file when compiled:
- With a project selected in the Navigator view, select Project > Properties > Flex Build Path.
- Select the Library tab, and then select and expand the SWC file entry to display the SWC options.
- Double-click the Link Type option. The Library Path Items Options dialog box appears.
- Select the Merged into Code option, and click OK.
This procedure is the equivalent of using the library-path compiler option. - Publish your application SWF in Flex.
- Publish your SWF as a Desktop Application using mProjector.
- Open mProjector.
- Set your SWF as the main application SWF - Select mProjector's Application tab and drag-n-drop your SWF on the mProjector.
- Set your application settings - application title, icon, window type, included files, etc.
- Click the Build button. By default mProjector will launch your application when it's ready.
| Questions or Feedback? | Previous | Next |
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
