How to fix HTTP Request error?

Wasanni

  • *
  • Posts: 136
Hey! I've been following the instructions on Stencylpedia to make an HTTP Request and I keep getting an error. I tried something simple like getting a number from a .txt file on dropbox like in the example but it won't work. I've been trying for hours and no luck. Does this block still work? Does anyone have an example of this still working?

Thanks :)







This is the error message. It looks like it "cannot load data from https://www.dropbox.com/s/pm5ufn9xmnqwhuc/Test.txt". I tried running on Android as well.


Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: file:///C|/Users/Wasanni/AppData/Roaming/Stencyl/stencylworks/games%2Dgenerated/Project%20M/Export/flash/bin/Project%20M.swf cannot load data from https://www.dropbox.com/s/pm5ufn9xmnqwhuc/Test.txt.
   at com.stencyl.behavior::Script$/visitURL()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\behavior\Script.hx:3661]
   at scripts::SceneEvents_0/init()[C:\Users\Wasanni\AppData\Roaming\Stencyl\stencylworks\games-generated\Project M\Source\scripts\SceneEvents_0.hx:91]
   at com.stencyl.behavior::Behavior/initScript()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\behavior\Behavior.hx:107]
   at com.stencyl.behavior::BehaviorManager/initScripts()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\behavior\BehaviorManager.hx:97]
   at com.stencyl::Engine$/initBehaviors()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:1257]
   at com.stencyl::Engine/loadScene()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:1156]
   at com.stencyl::Engine/begin()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:949]
   at com.stencyl::Engine()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib\stencyl\1,00\com\stencyl\Engine.hx:738]
   at Universal/preloaderComplete()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib\stencyl\1,00\Universal.hx:410]
   at lime.app::_Event_Void_Void/dispatch()
   at scripts::StencylPreloader/unload()[C:\Users\Wasanni\AppData\Roaming\Stencyl\stencylworks\games-generated\Project M\Source\scripts\StencylPreloader.hx:334]
   at scripts::StencylPreloader/onLoaded()[C:\Users\Wasanni\AppData\Roaming\Stencyl\stencylworks\games-generated\Project M\Source\scripts\StencylPreloader.hx:303]
   at lime.app::_Event_Void_Void/dispatch()
   at lime.utils::Preloader/start()
   at lime.utils::Preloader/updateProgress()
   at lime.utils::Preloader/current_onEnter()

cabinfever

  • Posts: 159
Have you allowed the flash-component to query/connect to external sources.
Somewhere in the flash control panel, you can control those things.

Maybe info from here will help you?
https://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

mdotedot

  • Posts: 1654
You have two issues. One is that you are trying to access a site from HTML5 or Flash which is prohibited if it is not on the same server. Like what CabinFever wrote!

The other is that the text file you try to acces is hosted on Dropbox that does not provide a straight textfile but rather a complete webpage (even redirected)

Android publication shouldn't give you the sandbox problem but it is giving you the issue with the Dropbox file not being the file you think it is!
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Wasanni

  • *
  • Posts: 136
It's working! Thank you both!! I uploaded a .txt file to my web server to test and it works! The issue was dropbox like you said. I'm testing on Android for now until I fix the flash permissions; going to look through that flashplayer documentation so I can test on my pc as it's more convenient and then I'm going to see if I can get POST to work.

Thanks a lot!!! :)