User Tools

Site Tools


Index

Translations of this page:


Avenue 4.5 and Arena 5

Appendices:

Download PDF

Flash

Playing Flash animations in Resolume is great! Because a Flash animation contains vector information, it scales to any resolution without loss of image quality, so it will look great at any resolution.

Flash content can be made interactive using ActionScript so you can script animations that display something completely different every time you play it or even have it display content from the Internet: Show headlines from RSS feeds. Display pictures of your cat from Flickr. Or show your grandma's latest Tweets. It's all possible with Flash in Resolume.

And it gets even better! You can control your Flash animations with custom sliders and buttons in the Resolume interface. You define these parameters in ActionScript - as many as you like. You can use Text input, Sliders, Buttons and check-boxes. You could, for instance, write a basic particle emitter in ActionScript and have a slider in Resolume adjust the speed of the particles, or the colour, the amount of particles etc. Endless possibilities! Let's learn how it's done.


Text Input

You can send text to a Flash animation with Resolume to dynamically display text on screen.

This is useful to show, for instance, your VJ name or the DJ's name on screen. There are two ways you can do this in Flash:

The Easy Way - this is fine if you just want to quickly make a simple Flash animation to display some text.

Or The Hard Way - this method uses the Resolume Parameter Input system. It requires more advanced ActionScript-ing but offers greater flexibility.

Simple text input with rtext

Pros: No scripting required to display text Compatible with Resolume 2

Cons: Does not work with ActionScript 3

Creating a Flash movie that displays text entered in Resolume 3 is quite simple.

  • Create a new Flash document (ActionScript 2).
  • Create a text field with the text tool. Make sure you type in some text otherwise Resolume 3 is unable to pick it up.
  • On the Properties panel make sure you set it to dynamic text.
  • In the Variable field you enter: “rtext” (without the quotes).
  • Click the Character Embedding button under CHARACTER and make sure Uppercase, Lowercase, Numerals, Punctuation and Basic Latin are selected.
  • Publish the movie and load the .swf file in Resolume
  • On the clip properties panel in Resolume you should see a text input field below the timeline.

Notes: If your old Flash text movies for Resolume 2 are not working in Resolume 3 then make sure the Flash text field contains some characters. For Resolume 2 this was not required but for Resolume 3 it is. Do not put the text field inside a movie clip. If you want to animate it you should convert it to a Graphic, NOT a Movie Clip.

Parameter Input

You can control a flash movie by defining some parameters in ActionScript and then these parameters will be visible on the clip properties panel in the Resolume interface. This gives you unlimited live control on your Flash content.

FloatParameter

Returns a float value (0.0 - 1.0) to Flash.

Shown as a basic slider in the Resolume interface that can be animated like any other parameter. You set the name and default value when you define the parameter with ActionScript.

AS3 Example:

var hMove:FloatParameter = resolume.addFloatParameter("H Move", 0.0);

StringParameter

Returns a string value to Flash.

Shown as a single line or multi-line text field in the Resolume Interface. Multi-line text can be animated to send one line at a time to Flash.

You set the name and default value when you define the parameter with ActionScript.

AS3 Example:

var rText:StringParameter = resolume.addStringParameter("Text", "Michael Jackson");

BooleanParameter

Returns a Boolean value (0 or 1) to Flash.

Shown as a check-box in the Resolume Interface.

You set the name and default value when you define the parameter with ActionScript.

AS3 Example:

var showBG:BooleanParameter = resolume.addBooleanParameter("Background", true);

EventParameter

Returns a Boolean value (0 or 1) to Flash. 1 when the button is pressed, 0 when it's released. Shown as a button in the Resolume Interface.

You set the name when you define the parameter with ActionScript.

AS3 Example:

var showSurprise:EventParameter = resolume.addEventParameter("Surprise!");

ActionScript 3 Example

Below is a very basic AS3 script with comments that will show one parameter in Resolume. It's the most basic example that shows the bare minimum required to get communication from Resolume to Flash working.

Make sure you add the Source path to the resolumeCom directory in the ActionScript 3 Preferences!

The Resolume installer includes example movies that will get you started: MAC: /Applications/Resolume Avenue 4.0.0/media/flash/ PC: /Program Files/Resolume Avenue 4.0.0/media/flash/

/**
*    Very basic Resolume Flash communication AS3 DocumentClass example
**/
	
package
{
	import flash.display.MovieClip;
    
    //import the resolume communication classes
	import resolumeCom.*;
	import resolumeCom.parameters.*;
	import resolumeCom.events.*;

	public class Resolume3Example1CS4AS3 extends MovieClip
	{
		//create the resolume object that will do all the hard work for you
	    var resolume:Resolume = new Resolume();
		
		//create as many different parameters as you like
	    var scaleX:FloatParameter = resolume.addFloatParameter("Scale X", 0.5);
		
		public function Resolume3Example1CS4AS3():void
		{
			//set callback, this will notify us when a parameter has changed
			resolume.addParameterListener(parameterChanged);
		}
		
		//this will be called every time you change a parameter in Resolume
		public function parameterChanged(event:ChangeEvent): void
		{
			//check to see what parameter was changed
			if (event.object == this.scaleX)
			{
                //now it gets interesting
				//do whatever you like with the value of the parameter
				this.logo.scaleX = this.paramScaleX.getValue() * 2.0;
			}
		}
	}
}

ActionScript 2 Example

Below is a very basic AS2 script with comments that will show one parameter in Resolume. It's the most basic example that shows the bare minimum required to get communication from Resolume to Flash working.

The Resolume installer includes example movies that will get you started: MAC: /Applications/Resolume Avenue 4.0.0/media/flash/ PC: /Program Files/Resolume Avenue 4.0.0/media/flash/

/**
*    Very basic Resolume Flash communication AS2 example
**/

//import the resolume communication classes
import resolumeCom.*;
import resolumeCom.parameters.*;

if (this.init == undefined) {
   
    //create the resolume object that will do all the hard work for you
	var resolume:Resolume = new Resolume();

    //create as many different parameters as you like
	var scaleX:FloatParameter = resolume.addFloatParameter("Scale X", 0.5);

    //set callback, this will notify us when a parameter has changed
	resolume.addParameterListener(this);
   
    //this will be called every time you change a parameter in Resolume
	this.parameterChanged = function(object:Object): Void
	{
        //check to see what parameter was changed
		if (object == scaleX)
	    {
            //now it gets interesting
		    //do whatever you like with the value of the parameter
			this.logo._xscale = this.scaleX.getValue() * 200;
		}
	}
 
	this.init = true;
}

Resolume 2 and Resolume 3 Flash Differences

The only common ground that Resolume 2 and Resolume 3 share is the rtext parameter for basic text input. And for this to work in Resolume 3 you need to make sure that the text field in Flash contains some text otherwise it will not recognise it.

Resolume 3 does not support the RParameter or the RAudio variable input that Resolume 2 had because this only works in ActionScript 2. The parameter input system described above for Resolume 3 is compatible with ActionScript 3 and an ActionScript 2 version is also available if you prefer to use that.

Resolume 2

  • ActionScript 2 only
  • Fixed number of parameters
  • Only slider and text input
  • rtext variable for text input

Resolume 3

  • ActionScript 2 and 3 compatible
  • Unlimited number of parameters with custom names
  • Slider, Button, Text and Check-box inputs
  • rtext variable for basic text input

Flash Clip Settings

On a Flash clip you get some extra clip settings that are not available for normal video files, quite similar to Sources.

Render Width & Height - Render Width and Height determine the size at which the vectors in the Flash animation will be rendered to pixels (rasterized).

Quality - Determines the quality of the vector rasterizing. Can be set to low, mid or high. The higher the quality, the slower the rasterizing.

Duration - Determines how long the Flash clip should play when used with the Auto Pilot.


Timeline, BPM Sync and Autonomous

Besides the usual Timeline and BPM Sync modes, a Flash clip can play Autonomous. This means that Flash itself will determine what frames to play and in what order. In this mode you will not see a play-head for the clip in Resolume.

If you are writing ActionScripts to jump to different positions in the animation then you should have it set to Autonomous in Resolume or it will not work. In Timeline and BPM Sync mode Resolume will determine what frame to play and it will ignore any ActionScripts that position the clip. When a Flash clip is only 3 frames or shorter then Resolume will play the clip in Autonomous mode by default.


Publish Settings

Make sure you turn off “Compress movie” in the Publish Settings. Otherwise Resolume can not read the width, height and framerate of the movie and it will default to 640×480 @25fps.



Page Tools