I want give my feedback to this plugin.
First I created a Javascript file which contain a functional Javascript code.
It works and load like a charm when the JS file is located to the SAME folder of index.html file
..
Meaning that the Scriptfile parameter of the CallJS plugin is set to:
> myScripts.js
[/code:eniy3ksa]
But give a reference error when I want use sub-folders like: (created a 'g' subfolder and put myScript.js file into it).
Then
I set the Scriptfile parameter of the CallJS plugin to:
[code:eniy3ksa]
/g/myScripts.js
[/code:eniy3ksa]
[b]OR[/b]
[code:eniy3ksa]
g/myScripts.js
[/code:eniy3ksa]
It won't load the file and give instead a ReferenceError error.
Want precise I use
Scirra Construct 2 BETA 192 (since I want have the Cordova Export option later!)
And Free Version.
Is it functionnal through a Personal paid Version or not too ?
Why ?
How fix it or workarounding it ?
Oh... I found that it is only not functionnal in Node-Webkit preview or HTML 5 preview...
Well, same problem like the Load file action from Request URL within AJAX plugin.
Don't think you can do anything for that, but, look at this useful post for make a workaround for making it working:
(
I asked this question : Why we can't locally load files in Preview Mode in Node-Webkit ??
Then I got a working answer from R0j0hound:
[quote:eniy3ksa]
We can though. In node-webkit preview if you use "document.xml" as the file it will look here:
"http://localhost:50000/document.xml"
If you want to get the file from the same folder as the capx you need to type it in explicitly:
"C:\Users\rojo\Documents\c2projects\document.xml"
And to make it work in preview or in export you could use a global like this:
global text AppPath = "C:\Users\rojo\Documents\c2projects\"
Start of layout
System: [NEGATE] is in preview
--- set AppPath to NodeWebkit.AppFolder
And then request any files with:
AppPath & "document.xml"
)
So If you can give us the ability to SET the Scriptfile url dynamically within a Construct 2 Action like:
-- Set Scriptfile url to
We can then be able to do this :
global text ScriptFileAppPath = "C:\my\external\path\with\subFolders\"
Start of layout
System: [NEGATE] is in preview
--- set ScriptFileAppPath to NodeWebkit.AppFolder
And then requesting our files with the new Action I talking about:
-- Set Scriptfile url to ScriptFileAppPath & "myScripts.js"