Community Questions & Answers
Button Event
if i make a loop to create group of buttons like that:- `for(var i=0;i<5;i++){ var button = Titanium.UI.createButton({ ..... }) } ` I want to know each button the user clicked ,but after creating the...
Sounds won't loop (Android)
Hi all, I'm making an array of sounds using the following code: ~~~ for (i=0; i<4; i++){ bellSounds[i] = Ti.Media.createSound({ url: '/Audio Files/Bell' + (i+1) + '.wav', preload: true, volume: 1, looping: true }); }; ~~~ It makes...
Assertion failure in UITableView _endCellAnimationsWithContex
I got this error and I don't have any idea what it means I am using Titanium 3.1.0.GA I's happening when looping through a table and I am trying to push a value to an array stored originally in a tableviewrow object ~~~ [99982:1c103] *** Assertion...
Android Looping EventListener Problem
Hi, I'd like to create views dynamically and attach an eventlistener for each of them. However I am failing to do so. Only last one get the listener. Here is my code. Thank you. --- My specs --- Android emulator / Mac OS 10.8.2 / Mobile SDK 3.0.2GA /...
Making a track loop with an audio player
Hello, I work on a music app with Titanium Studio. I have a problem with "audioPlayer". I want to loop a stream (mp3 file) but it is only available with "Titanium.Media.Sound" and so I made this piece of code ~~~ function repeat(e)...
For loop e.REPLACETHIS.length
I have a for loop and I want to be able to change the return data by replacing the string between e. and .length. Anyone having an idea how I can do this? ~~~ for (var i = 0; i < e.REPLACETHIS.length; i++) { var return =...
Access value from textfield through a loop
Hi, I am generating through a loop my textfields on a scrollview ~~~ var view = Ti.UI.createScrollView({ backgroundColor: '#3e3e3e', opacity: 0.6, left: 5, right: 5, top: 55, bottom: 5, zIndex: 1, contentWidth:'auto',...
Scrollable View Loop
Hi, I'm trying to get a scrollableview to "start over" when the last image is reached, so it seems like it has no end at all. Like this: 1-2-3-4-1-2-... And also the other way around: 1-4-3-2-1-4-3-... Is this possible? I guess it can be done...
Ti.Media.Sound Problem - Playing multiple sounds in sync (unison) seems impossible
So Titanium.Media.Sound() has methods such as setTime, getTime, and play()... I have an array of sounds (5 mp3's) which are 100kb a piece, and I am trying to play them in unison. However this proves to be a fruitless endeavor. I have attempted using the...
getting data from one array to the another array
I need to take the data from the dataArray and get it in the resultArray using the filter StateName dataArray has all the correct data in it just not pushing anything to the resultArray ~~~ var sendit = Ti.Network.createHTTPClient(); sendit.open('GET',...
Httpclient loop makes all responses from server return null after a random time
Hi there, I've got a difficult one. I'm emulating a chat and before being able to use push messages, i make my app read the chat database in a loop, but this loop randomly freezes the access to the server or just makes any mobile to get a null response...
How to Loop setTimeout's on a set of images
Hi I am working on the below script to fade out a selection of 4 images one by one every 4 seconds until it gets to the last image and stops. It works although it seems a little ugly and i'm sure it could be done with some sort of loop and array to store...
YQL/XHR in the loop - how to make it work?
I need to go through a list of urls, and parse them with YQL. The obvious way - for loop with YQL query within - would not work, because YQL is asynchronous. Is there any other way to do it?
loop w/ array
Hello, I have this ~~~ var obtenerCategoria = Ti.Network.createHTTPClient({ onload : function(e) { var viewCategoria = []; var c = 0; var colores = 111111; var obtenerCategoriasData = JSON.parse(this.responseText); var...
add views in a tile like manner
I am wanting to create views in a loop and I want the views to be different sizes dependent on the content. I thought I had it cracked with this code: ~~~~ var win = Ti.UI.createWindow({ layout : 'vertical', backgroundColor:'#D9D9D9' ...
Multiple calls of service in a lopp
Hello Friends, Its very important, I stuck in service call in loop. For my app i need to call image upload service multiple time in a loop. I need to display these images on each row and row is populated from service call. following is the code ~~~ var...
Loop through parent view and hide its children's children
How would I loop through a parent view, and hide all it's children's children? I have tried this with no success... ~~~ for (var label in mainContainer.children) { if (mainContainer.children.hasOwnProperty(label)) { ...
Push Functions into an Array - Loop through and Splice?
Hi For my Titanium Mobile iPhone App, i need to be able to: 1: Push a certain amount of the same function (with a different parameter in each) into an array. 2: Then run each function one by one (for this example just an alert of the...
Multi MP3 files, but only plays the 1st file, not the rest....
Hi, I have 5 mp3 files, and need to play them one after another in one click. But the code only plays the 1st mp3 but not the rest. Please see the code below...Thank you for your help. ~~~ var win_main = Titanium.UI.currentWindow; var x =...
Looping vibration
Is there anyway to loop vibration ? I looked around API doc but could not find it. Then I tried to make a looping logic as below. But it did not work and ended up with infinite loop.... I would appreciate your advice on how to enable loop...
looping value error
Hello, I am using the below code to loop values var cellWidth = 145, cellHeight = 240, xSpacer = 5, ySpacer = 7, xGrid = 2, yGrid =20, tableData = [], cellIndex = 0; var vlu; vlu =20; for(var y = 0; y <= yGrid; y++) { var row =...
How to create UI controls in for loop?
Hi Guys, I am developing an android application in titanium studio 2.0.2 with Android 2.2. Currently I am stucked in a situation where I have to add UI controls (button and lables) in a loop because the no. of controls is dynamic and it depends on a...
fireEvent not catched in time
Hi, I have a problem with fireEvent. I have to display a progress bar that is animated by events that are called in a loop. Note that the loop that call fireEvent is in a different JS file, not on a same windows. The problem is that the first 2 or 3 events...
odd: HTTPClient loops unless AlertDialog is show.
I have a script that uploads an image to a remote server, this is the code i had for testing the success of the upload: ~~~ xhr.onload = function(e) { Ti.UI.createAlertDialog({ title:'Success', message:'status code ' +...
Remove duplicate objects from an array?
I'm returning an XML file from a server side database which includes some duplicate entries in the interiorName variable. What coding would I need to put in place to remove any duplicate entries? ~~~ var client =...
Unable to get array value using for loop
titanium mobile sdk 2.0.1. iphone sdk 5.1 Hi, This is the structure of my array named `ansArray` ~~~ ( { answer = c; question=1; }, { answer =d; question=2; } //...... //....... ) ~~~ I wanted to separate each values from the two...
Parsing an array into a variable
Hello guys, I've got a list of names that are returned from a database, and pushed to a TableView. I would like to grab them again (using the 'babyname' variable) and pop them into a single variable so I can write out my list so it can be emailed. It...
Loop and eventListener
Hi, I have a loop which create 4 buttons, each buttons has a specific action : ~~~ for (var i=0, i<4, i++) { var btn = Ti.UI.createButton({ ... }); btn.addEventListener('click',function(e){ alert(i); }); } ~~~ But if i click on btn 1, 2, 3 or 4....
Loop throgh table rows - working version
I have to look through all table rows (I don't have any sections and headers) I've tried this...
Titanium Studio CSS Format Error
I am using Titanium Studio on a Linux Ubuntu 11.10 Oneric. I am getting errors when I try to resolve a problem marked on the editor. The screen on the editor goes blank and you can only see the syntax by highlighting it. After a while editor will stop...
How to loop through variables to check for value of opacity or visibility
Titanium Mobile SDK: 1.8.2 Iphone SDK 4.3 Hi, I have name variables that holds labels using `Ti.UI.createLabel`. Samples of the variable names are: ~~~ sueContent jimmyContent shipContent et... ~~~ these are the options: ~~~ font: { fontSize:...
Can you update a single variable/row in an array?
Just curious, if you do a loop and narrow the array down to a couple rows or even a single row. Can you update one of the fields? Or do you have to remove it and reinject it into the array with the updated field. ~~~ var data = [ {color:'red', pattern:...
If there a way to split data into sections w/ headers?
So I have the following code ~~~ // Filter the Data to Category Selected var data = []; for(var i = 0, len = dataProducts.length; i < len; i++) { var type = dataProducts[i]; for(var j = 0, lenj = type.category.length; j < lenj; j++) { ...
Rotating Banner Error
Anybody see something I'm missing? The banner starts with the first banner image, but then rotates left (which is blank cause there is nothing there) and then goes right to the end... then of course rotates back to the first page. I need it to start...
Looping through XML
I am building a 3 level deep table group. It is going to be populated through XML which I am loading with the method below. The issue is starting at the second level. The first level shows up fine, 4 rows. Clicking on any of them results in displaying...
playing multiple looping sounds in sync, what's the best practice?
I am trying to have 5 multiple MP3's that you can toggle playing on and off.. They are a loop and should essentially "sync". Below is the example of what we are doing, with code redacted ~~~ loops[0] = Titanium.Media.createSound({ url:...
Adding Labels to the View - Dynamic Positioning
Hi On my iPhone App i am struggling to add labels to a view that don't overlap eachother and all have different top position values I am able to loop through my Items stored in an Array and create a label for each but the labels all have the same...
Custom integer picker
How would I create a picker for iOS that has 3 columns 1-9 integers in each column, and they would need to infinitely loop around like a date/time picker? I can figure out how to manually add each column with custom set data for each column, but they do...
Duplicate loops when creating TableViewSection with httpclient
I have 30 rows that will be grouped by 4 different sections. Everything is exported by creating httpclient from XML file. However, I have 30 rows that are grouped by 4 types of sections but then it does it again and again for 30 more times. I just want...
for...in loops and Android SDK 2.3.3
My details: - IDE platform OSX Snow Leopard 10.6.8 - Android SDKs installed 2 weeks ago with all up to date packages - Android testing device HTC Incredible (original version) running Android 2.3.7 - tested with Titanium SDK 1.7.5 and 1.7.2 - [INFO]...
Animation loop
Hi all! ======== I'm a newbie at programming and Titanium Mobile to. as I'm writing this, I'm working on my graduation project as a multimedia designer in Copenhagen, Denmark. My project is about mobile app's and i would really like you to help me. I have...
What a c$&p SDK...
So guys, just becoz i'm really disperate, i'm making an android and ios app and unfortunally i've decided to use titanium, the thing is that really it has a poor documentation and LOTS of bugs. Now i came across another problem(beside the one with the...
Nested XML Node issue
Hi All, I have a nested XML structure as follows: ~~~ <bookstore> <book> <title>Title 1</title> <year>2003</year> <author id="1">James McGovern</author> <author id="2">Per...
Select too many rows within a loop
Hi everyone, I have a trouble with a statement sql, i need to create a bucle like this: ~~~ var db = Ti.Database.install('db.sqlite', 'db'); var Len = json.length; // about 5000 registers for(var i = 0; i < Len; i++) { var rows =...
XML localName, nodeValue returning null
I'm trying to loop through what seems to be a simple xml file and can't get anything to work at all. I've exhausted all the resources I can find but It seems like I'm just doing this wrong. All I want to do is fetch each node titled 'row' and loop through...
Stuck in a loop?
I have already done this process on 3 other views in my application, and all worked fine. However, this time the "while" loop seems to be stuck and repeats until I kill the simulator and I don't get why: [Here is](http://pastie.org/2491587)...
Make a sleep function
Hi, i want to make a sleep function in a loop. I want a function wich sleep the app when i send some data on a remote server. I have a loop, i send files one by one but with the loop they were all sended at the same time and it's not what i want. How can...
Access Loop Number within Function
Hi Folks, So... Im trying to access the loop number (i) within my event listener! promoURL is an array. Alert below works fine. It outputs the whole array. But if i try and do promoURL[i] it refuses to work! promoURL[1], promo[2] work fine.. Sooo, how can...
Image Loop
Hi Folks, Im trying to figure out why this image loop wont work! Ti.API.info outputs thumb, but the image loop just donsent work! Nothing is output to the screen :( (Im using a static image just to test it!...
Create multiple variable in a loop
Hi, i want to how can i do to create multiple variable with a loop. Like this: ~~~ for (var j = 0; j < selectedData.length; j = j + 1) { var basicSwitch = Titanium.UI.createSwitch({ right:0, style:Titanium.UI.Android.SWITCH_STYLE_CHECKBOX, ...
Showing 1-50 of 76 1 2