I have some values in a loop.php that generate a link like "page.php?id=1" "page.php?id=2" ecc.
I need to pass the value of "id" into actionscript3, who read a link page.php like this:
var myVars:URLVariables = new URLVariables();
myVars.flashVar = "myValue";
var myRequest:URLRequest = new URLRequest("page.php");
myRequest.method = URLRequestMethod.POST;
myRequest.data = myVars;
var myLoader:URLLoader = new URLLoader();
myLoader.addEventListener(Event.COMPLETE, completeHandler);
myLoader.load(myRequest);
function completeHandler(e:Event){
var receiveVars:URLVariables = new URLVariables(e.target.data);
vartxt1.text = receiveVars.phpVar1;
the problem is that i could change the link in actionscript like this:
var myRequest:URLRequest = new URLRequest("page.php?id=1");
but the problem is that is a static link, and if my value is changing to "4", then the link is working always with the value of "1".
i have think that maybe i could write an .xml with the value, and put actionscript to read that file...practically:
page.php?id=1 => page.xml.php (writing the xml) => redirect to page-with-swf-file.html
and when i'm on the page-with-swf-file.html
i read the page.xml.php
for the "id", and then load all the rest of the data that i need.
Is there an easier way of doing all this go-forward then go-back...?