Community Questions & Answers

global variables

Hi, I have variables in app.js which are globals in all application in my iPhone App. When i try that with Android, my variables are not found. so how to make a variable visible in all the app ? thanks

Change label text to variable string problem

Hi guys, I can't seem to find the problem in this piece of code which should work 100% fine, but it does not. So I want to change the text of a label *(label.setText())*, but it does not seem to be able to **read the string value of the...

Variable Problem ?

Hi there, my alert doesn't work, i have missed something :( i can't find it :( what should i do? ~~~ var lat1; var lon1; var myLocation = function(latitude,longitude){ lat1 = latitude; lon1 =...

Passing array to new window

I am familiar with the concept of passing a variable to a new window by setting it as a window property. For example, if I have ~~~ var myText = 'hello'; var win2 = Ti.UI.createWindow({ // some parameters, customText: myText }); ~~~ And now I can...

Variable JSON parser

Is it possible to do something like that: ~~~ var VARIABLE = blablabla var table = Ti.UI.createTableView(tableViewOptions); var tableData = []; var xhr = Ti.Network.createHTTPClient({ onload: function() { // Ti.API.debug(this.responseText); ...

Global scope of variable

Hi I have two windows "win1" and "win2". I have declared a variable in win1 as `var patient;` the win2 has been created like this ~~~ var win2 = Ti.UI.createWindow({ url:'home.js' }); ~~~ the problem is I am not getting the value of...

a variable var

Why does this not work? I thought to give all the buttons a function with the `data.addEventListener` but that doesn't work. ~~~ var data = []; data[0]=v1cont.add(Ti.UI.createButton({title:L('string1'), custom_item: 1, width:btnWidth,...

passing row data to new widow

I'm trying to pass some of my row data to a new window, pretty much like a mash-up of the KS custom_properties.js and KS twitter examples. The problem I am having is that instead of passing the data from the row selected, I am passing the data from the...

Create variable name from value?

I would like to create a variable name from a input value. For example if I had param['kitchensink'], I would like to create a variable called pp.api.data.kitchensink, so I could do something like pp.api.data.kitchensink = results. I know in other...

Same variables - different values from XML

Hello I am building an RSS reader based on the example of Two App guys. I am getting my RSS feed correct on the main window where all the titles of the post are the variable this_post_title. But when you click on one of the articles you are forwarded on...

Storing json as a variable

I have an app that currently uses an array to store data in the form of ~~~ var tracks = [ { title : "title 1", username: "user", stream_url: "url here", artwork_url: "img url here also" }, { title :...

titanium array variable item pushed from webview checkboxes onCheck

Hey folks, Is there any way to get the Titanium array variable get assigned a value from webview scripts. Scenario is that I looped 10 times and at each time I created a row which consist (checkbox created by webview+label to show the items), and I wrote...

Scope Error

I seem to be running into a scope problem with Titanium. To the best of my knowledge the scope of a variable is the set of brackets {} in which it is declared and any nested brackets. If the item is declared in a for loop the scope is the nested...

Multiple custom variables in an object?

Why would this work fine ~~~~ var bHelp = Ti.UI.createButton({ title : 'Help', _file : 'help-recipes.html' }); ~~~~ but this breaks everything that comes after it: ~~~~ var bHelp = Ti.UI.createButton({ title : 'Help', _file :...

get value of var inside function

Hello! I need your help guys!! I created a table view with text fields for a login window. But How can I get the values of the fields outside the functions? Thank you very much!! `inline code` var win = Titanium.UI.currentWindow; var tabGroup =...

Global variable in same js problems

Not sure why this code isn't working... My array is fine, my "lat" variable is declared early as var lat; . It seems like I can set it inside the forwardGeocoder function, but I need access to it after it is set, because I'm looping through a...

Check if iAds exist

Hi, I'm trying to see if an object, specifically iAds, have been created yet. I tried if(iAds != null){} but that doesn't seem to work. How can I check if the createAdView function has been called yet? Thanks, and let me know if I need to clarify...

iPhone audio playback

I’ve had some success recording audio and then playing it back. What I would like to do is play it back at a different speed (say double or half speed) rather than at “normal” speed. I haven’t found a way to do this in Titanium, or by a call to...

Showing 1-50 of 65 1 2