Stencyl 3.4.0 is now out. Get it now!

Using firbase as database almost works.

CPHvidovre

  • *
  • Posts: 2
Works fine with getting data from firebase ...wooohoo!

but when i try to put data from stencyl it wont work!
i have testet that it works from a test site.
See the video and please.....please helmp me :)

https://www.youtube.com/watch?v=y5ce2PxXs6M&feature=youtu.be


TheIndieStation

  • *
  • Posts: 2191
Stencyl doesnt support Firebase atm as far as I know

yoplalala

  • *
  • Posts: 1412
The block in Stencyl "POST" data but doesn't PUT data

First of all

I would look at the postToURL fubntion  https://github.com/Stencyl/stencyl-engine/blob/a6572f24a817c35ca91c6d5821f802433c130946/com/stencyl/behavior/Script.hx#L3560

Code: [Select]
public static function postToURL(URL:String, data:String = null, fn:Event->Void = null)
{
if(fn == null)
{
fn = defaultURLHandler;
}

var request:URLRequest = new URLRequest(URL);
request.method = URLRequestMethod.POST;

if(data != null)
{
request.data = new URLVariables(data);
}

try
{
var loader = new URLLoader(request);
loader.addEventListener(Event.COMPLETE, fn);

#if flash
loader.addEventListener(IOErrorEvent.NETWORK_ERROR, defaultURLError);
loader.addEventListener(IOErrorEvent.IO_ERROR, defaultURLError);
#else
//making sure the connection closes after 0.5 secs so the game doesn't freeze
    runLater(500, function(timeTask:TimedTask):Void
{
loader.close();
});
#end
}

catch(error:String)
{
trace("Cannot open URL.");
}
}

modify the file and replace  URLRequestMethod.POST  by URLRequestMethod.PUT
if it works, I would try to make my own block.

By just changing the code, does it work ?

SadiQ

  • Posts: 1724
How about checking for errors in chrome's console? ( SHIFT+CTRL+i )
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.