Hi Munsing,
Good initiative to repost that info here for posterity. Just for completeness an alternative solution, add the script to the skin itself:
1) Add the <scriptname>.sj file to the skin archive
2) Add a line <script src="<scriptname>.sj" /> to the main skin XML file
3) If the added script has a program.onLoad = <scriptstartfunc> line and the existing skin has a program.onLoad = <mainstartfunc> line, then add a line scriptstartfunc() to the existing mainstartfunc function. Delete the program.onLoad line from the added script.
Note that this solution makes all global variables and functions shared between added script and original script in skin, if any are named identical this will need to be fixed.
I included this alternative here mostly because this way you can have a dedicated versions of an existing script for a skin. If you are just using a single call to a script the exported function will work just as well.
SilverEagle
addSkinsButton
-
- Posts: 713
- Joined: 30. Sep 08, 14:00
- Location: Netherlands [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable