Question
Better solution?
Hi,
I am very new to Actionscript andhave been looking for a way to load data from a php/mysql source into flash upon clicking buttons in my flash movie. I have created this method below and i simply would like to know if this is the/a correct way of doing it or is there a simpler way?
1) I have X number of keyframes in my movie.
2) Have X number of navigation buttons in my movie which each move the timeline to an associated keyframe on(Release)
3) On each keyframe I have the following code (but the ?id= i pass to the php page is different depending on the keyframes, therefore retrieving different data each time:
var reply_lv = new LoadVars();
var send_lv = new LoadVars();
send_lv.sendAndLoad(" http://localhost/test/test.php?id=3", reply_lv, "POST");
reply_lv.onLoad = loadedVars;
function loadedVars(success){
if(success) {
mytext_txt.text = reply_lv.title;
myid_txt.text = reply_lv.link;
} else {
// operation failed
}
}
Could any gurus out there tell me if this is a standard approach or have I just managed to make a complet mess of my movie?
Kind Regards and thanks in advance.
K
I am very new to Actionscript andhave been looking for a way to load data from a php/mysql source into flash upon clicking buttons in my flash movie. I have created this method below and i simply would like to know if this is the/a correct way of doing it or is there a simpler way?
1) I have X number of keyframes in my movie.
2) Have X number of navigation buttons in my movie which each move the timeline to an associated keyframe on(Release)
3) On each keyframe I have the following code (but the ?id= i pass to the php page is different depending on the keyframes, therefore retrieving different data each time:
var reply_lv = new LoadVars();
var send_lv = new LoadVars();
send_lv.sendAndLoad(" http://localhost/test/test.php?id=3", reply_lv, "POST");
reply_lv.onLoad = loadedVars;
function loadedVars(success){
if(success) {
mytext_txt.text = reply_lv.title;
myid_txt.text = reply_lv.link;
} else {
// operation failed
}
}
Could any gurus out there tell me if this is a standard approach or have I just managed to make a complet mess of my movie?
Kind Regards and thanks in advance.
K
