Error code for input that is too long.
Integer
Read-only
The event method logs a custom event, recording the event name and optional metadata.
track.event(name, metadata)
| Name | Type | Required? | Description |
| name | String (max. 32 characters) | Yes | Names your event in the event stream. This event name is what is used to aggregate event data across all sessions for this widget. |
| metadata | String (max. 96 characters) | No | Optionally associates metadata with this event. Useful if you require an event hierarchy; for example, if your widget plays videos, you might want to use a single "video_play" event name, passing the video's ID code as metadata. |
_level0.sl.track.event("new_user");
_level0.sl.track.event("video_play", selectedVideoId);
_api.track.event("new_user");
_api.track.event("video_play", selectedVideoId);
The url.open method opens a URL redirected through the SpinletsLab servers for tracking purposes. For example, if you need to track clickthroughs back to your home page, opening URLs this way will associate them with the running session. This method uses the Flash getURL function to open the new window.
track.url.open(url)
| Name | Type | Required? | Description |
| url | URL | Yes | URL to open (for example, "http://example.org") |
_level0.sl.track.url.open("http://example.org");
_api.track.url.open("http://example.org");
System.security.allowDomain("www.spinletslab.com");
When loaded by the Spinlets widget container, the in-widget API services are loaded into an object stored on _level0 and accessible to the domain of your contained widget. (Note that content from other domains will not be granted access.) Function calls take the following form:
_level0.sl.category.method();
This general access method can be used to call any method in the function list from within your Flash application. For example, to call the track.event method from within the ActionScript 2 container, you would use code like this:
_level0.sl.track.event(eventCode);
Your application can access the in-widget API service classes at run time without having to do any fancy loading; they are defined as static objects on the root of the Spinlets widget container.
package test
{
public class WrapperTest extends Sprite
{
private var _api:Object;
public function WrapperTest ()
{
Security.allowDomain("www.spinletslab.com");
this.loaderInfo.addEventListener(flash.events.Event.COMPLETE,
initHandler);
// Grab a reference to the root of the SpinletsLab container
_api = this.root.loaderInfo.loader.api;
_api.track.url.open("http://example.org");
}
}
}