Community Questions & Answers

Alloy Common Code

Hi, i am using Alloy to build an iPhone mobile App, and there's a part of the code that must be the same in the all sections... can i use something like include in PHP ?? thanks

More Samples for apps

I am reviewing samples from Trevor Ward's custom menu and Kitchen Sink. I would like to request more samples that follow the Listview in order to create tabbed and navigation based apps. Ill be using a Win 7 x64 computer. Thanks.

url:

Using the latest 3.1 Titanium studio with latest SDK. I am just trying to build a simple tabbed app. Going through the documentation reveals attaching windows via a url:"todo.js" Using commonjs and the latest build. This wont happen and gives me...

CommonJS Error: '' is not a constructor

The following code works only in Android but not on iPhone: Platform.js ~~~ function Platform() { } module.exports = Platform; ~~~ app.js ~~~ var Platform = require("platform"); var platform = new Platform(); ~~~ What am I doing wrong here?...

Scope in commonJS module

This code: ~~~ function Model() { return this.init(); } Model.prototype.init = function() { var self = this; self.getVehiclepos(); this.cron = setInterval(self.getVehiclepos, 5000); return this; }; Model.prototype.getVehiclepos = function()...

require commonjs with alloy

Hi, I created a folder in the same level with controllers, models, views folder. this folder is named lib and contains : analytics.js in index.js i writed require('/lib/analytics') but i have requested module not found.. where is the problem ? thanks

Problems managing CommonJS modules

Hi all, I am using Titanium Mobile SDK 3.0 to develop apps for iOS. I'm running OSX Mountain Lion. I am using the CommonJS approach. I'm having problems though. For the life of me, I cannot still figure out how to structure my code. Example: ~~~ /*...

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

CommonJS Modules as Windows and Memory

Hi, I am doing my best follow Ti Studio's best practices and I have the following situation/question. I have a module inside which there is a table view where each row is the id to an ACS place. When a row is clicked I call the following...

Titanium alloy & CommonJS files

I am using Titanium Alloy. Where should I be placing the CommonJS files in my project? The documentation indicates that the files should be placed relative to Resources folder, however this is dynamically generated in Alloy. When I place the file in say...

require() not working with CommonJS module

I have a module defined as such: analytics.js ~~~ function Track () { ... } ... module.exports = Track; ~~~ I am requiring the module like so: app.js ~~~ //CommonJS modules var Track = require('analytics'); zc.track = new Track(); ~~~ When I...

Alloy: require commonJS

I started a new project with alloy, (the Resources folder is hidden from the App and Project Explorer.) now i added a js file to project with path: app/models/person.js. In person.js i have: ~~~ var models = (function() { alert('hi...

http callback

I use Titanium Studio 3.01, Sdk 3.0.0.0GA, Xcode 4.6 on a Mac. I am still converting my apps to commonjs and am experimenting with call backs, can someone see what is going wrong in this code. Ti.Api.info shows the response is getting to unload but I get...

Alloy or CommonJS with Netbeans

Hi friends I am an old Titanium developer been using it since 1.2 SDK.For last one year I have not done any development and found about certain changes like introduction of **CommonJS** and now **Alloy** Now how do I use non Titanium Studio environment...

changing to common's

Hi, I use Titanium Studio 3.01, Sdk 3.0.0.0GA, Xcode 4.6 on a Mac and have spent the morning reading through the forum and guides about commonJS. I am trying to change over to this method of coding and now have my initial setup using the default tabbed...

Form validation using CommonJS

Hi I'm a noob building an Android app on Titanium 3.0.1 with Windows 7 and I'm building it using commonjs. On my login screen I want to validate a form and I want to put the validation function into a seperate file, like so: ~~~ //...

Several views one win best practise

Hi. I want to clean up my coding and make things the right way. What i have trouble understanding is how to get 3 different views in to same win and changing between them. Lets say that i have a win with a toolbar and three buttons on it. Each button...

the memory management of commonJS

i have a question about the memory management of commonJS module. considering the following two code slice, my question is when the `win` close, all objects defined in the module will be released? The following two situations are the same? ~~~ function...

Logindialog crashes

Hi, for realizing of login dialog I build a window: ~~~ exports.create = function(model, _callback) { var self = Ti.UI.createWindow({width : 272,height : 200,}); self.open(); self.cancel =...

Showing 1-50 of 285 1 2 3 4 5 6