UnityWorks! Media Wiki

Page History: XSPFPlayer v3.0 - ActionScript Integration

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2009/06/17 16:40


   XSPF Player to ActionScript 3 Integration –

The XSPFPlayer is available for ActionScript 3 development. To use, please download the AS3 UWM library below.

UWM_XSPFPlayer_AS3Library.rar (AS3 Library) - Download
UWM_XSPFPlayer_AS3Library.zip (AS3 Library) - Download


To use, please import the XSPFPlayer library class into your AS3 project.

import com.unityworksmedia.xspfPlayer;

Once imported into your class or project, create a new instance of the object and add the object into your stage.

//xspfPlayer(CTX:String, VID:Number, xPos:Number, yPos:Number, width:Number, height:Number)

var _xspfPlayer:MovieClip = new xspfPlayer("CTX",VID,100,100,320,240);
addChild(_xspfPlayer);

The UWM XSPFPlayer should render within your Flash project once published. The values required to access the class will require values from UWM and from your own preferences.

Warning: Host Frame Rate will affect the player's animation performance.
We suggested to have a frame rate of 25 or higher.



   XSPF Player to ActionScript 2 Integration –

The XSPFPlayer can be imported through AS2 into another AS2 environment. The example below will import the player into your main stage of the application. The CTX and VID values will be delivered by UWM. Other values can be changed upon preference.

//- Following Values CTX & VID are Delivered by UWM -//
var ctxID:String = "CTX";
var vidID:String = "VID";
var xspfWidth:Number = 320;
var xspfHeight:Number = 240;
var xspfLocY:Number = 0;
var xspfLocX:Number = 0;
var AutoStart:Boolean = true;


//-UWM XSPFPlayer 3.0 -//
System.security.allowDomain("*");_root.AutoStart=AutoStart;_root.ctx = ctxID;_root.vid = vidID;
_root.NVP=true;_root.addOnComponent=true;this.createEmptyMovieClip("xspfPlayer", 100);
this["xspfPlayer"].loadMovie("http://www.dealervideos.com/xspfPlayer/xspfPlayer.swf");
_root.playerWidth=xspfWidth;_root.playerHeight=xspfHeight;this["xspfPlayer"]._x=xspfLocX;
this["xspfPlayer"]._y=xspfLocY;   


The code above can be altered to fit within your project scenario.

Warning: Host Frame Rate will affect the player's animation performance.
We suggested to have a frame rate of 25 or higher.

Parameter Values Description
ctxID ## (String) Required - Team Identifier Value will be provided by UWM
vidID ## (Num) Required - Video Identifier Value will be provided by UWM
xspfWidth ### (Num) Video Width
xspfHeight ### (Num) Video Height
AutoStart true,false (Boolean) Video auto play
xspfLocX 0 (Num) Player X coordinates
xspfLocY 0 (Num) Player Y coordinates

   XSPF Player as an ActionScript 2 Component –

**Due to Security Sandbox Violations the component has been delayed. Please use the integrations above to import the UWM XSPFPlayer into your AS2 or AS3 environments. Sorry about any inconvenience.



The XSPFPlayer is also available as a Flash 9+ Component (AS2) for those who decide to incorporate the player within a seperate Adobe Flash application. The following instructions will show you the process.

Download the XSPFPlayer v3.0 AS2 Component.

UWM_XSPFPlayer_AS2Component.rar (Flash Component Download) - Coming Soon.


  • To install the UWM XSPFPlayer Component - Launch the packaged .mxp extension.
  • Adobe Extension Manager will launch and install the mxp file.
  • Restart Adobe Flash - The program will add your new component.
  • Open your "Component Window" (Ctrl + F7).
  • Expand the UWM XSPFPlayer component folder.
  • Drag the UWM XSPFPlayer component on to your stage.
  • The UWM XSPFPlayer will appear on your stage together with the necessary items inside your movie library.
  • Single click the UWM XSPFPlayer component currently on the stage.
  • Open your "Parameters Window". (Ctrl + F3 - Parameters)
  • Set your parameters with the values delivered by UWM.
  • Publish your movie. (Ctrl + Enter)

Component Inspector Parameters -

The following parameters are available to the component via the parameter window of the UWM XSPFPlayer Component. This table will give you an idea of the possible actions and set up values the XSPFPlayer component needs.

Parameter Values Description
CTX ID ## (String) Required - Team Identifier Value will be provided by UWM
VID ID ## (Num) Required - Video Identifier Value will be provided by UWM
Player Width ### (Num) Video Width
Player Height ### (Num) Video Height
AutoStart true,false (Boolean) Video auto play
IsMuted true,false (Boolean) Mutes video playlist
exeFunction URL (String) URL will launch once video is complete
exeTarget _blank,_parent,_self (String) Targets exeFunction URL

2008 UnityWorks! Media