The neoLottie sample not working - Forum

Forum Navigation
You need to log in to create posts and topics.

The neoLottie sample not working

Hi,

As the title suggests the neoLottie-sample app in VisNeo Web is not functioning - all files seem to be in place. Wondered if there has been some change in spec that's rendering it non-useable. I need the same functionality that is in the first button; "Load Animation" the code it triggers when clicked is:

neoLottieDestroy "Container1"
neoLottieLoadFile "Container1" true true "canvas" "pollo.json"
neoLottieSetEvent "Container1" "enterFrame" "addFrame"
neoLottieSetEvent "Container1" "loopComplete" "resetFrame"

But the pollo.json file doesnt load; i've checked and it does exist in the same directory as the project. All other functionality in the sample works Ok as expected.

I've also tried adding the 'pollo.json' file to the Project using 'App Properties' menu 'Libraries/files' tab - but still no joy.

Thanks

@visnejneo please be sure to compile your project and use a web server to run it (like the included neoPhp Server)
Loading local files requires a "Secure environment" and that's a requirement in all web browsers.
Let me know if you have additional questions.

Regards.

Hi Luis,

thanks for that excellent quick reply as per usual, I tried what you said but still nothing? Am i right in thinking i have to use the aliases in the config file when the server is running?

//$fileMaxUserLevel stores maximum logged-in user level allowed to perform operations on file.
//User level 0 (admin) is allowed to perform any operation on files.
//User level -1 indicates no user needs to be loged-in.
//This way you will not expose your file names.

$fileAlias[0]="file1";
$fileNames[0]="myfile.txt";
$filePermissions[0]="rw";
$fileMaxUserLevel[0]=0;

So i changed $fileNames[0]="myfile.txt"; to $fileNames[0]="pollo.json"; so i can reference the file in code as file1 but it wont let me save the config file changes?? or am i barking up the wrong tree. Update: i can save the file forgot to stop the server first. But still no joy error: file1 not recognised

thanks

@visnejneo no, it's not necessary to use or even create the config file as this application does not use any neoPhp plugin command.
It's only necessary to be sure all the required files (pollo.json) is within the compiled directory.

It should work just as the published sample:
https://visualneo.com/tutorials/neolottie/

It should be really easy to use :)

Hi Luis,

Checked the Inspector in Chrome and it appears to be a CORS issue; also tested in Firefox, Edge, same issue CORS!

Just an update to this: eventually i got it working by transferring the Project to my own WAMP Server on Localhost - i use Laragon and it provides a full WAMP environment. If anyone needs to know how to do this please let me know. I'm presuming we can replace the built-in NeoPHPServer with a local server serving PHP. This opens up different possibilities including using NGROK (which comes installed with Laragon). So with reference to another question i asked a few weeks ago regarding debugging server side stuff on real devices then we can achieve this with NGROK in Laragon and have a public accessible IP secure address to reach our local apps. Not sure how databases would work if we want to use Aliases as with NeoPHPServer. This might be worth a full 'write-up' for those who already have a local WAMP server installed in Windows.

@visnejneo the neoLottie sample should work under neoPhp server too (it avoids CORS problem). But of course you can use any other web server and Laragon is a very good one! You can also use neoPhp plugin under Laragon too. Just be suro to include the required file in your project (config.php) and that's all :)
VisualNEO Web can work with any server side scripting language and benefit from any other web technology.

visnejneo has reacted to this post.
visnejneo

@luishp,

Yes that's all good to know and will be really useful  - i was wondering how i could integrate VisualNeo Web into my existing Local system and this is a great step. I'm already editing the CSS and js files in VSCode - this is a great system and i'm still only testing the evaluation version. Wish i would have found VisualNeo  earlier on.

Thanks as always for your help Luis.

 

luishp has reacted to this post.
luishp