Hi all,
In my app, i parse a parameter from Scene1 to Scene2.
This parameter is correctly declared In Scene2.
Here is the code of Scene2:
Code:
function Scene2Assistant(param) {
this.param1 = param;
}
This parameter is used to display a picture in Scene2 when Scene2 is activated
Here is the code :
Code:
Scene2Assistant.prototype.activate = function(event) {
this.myCountryDivElement.mojo.manualSize('320','350');
this.myCountryDivElement.mojo.centerUrlProvided('images/'+ this.param1 +'.jpg');
}
All works fine when an image file corresponding to the parameter exists.
what i want to do is to check if the file corresponding to the parameter parsed exists.
If Yes, then the value of this.param1 is take into account
If No, then i want to set a default value.
Is this test must be coded in protoype.setup as below ?
Code:
Scene2Assistant.prototype.setup = function() {
var file = Mojo.appPath + 'images/' + this.param1+'.jpg'
...................
..................
I browse the forum but not find something relevant.
What is the code to do it ?
Thanks for your help.