Feeds:
Posts
Comments

Archive for the ‘SharpStyle Neutron’ Category

Our team uses Neutron inside our main product ReviewBasics. That is a really big Visual Studio 2005 solution (55+ projects), including several Neutron projects. In other words, our team is “building next generation Rich Internet Applications that combine Flash on the front-end and .NET on the server-side”, as the home page of Neutron website says.

Currently our flash front-end uses some quite big 3rd-party AS2 libraries which are referenced to Neutron projects (see the note below). The classes within the libraries participate in code complete operations, so it takes some time for IntelliSense database initialization while the project is loading.

Note: Neutron supports Zip reference feature that allows you to link an external library as a zip file, and Neutron automatically unzips and references classes within.

Actually, such possibilities are not needed for our server-side .NET part of the team. Most of them never touch the AS2.0 code. All they need is to compile this code while rebuilding the entire solution.

Well, that can be easily switched off. To disable IntelliSense database creation on project loading go to ‘Tools’ -> ‘Options’ in the main Visual Studio 2005 menu. Select ‘Projects and Solutions’ -> ‘Neutron Project Settings’ in the appearing Options dialog, and uncheck ‘Enable IntelliSense’ checkbox. Next time the projects will be loaded without IntelliSense initialization phase.

In addition, on this option page you can set the path, where MTASC compiler is located. That can be useful if you want to compile with HAMTASC instead. See How To: Substitute MTASC with HAMTASC tutorial.

Also, you can manage cache directory for ZIP references used in your Neutron project.

Enjoy!

 

~ Dmitry

Read Full Post »

SharpStyle Neutron uses excellent open source ActionScript compiler called MTASC developed by Nicolas Cannasse. Click here to read Comparison with Macromedia ActionScript compiler. But if you are an advanced ActionScript developer, you might also be familiar with HAMTASC. SharpStyle Neutron makes it very easy to substitute one compiler with another.

This tutorial will demonstrate how to substitute MTASC with HAMTASC.

Actually, it is very easy in Neutron. There are a few steps to do:

1. Open Hello World sample in Visual Studio 2005 and compile it. As you can see in Output window screenshot below, HelloWorld project has been successfully built with MTASC:

Compilation result in Visual Studio Output window

2. Now let’s substitute MTASC with HAMTASC compiler. You can set the path to the compiler in Visual Studio under Tools -> Options -> Projects and Solutions -> ActionScript Project Settings -> MTASC path. Browse the HAMTASC executable file mtasc.exe and then press OK to apply the changes. 

Tools -> Options -> Projects and Solutions -> ActionScript Project Settings -> MTASC path 

3. Build the project again, but this time with HAMTASC compiler:

Compilation result in Visual Studio Output window

4. As you might know HAMTASC uses some additional compilation options, which can be added to compilation command thanks to Neutron Project Properties:

HelloWorld project Project Properties in Visual Studio 

Enjoy!

 

~ Dmitry

Read Full Post »

If you are interested in joining Neutron Beta group, please email us: neutron@sharpstyle.com

 

This release includes the following fixes/enhancements:

  • Fixed: Visual Studio would freeze when compiling a large project
  • Fixed: Go to Definition for functions with parameters didn’t make correct selection
  • Fixed: multiple Zip files with same name will cause issues
    • Neutron supports Zip reference features that allows you to link an external library as a zip file and Neutron automatically unzips and references classes within. If you had multiple projects referencing zip file with the same name, AS classes would be unzipped into the same folder. This release resolves this issue
  • Fixed: HTML template file validation in Project Properties->Run for ‘Run in default application … ’ option
  • Compilation process now shows output line by line
  • Parsing performance optimization — significant improvements when parsing large libraries to display IntelliSense 
  • Added checkbox to enable/disable IntelliSense
  • Added default empty class to ActionScript Library template
  • Added UI for changing the Zip reference cache path and clearing cached libraries (under Tools->Options->Projects’n’Solutions->ActionScript Project Settings->Reference Cache)
  • Added browse button for “main class” in Project Properties
  • Other minor bug fixes and changes

 

~Mike

Read Full Post »

This tutorial will demonstrate how to setup a project in order to easily trace your code.

We will be using Powerflasher SOS.

Powerflasher SOS (SocketOutputServer) is an XML Socket server with a graphic user interface. Connected clients can send messages to SOS. These messages are shown in SOS. Further on commands from SOS to Client can be sent. These are freely configurable.

It requires JavaVM starting from 1.3: http://java.com/en/download/index.jsp

This tutorial will demonstrate the following steps:

  • Download and run Powerflasher SOS
  • Create new ActionScript Application
  • Write code that will allow our application to “trace” to Powerflasher SOS using XMLSocket
  • Specify additional compilation parameter: -trace “Main.myTrace”. Compiler will replace all “trace()” statements with a call to Main.myTrace which will send messages over XMLSocket to SOS
  • We will then add
    • new ActionScript Class
    • two SWF files that will serve as ON/OFF states
  • We will then show the following
    • Loading resources
    • MovieClip.onRollOver, MovieClip.onRollOut events

Source code is here.

Click the image below to launch:

 

Here is the code for your reference:

class Main
{
    private static var sock : XMLSocket;
    static function main()
    {
        Stage.align = "TL";
        Stage.scaleMode = "noScale";
        
        if (_root.enableTrace == "true")
        {
            enableTrace();
        }
        trace("main() called");
        var app : App = new App();
        app.Start();
    }
    private static function enableTrace() : Void
    {
        sock = new XMLSocket();
        sock.connect("localhost", 4444);
        trace("connected");
    }
    public static function myTrace(obj : Object, fullclass : String, file : String, line : Number) : Void
    {
        sock.send("msg: " + obj + " (class: " + fullclass + ", line: " + line + ")\n");
    }
}
 
 
class App
{
    public function App()
    {
        
    }
    public function Start() : Void
    {
        var button : MovieClip = _root.createEmptyMovieClip("button", _root.getNextHighestDepth());
        button._x = 20;
        button._y = 20;
        
        var imageOn : MovieClip = button.createEmptyMovieClip("imageOn", button.getNextHighestDepth());
        imageOn.loadMovie("smiley_happy.swf");
        
        var imageOff : MovieClip = button.createEmptyMovieClip("imageOff", button.getNextHighestDepth());
        imageOff.loadMovie("smiley_sad.swf");
        
        button.onRollOver = function()
        {
            trace("");
            this.imageOff._visible = false;
        }
        
        button.onRollOut = function()
        {
            trace("");
            this.imageOff._visible = true;
        }
    }
}

~Mike

Read Full Post »

This tutorial will demonstrate how to create “resources” SWF that might contain required UI elements and then load them into your ActionScript application.

This tutorial will demonstrate the following steps:

  • Create new Flash Document using Macromedia Flash Professional 8
  • Create new Movie Clip (Linkage: Export for ActionScript, Export in first frame)

  • Add an image and create a simple motion tween
  • Publish to produce SWF
  • Create new ActionScript Application
  • Specify “input SWF” pointing to the produced SWF
  • Show code required to load needed Movie Clip

Source code is here.

Click image below to launch:

Read Full Post »

Consider viewing a video tutorial that creates a simple “Hello World” ActionScript application using SharpStyle Neutron: Launch Tutorial

This post will describe files that are included in the the default project. I will go through them in the order that it makes it easier to follow, not the order you see on the image

SWFObject is a small Javascript file used for embedding Adobe Flash content. The script can detect the Flash plug-in in all major web browsers (on Mac and PC) and is designed to make embedding Flash movies as easy as possible

  • _SwfHtmlTemplate.htm: customizable HTML file that will embed created SWF. Contains a number of {Tokens} that take their value from Project Properties. You can either modify this file or specify another one within
  • Project Properties : Run screen. Code below shows some of the tokens being used

var so = new SWFObject(“{AsOutputPath}{AssemblyName}.swf”, “swftester”, “{Width}”, “{Height}”, “{TargetVersion}”, “{BackgroundColor}”);

  • Main.as — entry point for your new project. Code provided below:
class Main 
{ 
    // The main entry point for the application. 
    static function main() 
    { 
 
    } 
}

~Mike

Read Full Post »

  • Output type: choice of “ActionScript Application” or “ActionScript Library”
    • ActionScript Library — reusable set of ActionScript classes compiled into SWF without “main()”
  • Assembly name: name of the SWF file
  • Default namespace: used when creating new ActionScript classes
  • Output path: you can use relative paths. Useful when ActionScript project is a part of larger solution that includes Web/Windows project
  • Target Flash Version: choice of 7 or 8
  • Use input SWF file: you can specify SWF that contains assets
  • Use type inference for initialized local variables: self explanatory
  • Use strict compilation mode: self explanatory
  • Main class: static function main in this class be called automatically once all classes are registered
  • Width, Height, Frame rate, Background color: self explanatory

  • Run compiled SWF:
    • In Visual Studio
    • In default web browser
    • In application associated with *.SWF files
  • HTML template file: self explanatory

  • Above screen allows to setup references to ActionScript libraries, frameworks, etc 

  • Above screen allows to setup pre/post build events

Feel free to contact us with any questions.

~Mike

Read Full Post »

Older Posts »