screenad Singleton

Version 1.0.3
|
Constants 21

Before you start: Please take a look at our getting started document at http://developer.weborama.com to read-up on our Rich Media work-flow for developers.

The Screenad Interface provides you with functionality that can be used to build ads. It forms a bridge between your ad's IFRAME and the web page or application in which your ad is launched. The Screenad Interface is included in all our templates.

  ______________
 /\             \     +----------------------+    +-----------------+
 \_|            |     |                      |    |                 |
   |  Web page  | <---+  Screenad Interface  +--->|  Your HTML5 ad  |
   |  __________|_    |                      |    |                 |
   \_/___________/    +----------------------+    +-----------------+

If you want to start working with the Screenad Interface, make sure that your ad contains at least the HTML code displayed below. The SCRWIDTH and SCRHEIGHT values represent the canvas size of the ad unit. The script tag below the SCREENAD META DATA loads the Screenad Interface.

<html>
<head>
<!-- WEBORAMA SCREENAD META DATA (don't edit/remove) -->
<!-- SCRWIDTH: 300 -->
<!-- SCRHEIGHT: 250 -->
<script type="text/javascript" src="//media.adrcdn.com/scripts/screenad_interface_1.0.3_scrambled.js"></script>
</head>
<body></body>
</html>

With this HTML in your ad unit you're ready to start previewing and testing in the Weborama Previewer.

If you want to start working with video inside HTML5 creatives, please consult our screenad.video.VideoPlayer class. (see: 'All classes' menu)

Constant details
Event
<constant> CLICK_OUT
Event constant (see: screenad.onClickOut)
Event constant (see: screenad.onClickOut)
See:
screenad.onClickOut
<constant> DEVICE_DESKTOP : {String}
Constant for device type: desktop
Constant for device type: desktop
<constant> DEVICE_MOBILE : {String}
Constant for device type: mobile
Constant for device type: mobile
<constant> DEVICE_TABLET : {String}
Constant for device type: tablet
Constant for device type: tablet
Event
<constant> HIDE
Event constant (see: screenad.onHide)
Event constant (see: screenad.onHide)
See:
screenad.onHide
Event
<constant> MOUSE_LEAVE
Event constant (see: screenad.onMouseLeave)
Event constant (see: screenad.onMouseLeave)
See:
screenad.onMouseLeave
Event
<constant> MOUSE_MOVE
Event constant (see: screenad.onMouseMove)
Event constant (see: screenad.onMouseMove)
See:
screenad.onMouseMove
Event
<constant> ORIENTATION_CHANGE
Event constant (see: screenad.onOrientationChange)
Event constant (see: screenad.onOrientationChange)
See:
screenad.onOrientationChange
Event
<constant> PRELOAD_COMPLETE
Event constant (see: screenad.onPreloadComplete)
Event constant (see: screenad.onPreloadComplete)
See:
screenad.onPreloadComplete
Event
<constant> RESIZE
Event constant (see: screenad.onResize)
Event constant (see: screenad.onResize)
See:
screenad.onResize
<constant> SCREEN_ORIENTATION_LANDSCAPE : {String}
<constant> SCREEN_ORIENTATION_PORTRAIT : {String}
Event
<constant> SCROLL
Event constant (see: screenad.onScroll)
Event constant (see: screenad.onScroll)
See:
screenad.onScroll
Event
<constant> SET_VARIABLE
Event constant (see: screenad.onSetVariable)
Event constant (see: screenad.onSetVariable)
See:
screenad.onSetVariable
Event
<constant> SHOW
Event constant (see: screenad.onShow)
Event constant (see: screenad.onShow)
See:
screenad.onShow
Event
<constant> STATE_CHANGE
Event constant (see: screenad.onStateChange)
Event constant (see: screenad.onStateChange)
See:
screenad.onStateChange
<constant> STATE_DEFAULT : {String}
Constant indicating 'default' state (in-app only!)
Constant indicating 'default' state (in-app only!)
<constant> STATE_EXPANDED : {String}
Constant indicating 'expanded' state (in-app only!)
Constant indicating 'expanded' state (in-app only!)
Event
<constant> SYNC
Event constant (see: screenad.onSync)
Event constant (see: screenad.onSync)
See:
screenad.onSync
Event
<constant> TILT
Event constant (see: screenad.onTilt)
Event constant (see: screenad.onTilt)
See:
screenad.onTilt
Event
<constant> VISIBILITY_CHANGE
Event constant (see: screenad.onVisibilityChange)
Event constant (see: screenad.onVisibilityChange)
See:
screenad.onVisibilityChange
Property Details
Environment
<read-only> bannerheight : {Number}
Current height of the banner that is to this ad position (in pixels)
Current height of the banner that is to this ad position (in pixels)
Environment
<read-only> bannerwidth : {Number}
Current width of the banner that is related to this ad position (in pixels)
Current width of the banner that is related to this ad position (in pixels)
Environment
<read-only> bannerx : {Number}
Horizontal banner offset, relative to this element
Horizontal banner offset, relative to this element
Environment
<read-only> bannery : {Number}
Vertical banner offset, relative to this element
Vertical banner offset, relative to this element
Environment
<read-only> browser : {Object}
This browser information object contains information about the operating system and browser that is being used to view this element.
This browser information object contains information about the operating system and browser that is being used to view this element.
The following properties are available:
  • screenad.browser.os; a string that represents the current operating system.
  • screenad.browser.os.version; a number representing the version of the operating system.
  • screenad.browser.browser.*; where * represents the browser engine, e.g. 'webkit', 'msie'.
  • screenad.browser.browser.version; a number representing the version of the browser.
Environment
<read-only> browserheight : {Number}
Represents the height of the viewport
Represents the height of the viewport
Environment
<read-only> browserwidth : {Number}
Represents the width of the viewport
Represents the width of the viewport
Screenad
command
Sends raw screenad command to be processed by the Weborama Display Scripts.
Sends raw screenad command to be processed by the Weborama Display Scripts.
conf_autopreload : {Boolean}
Set this to false if you wish to manually give the 'preloaded' signal, which indicates that this ad is ready for synchronous activities.
Set this to false if you wish to manually give the 'preloaded' signal, which indicates that this ad is ready for synchronous activities.
Default Value:
true
conf_autozoom : {Boolean}
If set to true, the Screenad Interface will automatically try to scale your ad's content when antizoom is set to true.
If set to true, the Screenad Interface will automatically try to scale your ad's content when antizoom is set to true.
Default Value:
false
Environment
<read-only> deviceType : {String}
The parameter indicates the (presumed) device type.
The parameter indicates the (presumed) device type.
See:
screenad#DEVICE_TABLET
screenad#DEVICE_MOBILE
screenad#DEVICE_DESKTOP
Environment
<read-only> hasVisibility : {Boolean}
Will be set to true if the ad has visibility, meaning: when more than 50% is visible inside the viewport
Will be set to true if the ad has visibility, meaning: when more than 50% is visible inside the viewport
Screenad
<read-only> isPreloaded : {Boolean}
Will be set to true automatically when the document has loaded.
Will be set to true automatically when the document has loaded. For Edge we listen to the 'compositionReady' event.
Environment
<read-only> isPreviewer : {Number}
This variable is set to true when the ad is launched from the Previewer
This variable is set to true when the ad is launched from the Previewer
Environment
<read-only> isShowing : {Boolean}
Will be set to true if the ad is shown; visibility is not taken into account (see screenad#hasVisibility).
Will be set to true if the ad is shown; visibility is not taken into account (see screenad#hasVisibility).
Screenad
<read-only> isSynced : {Boolean}
Will be set to true when all ad elements have preloaded.
Will be set to true when all ad elements have preloaded.
Environment
<read-only> mousex : {Number}
Last recorded horizontal mouse position, relative to the top-left corner of this ad unit.
Last recorded horizontal mouse position, relative to the top-left corner of this ad unit. To start tracking the mouse from outside of the viewport, set `screenad.settings.trackExternalMouse` to true.
Environment
<read-only> mousey : {Number}
Last recorded vertical mouse position, relative to the top-left corner of this ad unit.
Last recorded vertical mouse position, relative to the top-left corner of this ad unit. To start tracking the mouse from outside of the viewport, set `screenad.settings.trackExternalMouse` to true.
Environment
<read-only> originalHeight : {Number}
Represents the height of this ad's canvas.
Represents the height of this ad's canvas. These value is assigned once, initially, by the ad management system, which uses the meta data SCRWIDTH and SCRHEIGHT to detect these dimensions.
Environment
<read-only> originalWidth : {Number}
Represents the width of this ad's canvas.
Represents the width of this ad's canvas. This value is assigned once, initially, by the ad management system, which uses the meta data SCRWIDTH and SCRHEIGHT to detect these dimensions.
Environment
<read-only> pagex : {Number}
Horizontal distance from the top of the ad unit to the top of the browser viewport
Horizontal distance from the top of the ad unit to the top of the browser viewport
Environment
<read-only> pagey : {Number}
Vertical distance from the top of the ad unit to the top of the browser viewport
Vertical distance from the top of the ad unit to the top of the browser viewport
Environment
<read-only> screenorientation : {String}
Represents the current screen orientation (portrait/landscape)
Represents the current screen orientation (portrait/landscape)
See:
screenad#SCREEN_ORIENTATION_LANDSCAPE
screenad#SCREEN_ORIENTATION_PORTRAIT
Environment
<read-only> scrollx : {Number}
Horizontal scroll level of the viewport, relative to the top left of the web page
Horizontal scroll level of the viewport, relative to the top left of the web page
Environment
<read-only> scrolly : {Number}
Vertical scroll level of the viewport, relative to the top left of the web page
Vertical scroll level of the viewport, relative to the top left of the web page
Screenad
settings : {Object}
Namespace for several ad configuration settings.
Namespace for several ad configuration settings.
Communication
shared : {screenad.shared}
Allows for communication between ad elements to take place.
Allows for communication between ad elements to take place. See screenad.shared for more information.
See:
screenad.shared
Environment
<read-only> state : {String}
Represents the current 'in-app' state.
Represents the current 'in-app' state. (in-app only!)
See:
screenad#STATE_DEFAULT
screenad#STATE_EXPANDED
Communication
<read-only> vars : {Object}
This object is used to store variables that are set on initialization, but also variables that were sent to this element through the screenad#setVariable method.
This object is used to store variables that are set on initialization, but also variables that were sent to this element through the screenad#setVariable method.
Environment
<read-only> zoom : {Float}
Represents the current zoom level of the browser
Represents the current zoom level of the browser
Method Details
Misc.
addEventListener(event_name, callback)

Registers a callback for that will listen to a specific `Screenad Interface` event.

Registers a callback for that will listen to a specific `Screenad Interface` event.

This function cannot be used for DOM events.

See: Event details.

Parameters:
{String} event_name
The event which will be listened to.
{Function} callback
The function that will be called when the specified event takes place.
angle(innerX, innerY, outerX, outerY) : {Number}
Calculates the angle between between two points
Calculates the angle between between two points
Parameters:
{Number} innerX
The inner x coordinate
{Number} innerY
The inner y coordinate
{Number} outerX
The outer y coordinate
{Number} outerY
The outer x coordinate
Returns:
{Number} angle
Misc.
blockTouches() deprecated
Once activated, all touches to the browser are no longer propageted to the main page, disabling scrolling and interaction with the website.
Once activated, all touches to the browser are no longer propageted to the main page, disabling scrolling and interaction with the website.
Enable this if your ad contains features like swiping, pinch zooming, drawing, etc.

Be sure to call unblockTouches when needed, to allow the user to interact with the main page again.
Deprecated:
Will be deprecated in SI 1.0.4. Please use 'screenad.setBlockPageTouches(true)' instead.
See:
screenad#setBlockPageTouches
UserInteraction
click(click)
Opens the exit URL that is related to the specified 'click' parameter.
Opens the exit URL that is related to the specified 'click' parameter.
Parameters:
{String} click Optional, Default: "default"
Reference string, e.g.: 'default', 'extra1', 'extra2', etc.
Screenad
close(target)
Closes the specified target
Closes the specified target
Parameters:
{String} target Optional, Default: "self"
Specifies which element(s) should be closed.
conf(key, value)
Triggers custom display script configuration variables, such as: `env`, `form`, `ignorepos`, `ignorehide`.
Triggers custom display script configuration variables, such as: `env`, `form`, `ignorepos`, `ignorehide`. These settings are normally used by Weborama employees only.
screenad.conf(key:String, value:Boolean);
Parameters:
{String} key
The key part of the configuration setting. E.g.: `form`, `ignorepos`
{Boolean|String} value
The new value of this configuration setting. Accepts true, false, `auto`.
UserInteraction
createCalendarEvent(date, title, description)
Creates an event in the users calendar*.
Creates an event in the users calendar*.

*Works on phones inside applications that are ORMMA/MRAID compatible
Parameters:
{Date} date
Date of the calendar event.
{String} title
Title of the calendar event.
{String} description
Description of the calendar event.
distance(innerX, innerY, outerX, outerY) : {Number}
Returns the mouse distance to the top-left of this ad
Returns the mouse distance to the top-left of this ad
Parameters:
innerX
innerY
outerX
outerY
Returns:
{Number} The distance
Reporting
event(event)
Sends reporting event to Weborama servers
Sends reporting event to Weborama servers
Parameters:
{String} event
The name of the event, e.g.: 'user_close' ([A-Za-z0-9_]).
Misc.
executeScript(script, callback)
Executes javascript in the scope of the website.
Executes javascript in the scope of the website.
Parameters:
{String} script
The script that should be executed, as a string.
{Function} callback Optional
The function that should be called when the script has executed.
Screenad
hide(target)
Hides the specified target
Hides the specified target
Parameters:
{String} target Optional, Default: "self"
Specifies which element(s) should be hidden.
Positioning
hideNavBar()
This hides the address bar on mobile phone, by scrolling 1px down, if the current scroll position is 0
This hides the address bar on mobile phone, by scrolling 1px down, if the current scroll position is 0
Misc.
log(Object)
This log function is used to give feedback to developers.
This log function is used to give feedback to developers.
Parameters:
Object
message The message that should be conveyed.
UserInteraction
makeCall(phone_number)
Make a phonecall to the specified number*.
Make a phonecall to the specified number*.

*Works on phones in browser evironments and inside applications that are ORMMA/MRAID compatible
Parameters:
{String} phone_number
The number to dial.
<inner> mergeObjects(target, source)
Creates a clone of an object for cases where you wish to change a copy of any object, instead of the reference to an Object
Creates a clone of an object for cases where you wish to change a copy of any object, instead of the reference to an Object
Parameters:
{Object} target
The object we should 'dress up' with the methods and properties of the source
{Object} source
The source object
mouseAngle() : {Number}
Gets the mouse angle to the environment clip
Gets the mouse angle to the environment clip
Returns:
{Number} angle
mouseAngleTo(x, y) : {Number}
Calculates the mouse angle to the environment clip
Calculates the mouse angle to the environment clip
Parameters:
{Number} x
Horizontal coord; used to calculate mouse angle
{Number} y
Vertical coord; used to calculate mouse angle
Returns:
{Number} angle
mouseDistance() : {Number}
Gets the mouse distance from the top-left corner of the ad
Gets the mouse distance from the top-left corner of the ad
Returns:
{Number} Distance in pixels
mouseDistanceTo(x, y) : {Number}
Calculates the mouse distance from a custom coordinate
Calculates the mouse distance from a custom coordinate
Parameters:
{Number} x
The x position
{Number} y
The y position
Returns:
{Number} Distance in pixels
Positioning
position(scene_string)
*IMPORTANT:* Sends positioning data to the Weborama Display Scripts.
*IMPORTANT:* Sends positioning data to the Weborama Display Scripts. All data that is set using the other positioning functions (setClip, setAlignment, etc.) is not sent to the Display Scripts, unless this function is called.
Parameters:
{String} scene_string Optional
Screenad
postclick()
If this function is called, we wait for a user to click on a link before showing this layer.
If this function is called, we wait for a user to click on a link before showing this layer.
Screenad
proceed()
If a postclick is activated, the proceed function tells the browser to continue navigating to the link on which the user clicked.
If a postclick is activated, the proceed function tells the browser to continue navigating to the link on which the user clicked.
Misc.
removeEventListener(event_name, callback)
Removes a `Screenad Interface` event listener.
Removes a `Screenad Interface` event listener.
Parameters:
{String} event_name
The event which will be listened to.
{Function} callback
The function that will be called when the specified event takes place.
Screenad
resize(width, height, target)
Resizes the specified target
Resizes the specified target
Parameters:
{String} width
Width
{String} height
Height
{String} target Optional, Default: "self"
Specifies which element(s) should be resized.
UserInteraction
sendMail(recipient, subject, body, cc, bcc)
Sends an e-mail to the specified recipient*.
Sends an e-mail to the specified recipient*.

*Works on phones inside applications that are ORMMA/MRAID compatible
Parameters:
{String} recipient
E-mail address of the recipient.
{String} subject
Subject of the e-mail.
{String} body
The content of the e-mail.
{String} cc Optional
{String} bcc Optional
UserInteraction
sendSMS(recipient, text_body)
Send a text message to the specified recipient*.
Send a text message to the specified recipient*.

*Works on phones in browser evironments and inside applications that are ORMMA/MRAID compatible
Parameters:
{String} recipient
The name of the variable.
{String} text_body
The content of the text message. (Predefined sms content is not supported on Android 2.X native browser and iOS 7+)
Positioning
setAlignment(horizontal_align, vertical_align)
Decides to what anchor point on the page this layer will align.
Decides to what anchor point on the page this layer will align.
Parameters:
{String} horizontal_align
Possible values: 'left', 'center', 'right', 'banner', '#{html_element_id}', '{other_layer_name}'.
{String} vertical_align
Possible values: 'top', 'center', 'bottom', 'banner', '#{html_element_id}', '{other_layer_name}'.
Positioning
setAntiZoom(anti_zoom)
When anti-zoom is set to true, 2 things happen.
When anti-zoom is set to true, 2 things happen.
  1. The original layer dimensions are visually maintained, regardless of the zoom level the browser.
  2. The layer will align to the visual viewport*.
*see http://www.quirksmode.org/mobile/viewports2.html
Parameters:
{Boolean} anti_zoom
Misc.
setBlockPageTouches(block)
Enable or disable touch propagation to the main page, disabling scrolling and interaction with the website.
Enable or disable touch propagation to the main page, disabling scrolling and interaction with the website.
Use "setBlockPageTouches(true)" this if your ad contains features like swiping, pinch zooming, drawing, etc.

Be sure to call "setBlockPageTouches(false)" if this behavior is no longer needed, to allow the user to interact with the main page again.
Parameters:
{Boolean} block
Should touches to the page be blocked?
Positioning
setClip(clipx1, clipy1, clipx2, clipy2)
When clipping is applied to a layer, only the specified (rectangular) part of this layer will be shown.
When clipping is applied to a layer, only the specified (rectangular) part of this layer will be shown.
Parameters:
{String|Number} clipx1
x1 coordinate for clipping.
{String|Number} clipy1
y1 coordinate for clipping.
{String|Number} clipx2
x2 coordinate for clipping.
{String|Number} clipy2
y2 coordinate for clipping.
Misc.
setElementZoom(element, zoomLevel)
Manually sets the zoom level of an HTML element (includes cross-browser fixes).
Manually sets the zoom level of an HTML element (includes cross-browser fixes).
//Instead of:
myElement.style.zoom = '150%';
//Use this:
screenad.setElementZoom(myElement, 1.5);
Parameters:
{HTMLNode} element
Element to which the zoom level should be applied.
{Number} zoomLevel
Zoom level that should be applied to the element. (Use 1.0 for 100% zoom)
Positioning
setHideElements(hide)
Decides if website elements that burn through layers should be automatically hidden when the layer overlaps them.
Decides if website elements that burn through layers should be automatically hidden when the layer overlaps them.
Parameters:
{Boolean} hide
Positioning
setOffset(offset_x, offset_y)
The offset to the alignment, which is set using screenad#setAlignment.
The offset to the alignment, which is set using screenad#setAlignment.
Parameters:
{Number} offset_x Optional, Default: 0
The offset from the horizontal alignment point.
{Number} offset_y Optional, Default: 0
The offset from the vertical alignment point.
Screenad
setPreloaded()
Use this function to manually call the preload command.
Use this function to manually call the preload command. By default this function is called automatically when this iframe's content has loaded. If you wish to override the default behaviour for some reason, disable the screenad.conf_autopreload. The preload command will only be executed once per impression.
Positioning
setSize(width, height)
Sets the size of this layer's scene.
Sets the size of this layer's scene. The original size dimensions are not updated.
Parameters:
{String|Number} width
Number or percentage that represents the new layer width.
{String|Number} height
Number or percentage that represents the new layer height.
Positioning
setSmooth(smoothness)
When set to a number higher then 0, the layer is gradually moved to it's new position.
When set to a number higher then 0, the layer is gradually moved to it's new position.
Parameters:
{Number} smoothness
Decides the speed of the transition. 0 is instant, 100 is slow.
Positioning
setSticky(sticky)
Decides if this layer should stick to the scrollbar or not.
Decides if this layer should stick to the scrollbar or not.
Parameters:
{Boolean} sticky
Communication
setVariable(name, value, target)
Sends a variable to the specified element(s).
Sends a variable to the specified element(s).
Parameters:
{String} name
The name of the variable.
{String} value
The value of the variable.
{String} target Optional, Default: 'all'
Specifies which element(s) should receive this variable ('banner','self','all','{LAYER_NAME}').
Positioning
setZIndex(zindex)
Set the z-index of a layer.
Set the z-index of a layer.

Usage:
screenad.setZIndex(200)
Parameters:
{Number} zindex
Screenad
show(target)
Shows the specified target
Shows the specified target
Parameters:
{String} target Optional, Default: "self"
Specifies which element(s) should be shown.
Reporting
startTimer(timer_name)
Starts counting the duration of a specific user interaction, A.K.A.
Starts counting the duration of a specific user interaction, A.K.A. a timer event — timer events are used to measure how much time a user spends performing a specific action, e.g: the expand time. Be sure to always call screenad#stopTimer to stop counting the interaction time, otherwise the timer will keep running for the rest of the session. We automatically keep score of (among others) the following timers: visibility, expand duration, video play duration.
Parameters:
{String} timer_name
The name of the timer event, e.g.: 'gameplay_duration' ([A-Za-z0-9_]).
See:
screenad#stopTimer
Reporting
stopTimer(timer_name)
Pauses the counting the duration of a specific user interaction, A.K.A.
Pauses the counting the duration of a specific user interaction, A.K.A. a timer event — timer events used to measure how much time a user spends performing a specific action, e.g.: the expand time. Be sure to always call screenad#stopTimer to stop counting the interaction time, otherwise the timer will keep running for the rest of the session. We automatically keep score of (among others) the following timers: visibility, expand duration, video play duration.
Parameters:
{String} timer_name
The name of the timer event, e.g.: 'gameplay_duration' ([A-Za-z0-9_]).
See:
screenad#startTimer
Environment
supportsTilt() : {Boolean}
Does this device support using the gyroscope.
Does this device support using the gyroscope.
Returns:
{Boolean} True if device motion is supported on this device. False if otherwise.
Misc.
unblockTouches() deprecated
Disables the blocking of touches.
Disables the blocking of touches. See: screenad#blockTouches for more info.
Deprecated:
Will be deprecated in SI 1.0.4. Please use 'screenad.setBlockPageTouches(false)' instead.
See:
screenad#setBlockPageTouches
Screenad
wallpaper(wallpaper_url, wallpaper_position)
The `screenad.wallpaper` command allows you to set a background on the `BODY` element of a web page.
The `screenad.wallpaper` command allows you to set a background on the `BODY` element of a web page. This command should only be used with the publishers permission. Or if it was found in one of our publisher specific templates.

The background image isn't clickable. If you wish to have a wallpaper with interaction you should use interactive skins. The templates for interactive skins are available on request.
Parameters:
{String} wallpaper_url
The (relative) wallpaper image URL, e.g.: 'wallpaper.jpg'
{String} wallpaper_position
Configuration for the wallpaper position, e.g.: 'center top no-repeat'
Event Details
Screenad
onClickOut()
Is called when an exit click is performed.
Is called when an exit click is performed. Use this event to collapse your expandable, or to stop playing the video.

Sample usage:
screenad.onClickOut = function() {
    // perform collapse (example)
    doCollapse();
}
See:
screenad#CLICK_OUT
Screenad
onHide()
Is called whenever the element is hidden (using a screenad command).
Is called whenever the element is hidden (using a screenad command).
See:
screenad#HIDE
Screenad
onMouseLeave()
Is called when the mouse leaves the ad unit's iframe.
Is called when the mouse leaves the ad unit's iframe.

Sample usage:
screenad.onMouseLeave = function() {
    // e.g: Stop playing the video when the mouse leaves the iframe:
    exampleVideo.stop();
}
See:
screenad#MOUSE_LEAVE
Screenad
onMouseMove(event)
Is called when mouse coordinates have changed, even outside of the viewport.
Is called when mouse coordinates have changed, even outside of the viewport. To start tracking the mouse from outside of the viewport, set `screenad.settings.trackExternalMouse` to true.

Sample usage:
screenad.onMouseMove = function(event) {
    // You can use either screenad.mousex or event.mousex in this case.
    myExample.rotate(screenad.mouseAngle());
}
Parameters:
event
See:
screenad#MOUSE_MOVE
Environment
onOrientationChange()
Is called whenever the browser or the screen orientation is changed (use screenad.screenorientation to get the latest value)
Is called whenever the browser or the screen orientation is changed (use screenad.screenorientation to get the latest value)
See:
screenad#ORIENTATION_CHANGE
Communication
onPreloadComplete()
Is called when this ad element has preloaded.
Is called when this ad element has preloaded. A good point to start your animations from. Listen to the `onSync` event if your animation needs to run in sync with another ad element.

Sample usage:
screenad.onPreloadComplete = function() {
    // e.g.: Start animating
    startAnimation();
}
See:
screenad#conf_autopreload
screenad#PRELOAD_COMPLETE
screenad#setPreloaded
Environment
onResize()
Is called whenever the browser or the element is resized.
Is called whenever the browser or the element is resized.

Sample usage:
screenad.onResize = function() {
    // insert code to re-align your ad's content
}
See:
screenad#RESIZE
Screenad
onScroll()
Is called when a page scroll occurs.
Is called when a page scroll occurs.

Sample usage:
screenad.onScroll = function() {
    // e.g.: Show layer when scrolled past a certain point
    if (screenad.scrolly > 400) {
        screenad.show();
    }
}
See:
screenad#SCROLL
Communication
onSetVariable(var_name)
Is called when the element receives a variable from another element.
Is called when the element receives a variable from another element.

Sample usage:
screenad.onSetVariable = function(var_name) {
    // alert the (new) value of the recieved variable
    alert(screenad.vars[var_name]);
}
Parameters:
{String} var_name
name of the variable that was received; accessible through screenad.vars[var_name]
See:
screenad#SET_VARIABLE
Screenad
onShow()
Is called whenever the element is shown (using a screenad command).
Is called whenever the element is shown (using a screenad command).
See:
screenad#SHOW
Environment
onStateChange(state)
Is called when the state of the element changes inside apps, e.g.
Is called when the state of the element changes inside apps, e.g. screenad.STATE_EXPANDED, screenad.STATE_DEFAULT. This can be used to handle close commands that come from the app itself.

Sample usage:
screenad.onStateChange = function(state) {
    if (state === screenad.STATE_DEFAULT) {
        // perform collapse (example)
        doCollapse();
    }
}
Parameters:
{String} state
The current state of the element.
See:
screenad#STATE_CHANGE
Communication
onSync()
Is called when all elements inside this 'ad position' have sent the 'preloaded' command.
Is called when all elements inside this 'ad position' have sent the 'preloaded' command.

Sample usage:
screenad.onSync = function() {
    // start synchronized animation (sample)
    startAnimation();
}
See:
screenad#SYNC
Environment
onTilt(tiltX, tiltY, tiltZ)
Is called when the MRAID Tilt event, or a devicemotion event is being dispatched.
Is called when the MRAID Tilt event, or a devicemotion event is being dispatched.

Sample usage:
screenad.onTilt = function(x, y, z) {
    // do something with the x,y,z values
}
Parameters:
{Number} tiltX
Device rotation on X axis.
{Number} tiltY
Device rotation on Y axis.
{Number} tiltZ
Device rotation on Z axis.
See:
screenad#TILT
Environment
onVisibilityChange()
Is called when this ad has been scrolled into or out-of the viewport (use screenad.hasVisibility to get the latest value)
Is called when this ad has been scrolled into or out-of the viewport (use screenad.hasVisibility to get the latest value)
See:
screenad#VISIBILITY_CHANGE
Documentation generated by an augmented version of JsDoc Toolkit 2.4.0 on Wed Jan 27 2016 17:42:14 GMT+0100 (CET)