Welcome to mProjector AS3 beta page. This page gives you access to the latest mProjector builds, samples, and documentation.
We really appreciate ANY feedback you can give us. Drop us a post in the beta forum or send us an email ( b r i a n a t s c r e e n t i m e d o t c o m ).
What is mProjector?
Download Beta
Sample Applications
Beta Status and Known Issues
Suggestions
Coding your Application.
AS2 Support
AS2 Migration and the Missing AS3 Documentation
Working with Flash CS3
Getting Started with mProjector and Flash CS3
Debugging your application in Flash CS3
Building your application from inside Flash CS3
Working with Flex
Getting Started with mProjector and Flex 2.0
Debugging your application in Flex -- NATIVELY!
Building an mProjector application from inside Flex
mProjector enables you to build rich-internet applications for the desktop using Adobe Flash. mProjector AS3 beta adds support for ActionScript 3.0 and your favorite new Flash IDE - Flash CS3 or Flex.
mProjector apps are single file executables that require only the Flash plug-in be installed on the user's machine -- something that's probably already true if they are checking out your web site.
mProjector supports dynamic Flash-shaped windows, alpha channels, and anti-aliasing for both Windows and Mac OS X. Whatever you draw on the Stage will draw directly on the desktop -- in real time.
Your mProjector apps can be very lite (<300 Kb zipped).
See "mProjector… Crank it to Eleven" for more information.
Mac OS Download - The AS3 Beta has been rolled into mProjector 3.1 (simply check the AS3 box in the builder)
Windows OS Download - coming soon -- no specific availability date yet.
BETA STATUS - We are wrapping development on the mProjector's API and the Mac Builder application but still working working on mProjector Windows and formal documentation.
Issues:
We really appreciate any feedback (good or bad) you can give us. Drop us a post in the beta forum or email us comment ( b r i a n a t s c r e e n t i m e d o t c o m ) if you run into a bug or have any suggestions.
mProjector AS3 Beta supports preivous versions of Flash and ActionScript. Before publishing your AS1 / AS2 SWF as a Desktop Application click mProjector's Publish tab and UNCHECK the AS3 check box.
We are working on mProjector 4 documentation but it's not ready. Most functionality is similar to AS2-based mProejctor V3, so we thought we'd get a release out using the V3 docs BUT please note the following IMPORTANT DIFFERENCES.
Differences between the AS2 and AS3 implementation of mProjector's Desktop Classes:
import stm.mprojector.mWindow;
mWindow.setPosition(50, 50);// set the window position to x=50, y=50 on the desktop.
import stm.mprojector.*;
function initListeners():void {
mApplication.addEventListener(mApplicationEvent.APPLICATION_ACTIVATE, applicationEventHandler);
mApplication.addEventListener(mApplicationEvent.APPLICATION_DEACTIVATE, applicationEventHandler);
mApplication.addEventListener(mApplicationEvent.QUIT, applicationEventHandler);
mApplication.addEventListener(mApplicationEvent.SCREEN_CHANGE, applicationEventHandler);
mApplication.addEventListener(mApplicationEvent.MESSAGE, applicationEventHandler);
mApplication.addEventListener(mApplicationEvent.SYSTEM_TRAY, applicationEventHandler);
mApplication.addEventListener(mApplicationEvent.DOWNLOAD_FILE_PROGRESS, applicationEventHandler);
//
mApplication.addEventListener(mWindowEvent.WINDOW_ACTIVATE, windowEventHandler);
mApplication.addEventListener(mWindowEvent.WINDOW_DEACTIVATE, windowEventHandler);
mApplication.addEventListener(mWindowEvent.CLOSE, windowEventHandler);
mApplication.addEventListener(mWindowEvent.DOCK, windowEventHandler);
mApplication.addEventListener(mWindowEvent.UNDOCK, windowEventHandler);
mApplication.addEventListener(mWindowEvent.DRAG_FILES, windowEventHandler);
mApplication.addEventListener(mWindowEvent.DRAG_LEAVE, windowEventHandler);
mApplication.addEventListener(mWindowEvent.DRAG_STRING, windowEventHandler);
mApplication.addEventListener(mWindowEvent.MINIMIZE, windowEventHandler);
mApplication.addEventListener(mWindowEvent.RESTORE, windowEventHandler);
mApplication.addEventListener(mWindowEvent.SCROLL_WHEEL, windowEventHandler);
mApplication.addEventListener(mWindowEvent.MOUSE_MASK_DOWN, windowEventHandler);
mApplication.addEventListener(mWindowEvent.MOUSE_MASK_UP, windowEventHandler);
//
mApplication.addEventListener(mMenuEvent.COMMAND, menuEventHandler);
}
function applicationEventHandler(e:mApplicationEvent):void {
mApplication.trace(new Date().toString() + ": mApplication " + e.type + " event");
switch (e.type) {
case mApplicationEvent.APPLICATION_DEACTIVATE:
current_runmode = "inactive_app";
// do something
break;
case mApplicationEvent.APPLICATION_ACTIVATE:
current_runmode = "active_app";
// do something
break;
case mApplicationEvent.RESTART:
mApplication.trace("commandLineArgs: " + e.commandLineArgs.toString());
// do something
break;
case mApplicationEvent.DOWNLOAD_FILE_PROGRESS:
mApplication.trace("sessionID: " + e.sessionID.toString() + " total: " +
e.total.toString() + " read: " + e.total.toString());
// do something
break;
}
}
function windowEventHandler(e:mWindowEvent):void {
mApplication.trace(new Date().toString() + ": mWindow " + e.type + " event");
switch (e.type) {
case mWindowEvent.DRAG_FILES:
// handle drag
break;
case mWindowEvent.DROP_FILES:
// handle drop
mApplication.trace("files: " + e.files.toString());
case mWindowEvent.DRAG_STRING:
case mWindowEvent.DROP_STRING:
mApplication.trace("string: " + e.text);
// handle string
break;
}
}
function menuEventHandler(e:mMenuEvent):void {
mApplication.trace(new Date().toString() + ": mMenu " + e.type + " event");
mApplication.trace(e.target.menu + " " + e.item);
// handle menu selection
}
initListeners();
// Download File Event Handler
import stm.mprojector.*;
function downloadProgress(e:mApplicationEvent):void {
mApplication.trace("sessionID: " + e.sessionID.toString() + " total: " +
e.total.toString() + " read: " + e.total.toString());
}
mApplication.addEventListener(mApplicationEvent.DOWNLOAD_FILE_PROGRESS, downloadProgress);
var sessionID:uint = mApplication.downloadFile(localFileName.jpg, http://www.screentime.com/temp/1.jpg);
// ActionScript in child.swf
import stm.mprojector.mWindow;
// define function
function messageReceiver (message: String):void {
message.text = message;
};
// register messageReceiver as callable by other windows.
mWindow.addCallback("messageReceiver", messageReceiver);
// ActionScript in parent.swf
childWindow = mApplication.createWindow("child.swf", 50, 50, "CHILD", "CHILD", "STANDARD",
160000, true, 100, true, true, "");
if (childWindow != null) {
mApplication.trace("childWindow: " + childWindow.toString());
childWindow.messageReceiver("hello from parent");
}
};
// ActionScript in child.swf
mWindow.messageReceiver = function (message: String):void {
message.text = message;
};
// ActionScript in parent.swf
childWindow = mApplication.createWindow("child.swf", 50, 50, "CHILD", "CHILD", "STANDARD",
160000, true, 100, true, true, "");
if (childWindow != null) {
mApplication.trace("childWindow: " + childWindow.toString());
childWindow.messageReceiver("hello from parent");
}
};
// set window title and center the application on the desktop.
import stm.mprojector.mWindow;
mWindow.setTitle("Hello mProjector");
mWindow.center();
Nothing here has changes since the last version. If you are developing using Flash CS3, you will use mApplication.trace() and the Console window (on the Mac or TraceViewer on the PC) to debug your application at runtime.
mProjector functionality is only available after the SWF is compiled into an application and NOT at SWF runtime in the Flash CS3 debugger. For example, when playing as SWF in the Flash IDE calling mWindow.center() does not move the window. If autotracing is on, you will see the command trace to the Flash IDE window but nothing will happen. The method becomes effective once the SWF is compiled into an application and run.
For more information on Flash IDE and mApplication.trace() debugging see Debugging your Application.
After you install mProjector you will see a bunch of "mProjector" items in the Flash IDE "Commands" menu. To compile and run an mProjector application from inside the Flash IDE perform the following steps.
If you want to take it a step further, you can assign these commands keyboard shortcuts (Files->Keyboard Shortcuts).
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
layout="vertical"
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>
If you are developing an application using Flex, you can debug your application NATIVELY within the Flex debugger with valid mProjector return values and full desktop functionality.
The trick to debugging in Flex is to change your "launch configuration" target to be the mProjector application created from your Flex SWF instead of the standard Flex web application. Once modified, you can can run your application using the "Run" menu or run/debug buttons in the Flex Debugging workspace.
First build your swf. Then open mProjector and build your application with the project's debug SWF.
Flex provides a mechanism for running external tools like mProjector from inside the IDE. This enables you to run mProjector as if you where running it from the UNIX command line where you call mProjector with a "-c" command line flag and a path to the mProjector project file containing your application and publish settings.
/Applications/mProjector /mProjector.app/Contents/MacOS/mProjector -c "pathToMProjectorProjectFile"
Before configuring mProjector as an external tool, create an mProjector project file for your application (.mproj) and save it next to your applciation SWF in the Flex project's bin directory.
To configure an mProjector as an executable tool in Flex:
It is also possible to set up and run an external tool to build a project.