I get the following object as a paramter via a function call from a flashMovie. So I have a simple javascript function like savePro(info) that is called from a flashmovie.
So I can simply console.log(info) and I get this.
{"action":"setProjectAll", "application":{"proId":"new","zoomPosition":35,"scrollerPosition":0,"language":"en","timelinePosition":0}, "clips":[]}
I have a variable var id = 12 inside my js file. This variable is dynamic but it always holds a number.
How can I replace the "proID":"new" inside the json object with the id of my variable?
So I want to have …
{"action":"setProjectAll", "application":{"proId":12,"zoomPosition":35,"scrollerPosition":0,"language":"en","timelinePosition":0}, "clips":[]}
afterwards.
I have absolutely no idea how to do so?
Thank you in advance!
Well, if this is actual
JSONtext you’re talking about, you’d either need toThe latter would be like this…
If you really do not have
JSONdata, then you’d just manipulate it in the manner that you’d find in any beginner JavaScript book.That would be the same approach as the second line of code above…