Skip to content

Instantly share code, notes, and snippets.

@astein
astein / activity.json
Last active October 7, 2015 09:57
Engagement Servering JSON Specs
{
"version":"3.1",
"type":"AS",
"mobile":false,
"width":750,
"height":500,
"interactive_url":"http://media.socialvi.be/debug/3.1/com/socialvibe/tools/builder/BuilderEngagementModule.swf",
"icon_url":"http://",
"screenshots":[{"step":1, "url":"http://"}, {"step":2, "url":"http://"}],
"config_json": {"type":"wizard","foregroundLayer":{"backgroundEnabled":true,"controls":[],"foregroundEnabled":true,"panelName":"foreground"},"wizard":{"templateClass":"com.socialvibe.tools.wizard.templates::ExternalPlayerTaggedTemplate","stepTemplateMap":{"step 1":"com.socialvibe.tools.wizard.templates::ExternalPlayerTaggedStep"}},"self_serve_url":"https://zynga.socialvibe.com/","steps":[{"backgroundEnabled":true,"controls":[{"height":295,"controlClass":"com.socialvibe.core.ui.controls::SVIFrame","url":"http://player.ebuzzing.com/xtst/ifr/playern_ifr.php?parametre=723580&vielnk=getUrlAsIframe(http%3A%2F%2Fpartners.socialvi.be%2Ftags%2Ftrack_interaction%3Finteraction%3Dvideo_completed)","scrollbars":false,"name":"
@astein
astein / YouTubeVideo.js
Created December 4, 2012 01:06
Example YouTube Video integration
(function(window) {
var WizardYouTubeVideo = function(configuration) {
var config = configuration || {};
this.name = "WizardYouTubeVideo";
this.id = config.id || this.name;
this.width = config.width || "280px";
this.height = config.height || "180px";
@astein
astein / JWVideo.js
Created December 4, 2012 01:17
Example Mobile Video Player
(function(window) {
var WizardVideo = function(configuration) {
var config = configuration || {};
this.name = "WizardVideo";
this.id = config.id || this.name;
this.width = config.width || "280px";
this.height = config.height || "180px";
@astein
astein / jack_in_box_upload_logic.as
Created March 16, 2013 00:46
Jack in the Box photo upload
package com.socialvibe.modules.logic
{
import com.adobe.images.PNGEnc;
import com.adobe.utils.ArrayUtil;
import com.socialvibe.core.ui.components.*;
import com.socialvibe.core.ui.controls.*;
import com.socialvibe.core.utils.*;
import com.socialvibe.engagement.EngagementParameters;
import com.socialvibe.engagement.EngagementTracking;
import com.socialvibe.engagement.controller.*;
@astein
astein / recording.json
Last active August 29, 2015 13:56
JSON format for engagement recording
[
{
"step": 1,
"time_offset": 0,
"movements": [[123, 31], [321,22], [null, null], [99, 99]],
"actions": [
{"time_offset": 4032, "input_type": "keyboard", "value": "spacebar"},
{"time_offset": 8944, "input_type": "mouse", "value": [123,321]}
],
"distance": 3245,
@astein
astein / fb_share.js
Created April 9, 2014 00:46
Facebook Share
// make this call when your SWF loads:
ExternalInterface.call('function(){ $("body").append(\'<div id="fb-root"></div>\'); window.fbAsyncInit = function() { FB.init({ appId:"4718162187", status:true, xfbml:true }); }; $.getScript("//connect.facebook.net/en_US/all.js"); return false; }');
// make this call when the user shares. replace with correct values
ExternalInterface.call('function(){ FB.ui({ method: "feed", name: "Mott\'s Fruit Drummer", caption: "#FlavorsThatRock", picture: "http://milodigital.socialvi.be/motts-fruit-drummer/share.jpg", description: "My kid rocks!"}); return false; }');
private var _oneInteraction:Boolean;
private var _thirtySeconds:Boolean;
private var _creativeCompletion:Boolean;
public function startEngagement():void
{
stage.addEventListener(MouseEvent.CLICK, onOneClick);
setTimeout(onThirtySeconds, 30000);
}
var creative_vars = {
"build_type": "release",
"service_url": "//serve.truex.com",
"media_bucket_name": "media.truex.com",
"impression_timestamp": "1406216609.6669753",
"impression_signature": "7b90b2bc27c1905e71625878a4de5058b6af3b042219ca4631a73325b3230ab5",
"bid_info": "",
"currency_amount": "",
"referring_source": "",
@astein
astein / celtra_wrapper.js
Created August 22, 2014 18:56
Celtra js wrapper example. For 2.0 container.
TXM.dispatcher.addEventListener('START_ENGAGEMENT', function() {
TXM.params.celtraCorrectionId = setInterval(correctZIndex, 200);
var celtraDiv = document.createElement('div');
document.body.appendChild(celtraDiv);
celtraDiv.className = 'celtra-ad-v3';
var celtraImg = document.createElement('img');
package com.socialvibe.modules.logic
{
import com.adobe.serialization.json.JSONDecoder;
import com.greensock.TweenLite;
import com.greensock.easing.Elastic;
import com.greensock.easing.Expo;
import com.greensock.easing.Quad;
import com.socialvibe.core.ui.controls.SVButton;
import com.socialvibe.core.ui.controls.SVImage;
import com.socialvibe.core.ui.controls.SVImageButton;