Hi.
I am a new user and have a little problem.
I make a http request and get a json file which I collect in response variable.
Used a debug dialogue to verify that I did get a valid Json response.Status 200.Fine.
Next I did
data=fromJSON(response);url=data[0]['url'];
Because I want first url from 3 URLs it sent.
But when I execute it gives the error I posted screenshot.
Also I later plan to use the url I receive from json parsing script to download pic.And again I guess if I put url variable in "download" url flow it will give no protocol used error.Since I must use http or https in the url box.So my next question is how to use the url I extract from json parsing to download pic.
Many thanks.Hope I haven't made the issue confusing.
Action Script fromJSON ,Value null error
Moderator: Martin
Re: Action Script fromJSON ,Value null error
data = fromJSON(response);
response = data["response"];
images = response["images"];
large_url = images["large"]["url"];
In one line
large_url = fromJSON(response)["response"]["images"]["large"]["url"]
response = data["response"];
images = response["images"];
large_url = images["large"]["url"];
In one line
large_url = fromJSON(response)["response"]["images"]["large"]["url"]
Re: Action Script fromJSON ,Value null error
Thank you so much Anurag.Will give it a try, and update.
Re: Action Script fromJSON ,Value null error
Still getting error Anurag!!
Re: Action Script fromJSON ,Value null error
Don't use both use one
Or
Code: Select all
data = fromJSON(response);
response = data["response"];
images = response["images"];
large_url = images["large"]["url"];
Code: Select all
large_url = fromJSON(response)["response"]["images"]["large"]["url"]
Re: Action Script fromJSON ,Value null error
I deleted these lines and just kept the single line of code you listed.Now it doesn't give error.
Removed these lines
data = fromJSON(response);
response = data["response"];
images = response["images"];
large_url = images["large"]["url"];
Just kept
large_url = fromJSON(response)["response"]["images"]["large"]["url"]
Can I use large_url variable to download the pic??
I tried but gives no protocol error.
Removed these lines
data = fromJSON(response);
response = data["response"];
images = response["images"];
large_url = images["large"]["url"];
Just kept
large_url = fromJSON(response)["response"]["images"]["large"]["url"]
Can I use large_url variable to download the pic??
I tried but gives no protocol error.
Re: Action Script fromJSON ,Value null error
Attach debug dialog next to above script and check large_url starts with https://
Re: Action Script fromJSON ,Value null error
You awesome dude!!!
Thanks and lots of love.
Finally working.
Thanks and lots of love.
Finally working.