Support » OpenSpace installation
Before proceeding, you will need to download the OpenSpace package and unzip it to a folder of your choice. The downloaded package contains the components for the Flash platform, the OpenSpace Editor and the required SmartFoxServer extension. This manual refers to the OpenSpace version compatible with SmartFoxServer 2X, so in the folder of the package containing the components and the extension just consider the files with the _2X suffix.
For the installation instructions of the OpenSpace version compatible with SmartFoxServer PRO, follow this link.
OpenSpace Flex component
OpenSpace is compatible with Flex SDK 3.5 or later. To use OpenSpace in Adobe Flex Builder 3 or later (Flash Builder), you can simply drop the OpenSpace_Flex_2X.swc file in the libs/ folder of your Flex/Flash Builder project. The SWC is located at [unzip location]/Client/Components/OpenSpace_Flex_2X.swc.
Alternatively you can add the component SWC to your Library path by following these instructions:
- locate your project in the Flex Navigator panel (Package Explorer panel in Flash Builder);
- right-click on the project and choose Properties, or open the Project menu and choose Properties;
- in the project properties dialog, choose Flex Build Path;
- select the Library path tab, and press the Add SWC... button;
- enter the location of the component SWC, which should be [unzip location]/Client/Components/OpenSpace_Flex_2X.swc;
- press OK in the Add SWC dialog;
- press OK to close the project properties dialog.
OpenSpace is now available in your project. Create a new MXML application (or open an existing one), switch to Design view if necessary and drag the OpenSpace component from the OpenSpace folder in the Components panel to the stage.
NOTE FOR FLASH BUILDER 4 USERS
In Flash Builder 4, when the Flex SDK 4 or later is used, the following warning may be displayed when switching to the Design view: "Design mode could not load OpenSpace_Flex_2X.swc. It may be incompatible with this SDK, or invalid. (DesignAssetLoader.CompleteTimeout)". This is a bug in Flash Builder that affects most swc files of other popular projects. Even if the OpenSpace component is not visible in design view, this does not affect the compilation or the project in any way.
For avatars implementation and other customizations you may also need to install the Flash component and the other add-ons described in the next section.
OpenSpace Flash component
To use OpenSpace and its additional components (for example the AvatarLibrary) in Adobe Flash CS3 or later, double click on the OpenSpace_Flash_2X.mxp file located at [unzip location]/Client/Components/OpenSpace_Flash_2X.mxp. The Adobe Extension Manager will open, guiding you in the easy installation process.
OpenSpace is now available in Flash. Open Flash, create a new ActionScript 3 FLA file (or open an existing one) and drag the OpenSpace component from the OpenSpace 2 for SFS2X folder in the Components panel to the stage.
NOTE FOR FLASH CS5 USERS
The initial version of Flash CS5 contained a bug preventing the correct installation of the OpenSpace component: after installing the MXP file using the Extension Manager as described above, you were not able to drag the component from the Components panel to the stage, or to the Library panel. This bug was fixed by the Flash development team, so make sure you install the latest version.
Besides the main OpenSpace component, the MXP package installs the following additional components, always located in the OpenSpace 2 for SFS2X folder of the Components panel:
- AvatarLibrary: it is a non-visual component containing the Avatar class, required by the avatars implementation workflow to create custom avatars for the OpenSpace engine;
- HelperGrid and HelperGrid2: these are accessory components useful to design isometric maps in the Flash authoring environment before implementing them in the OpenSpace Editor application.
Please read this document for the installation instructions of the OpenSpace Editor.
OpenSpace requires SmartFoxServer 2X and a dedicated server-side extension to run. This is a Zone-level extension which takes care of loading and caching map and inventory data, send maps to clients, save maps modified by users at runtime, calculate avatar paths, etc. To install the OpenSpace Extension, follow these instructions:
- unzip the content of the OpenSpace_Extension_2X.zip file, located at [unzip location]/Server/OpenSpace_Extension_2X.zip, to the SFS2X/extensions/ folder inside the SmartFoxServer 2X installation folder;
- if you are using SmartFoxServer 2X v2.12 or later, copy the [unzip location]/Server/sfs2x-util.jar file to the SFS2X/lib/ folder inside the SmartFoxServer 2X installation folder, overwriting the existing file;
- configure a Zone so that it makes use of the OpenSpace Extension (like in the provided example - see next paragraph);
- stop SmartFoxServer if running, and restart it.
Developers can extend this class in order to add their own application logic to the core OpenSpace functionalities. Read this tutorial for more informations.
Running the example
In order to run the example provided in the downloaded package, under the [unzip location]/Examples/SmartFoxServer2X/ folder, follow these instructions:
- install the OpenSpace Extension as described in the previous section of this document;
- make sure the data folder located at [SFS installation location]/SFS2X/extensions/openSpace/data/ contains the example maps (this is the default condition when the OpenSpace Extension is installed);
- copy the osExample1.zone.xml file to the [SFS installation location]/SFS2X/zones/ folder — this configures the SmartFoxServer 2X Zone and Rooms used by the example;
- stop SmartFoxServer if running, and restart it; make sure no errors are thrown when the example Zone is initialized;
- install the example:
- Flex: in Flex Builder 3 (or later) open the File menu and choose Import > Flex Project...; locate the Flex.zip file and follow the instructions provided by Flex/Flash Builder.