jwhittlestone
Programmer
I think I may have the referncing incorrect to alter the _xscale property of a movie clip within a movie clip
The bars should be showing as I alter the _xscale property in a function, but this is not happening. I hope someone may be able to help an AS newbie (as I'm close to tears )
As you can see, the vote data is fetched from the db ok and displays.
Percentages are calculated from the vote figures and this is functioning ok as you can see from the text box on the left. ie.
var percent1 = (Number(votes1) / total) * 100;
In the same frame where these percentages are worked out, this code is executed to alter the _xscale property ie.
percentBar1.setPos(percent);
The function definition to this is in the first frame of the movieclip of which percentBar1 is an instance. ie.
function setPos (percent){
bar._xscale = percent;
}
bar is an instance on the timeline in the same frame as this definition (the timeline is only one frame long.
I'm used to director - and am not too sure about referencing of instance vars. The fla file can be found here
thanks so much in advance
Jon
The bars should be showing as I alter the _xscale property in a function, but this is not happening. I hope someone may be able to help an AS newbie (as I'm close to tears )
As you can see, the vote data is fetched from the db ok and displays.
Percentages are calculated from the vote figures and this is functioning ok as you can see from the text box on the left. ie.
var percent1 = (Number(votes1) / total) * 100;
In the same frame where these percentages are worked out, this code is executed to alter the _xscale property ie.
percentBar1.setPos(percent);
The function definition to this is in the first frame of the movieclip of which percentBar1 is an instance. ie.
function setPos (percent){
bar._xscale = percent;
}
bar is an instance on the timeline in the same frame as this definition (the timeline is only one frame long.
I'm used to director - and am not too sure about referencing of instance vars. The fla file can be found here
thanks so much in advance
Jon