I’m having some issues using adobe air in conjunction with backbone. The problem is that in the beginning of my program, I specify a url for my Backbone.Controller which uses that to set the url attribute of my Collection. And when the program starts, Backbone uses that url, to get a response and calls the parse function in my collection, where I use that response and construct appropriate model from. The problem is that at the beginning, if I specify a relative path to the .xml file, it works, but if I specify a full path, it doesn’t work, meaning that the response argument in the parse function for the collection is null. Here is some code:
//works
$(document).ready(function(){
window.myApp = MyApp({ url : "/data/file.xml" } )
})
///..
var MyApp = Backbone.Controller.extends({
/* setup routes */
initialize: function(opt){
this.tree = new MyTree();
this.tree.url = opt.url;
}
})
//...
var MyTree = Backbone.Collection.extends({
model: myTreeModel,
parse: function(response){ /* do stuff with response */ }
});
The above works if I use relative path, but If I use full path like this
window.myApp = MyApp({ url : "file:///C:/Users/userName/MyProject/data/file.xml" } )
the response sent to parse is undefined. Anyone have a clue?
I had to use their application scheme, so prepending app: worked.