View Single Post
Old 05-13-2008, 04:38 PM   #93
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,671
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
Hi Wolf,
I don't think it's too difficult. From looking at the script it looks all that is required is the following changes <see below>

If the state change is triggered by setting the environmental variable from STATE=?? to STATE="AUTORUN" it should trigger the autorun.xml/autorun.js scripts.

Caviate: I have not programmed on the SONY but the syntax is easy enough to read and understand.

<<<<<<<<<<< applicationStart.xml
////// MAP THE KEY
<boolean key="0x27-hold" do="dolaunchAutoRun"/>

<<<< main.xml
////// THIS CODE IS THEN CALLED
<code>
<function id="dolaunchAutoRun">
this.setVariable("STATE", "AUTORUN");
// I don't think this is necessary the line above should
// trigger this call, but if it doesn't we call it
this.modelChange();

</function>
</code>

If that doesn't work we might have to add part of this code found in the autorun.xml
in the main.xml file
<code>
<function id="loadScript">
if (!this.hasOwnProperty('_scriptLoaded'))
this._scriptLoaded = false;
if (!this._scriptLoaded)
{
var path = kbook.autoRunRoot.path;
var index = path.lastIndexOf('/');
if (index > 0)
path = path.substring(0, index + 1);
this.driveroot = path.substring(0,2);
var target = this.AUTORUN_GROUP.AUTORUN;
target.driveroot = this.driveroot;
this.runJs(path+"autorun.js",target);
}
this._scriptLoaded = true;
</function>
</code>

<<<< main.xml
/////////////// Update modelChange to call the loadscript function
<function id="modelChanged">
....
case "AUTORUN":
this.loadScript();
this.AUTORUN_GROUP.show(true);
target = this.AUTORUN_GROUP.AUTORUN
break;
....
</function>

Last edited by =X=; 05-13-2008 at 05:00 PM. Reason: omitted some code
=X= is offline   Reply With Quote