1. NyxFramework Introduction

(This introduction is build on a Flash Builder base project, for creating websites without FlashBuilder the basics are simmilar, the workflow changes a bit)

Impotant: This introduction is not for ActionScript beginners, I assume that you know ActionScript 3 basics and how to use basic functions of FlashBuilder and Flash.

NyxFramework is basically a set of libraries that make your life easier if it comes to creating websites in flash. Most important classes are: NyxApplication, NyxController and Asset classes. The rest (plugins, controllers ect.) is optional and you don’t need to know them for a basic usage, but it you want to have more controll over your website you should check them out in the reference.

First thing you need to do is download the basic package from the download section or you can use this link:

 2. Exploring the package

The source package contains few folders:

  • NyxBaseProject
  • Source
  • SWC
  • license.txt

NyxBaseProject

This is a simple base FlashBuilder ActionScript project from witch you can begin your developement. We’ll be using BaseProject in this guide.
(The BaseProject is a simple ActionScript project that you could also use to different projects in witch you don’t use the NyxFramework)

Source

Contains all library sources for NyxFramework in the src folder and the MonsterDebugger.swf in swc.

SWC

Contains the SWC version of NyxFramework, you may want to use this instead the raw source files but remember that when you want to use different libraries of scripts that are included in NyxFramework package you should use files from Source folder insted the SWC package and replace some classes with different versions.

 3. Create your project

Import the BaseProject folder into FlashBuilder workspace. Change the name of the project (so that when you’ll import it again it won’t throw an duplicate error). For purpose of this guide I’ll name it QuickWebsite.

Next we need to include the NyxFramework and other required libraries, there are two ways of doing it, you can point your project to the source folders from project propereties or copy the source files or the swc package.

Tip: You may consider including external libraries in the project so that when you upload your project to SVN or when you share files with your friends you’re sure that they get the correct version of files.

Copying the sources

Copy the sources  from NyxFramework package Source folder to the src/ folder in your project or copy the NyxFramework SWC package from package SWC/ folder to your project swc/ folder.

After we include NyxFramework libraries we need to create a correct Default Application Class that we will run in the browser.
Our class should extend the com.nyxframework.NyxApplication class  witch extends the flash.display.Sprite class.

Let’s create a package quickstart and than in it create an ActionScript Class named QuickStartWebsite that extends from com.nyxframework.NyxApplication and after creating it set it as DefaultApplication.
At this point you should delete the old Application file cause we won’t need it anymore (you may also make changes to the default Application created in the Project insted of creating a new Class).

After the Default Application file is selectd we should change the file path in bin-debug/index.html so that we embed the correct file. By default you have the filepath variable on line 13 and it’s set to ”source/NyxBaseProject.swf” – change it to your file name, in this case it’s “source/QuickStartWebsite.swf”.

Last thing we need to do is to prepare a Launch Configuration for our project. Go to project Propereties->Run/Debug Settings->New->Web Application and than uncheck the ‘Use Default’ field and change the path from (…)/bin-debug/source/QuickStartWebsite.swf to (…)/bin-debug/index.html so that when we run the application the index.htl will be opened insted of swf file.

So that is the basic project setup, if you want to read more about it jump to the NyxBasicProject reference page.

Now we need to check if the NyxFramework is beaing initiated properly. Debug the project. You should see a simmilar message in the debug window output:

NyxFramework v.0.51 "Alkio" (Beta)
More information on: http://nyxframework.com/
Documentation on: http://nyxframework.com/_LINK_TO_ADD_/
Thank you for using ;)
----------------------

If you can see that and no errors were thrown, it means that everything is set up correctly and you can proceed with creating your website :)

After our project is running and we know that everything is OK you may proceed to configuring your SiteModel, PageModels and adding assets to them.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>