Hello all,
I am completely at a loss on this one I mean to me it looks like it should work I’m even 99% of the reason it doesn’t work but serveral work arounds and experiments later and I’m no closer to solving it in a manner that I would like.
dynamic class scripts.actionScript.selectCarScript extends MovieClip {
var mainStats:Object;
var carCost:Object;
var buyCar:Object;
var carName:Object;
var bankMov:Object;
var carPicture:Object;
var sendingVars:LoadVars;
var recievingVars:LoadVars;
var carId:Array = [1,2,3,4];
var arrayPlace:Number = 0;
function selectCarScript() {
mainStats = new Object();
mainStats.movie = this.attachMovie("mainStatsMov", "mainStatsMov", this.getNextHighestDepth());
mainStats.movie._x = 24.9;
mainStats.movie._y = 26;
carCost = new Object();
carCost.movie = this.attachMovie("carCost", "carCost", this.getNextHighestDepth());
carCost.movie._x = 858.2;
carCost.movie._y = 57.6;
buyCar = new Object();
buyCar.movie = this.attachMovie("buyCar", "buyCar", this.getNextHighestDepth());
buyCar.movie._x = 857.5;
buyCar.movie._y = 91.7;
carName = new Object();
carName.movie = this.attachMovie("carName", "carName", this.getNextHighestDepth());
carName.movie._x = 459.9;
carName.movie._y = 235.8;
bankMov = new Object();
bankMov.movie = this.attachMovie("bankMov", "bankMov", this.getNextHighestDepth());
bankMov.movie._x = 858;
bankMov.movie._y = 23;
bankMov.movie.bankMovText = "Bank: "+"£"+_global.initialBank;
phpUpdate();
}
function phpUpdate() {
sendingVars = new LoadVars();
recievingVars = new LoadVars();
recievingVars.onLoad = function(phpLoaded) {
if(phpLoaded){
carMake = this.carName;
carBhp = Number(this.bhp);
carHandling = Number(this.handling);
weight = Number(this.weight);
reliability = Number(this.reliability);
aerodynamics = Number(this.aerodynamics);
carCost = Number(this.carCost);
myNewFunction();
trace("I'm definatly getting checked");
}
}
sendingVars.sendAndLoad("http://localhost/cargame/scripts/php/cars.php?id="+carId[arrayPlace],recievingVars,"POST");
}
function myNewFunction(){
trace("hello");
}
}
So as you can see phpUpdate gets called once from the selectCarScript function, it then cycles through my phpUpdate function successfully loading up all my external vars etc. Even the trace works but for some reason it’s not moving onto the next function which in this case is myNewFunction. I’m under the impression this should work fine and really have no idea why it’s not moving on!
Any ideas? Thanks in advance
Sigs