I’m working on a mileage log in flash, using PHP and MySQL.
When the flash file loads it calls a php file which queries the DB to return the current milage. Then the AS advances the MC to the current mileage.
The user then clicks the next mile-marker button to advance the tracker 1 mile. The AS on the button calls a php file which increments the mileage variable then returns the new value. There in an onData function which takes the new value and advances the MC to the new mileage.
Now what’s happening is that in the Flash Player and Firefox(Mac/WinXP) it is working perfectly, but when I try it in Safari and Explorer(WinXP), the update AS does not work properly (All using the v7 player). The Movie loads and jumps to the correct frame; the problem occurs the third time the increment button is clicked. The first two times it works perfectly, but on the third click the MC jumps back one mile and the mileage value is decremented.
Now I don’t know why this would work differently in different browsers, but it is, and if anyone had any input I would greatly appreciate it.
here is the AS I’m using for the Start value and the Update values:
//Get Start values in first frame of _root
_global.getMiles = "path:to/progVal.php?sid=" + sid;
_global.putMiles = "path:to/logUpdate.php?sid=" + sid;
startVal = new LoadVars();
startVal.load(getMiles);
startVal.onLoad = function() {
_root.top_count.gotoAndPlay(startVal.miles);
_root.track_mov.gotoAndPlay(startVal.miles);
}
====================================
// Update Mileage Value in first frame of mc
// showing mileage and with increment buttons
updateVal = new LoadVars();
// Function to call updateVal.php
// applied to on(release) of update button
function updateClik() {
updateVal.load(putMiles);
}
updateVal.onLoad = function() {
_root.top_count.gotoAndPlay(updateVal.miles);
_root.track_mov.gotoAndPlay(updateVal.miles);
}