Skip to content

Instantly share code, notes, and snippets.

//Placed in /lib/functions.js
var getData = function(callback){
var rssFeed = Ti.Network.createHTTPClient();
rssFeed.onload = function(){
var xml = this.responseXML;
var items = xml.documentElement.getElementsByTagName("item");
var _title = "";
var tableData = [];
var row = "";
@philsmithsonuk
philsmithsonuk / index.js
Created July 1, 2014 13:55
Given a sentence as a string, fade in each word and play a sound when the word has been faded in. Titanium Appcelerator.
//import builtin alloy animations
var animation = require('alloy/animation');
var wordString = "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program";
var wordArray = wordString.split(" ");
var lblArray = [];
var lbl = null;
//Generate Label element for each word
// 1. I had some issues with flickering, changing the event to "onscrollend"
// 2. My design requires not just opacity changes but different design for active / inactive buttons so modified for this accordingly
// Configuration
var disabledBackground = "#fff";
var disabledBorder = "#5b5857";
var enabledBackground = "#e5001b";
var enabledBorder = "#cccccc";