I have a movie with a changing background. I load external movies after one of the buttons is pressed and they appear al on a different place.The code to control my buttons is:
function setButton() {
for (var i in menuMc) {
if (menuMc*._name.substr(0, 4) == "btn_") {
clip = menuMc*;
clip.onRollOver = function() {
// etc etc etc......
}
}
}
}
I have a preloader for the external swf’s and that is working fine, but because of the changing backgroud it should appear on different x positions depending which btn_ was pressed. Is there a possibilty to integrate something to make such thing work in my button function.
[color=red]Example:[/color]
When btn_home is pressed the preloader should appear on _x 425 and and when btn_about is pressed on _x 550 etc etc
clip.onRelease = function() {
preloader_mc._x = this._x;
…
}
maybe having to add something to this._x depending upon reg points etc.
If instead, you decide that you want to use an array, then it should be very easy because of the ivar property you created before.
put each position in order in the array
myArray =[100,200,300,…]
//the above is not in your function
so is this for another set of buttons, just to load in different movies including the one you posted before? (just that the code you posted looks the same as the other movie)
If you are still using the for in loop and the buttons are contained in menuMC(again)
myArray =[100,200,300…] //on the same timeline
function setButton() {
for (var i in menuMc) {
if (menuMc*.name.substr(0, 4) == "btn") {
clip = menuMc*;
clip.ivar = i
I was a bit to quik with my thank you. The buttons are indeed in menuMC and I placed the array with the different _x positions at the same timeline I added clip.ivar = i; to the function. I even tried it with a seperate mc (test_mc) what is visible all the time, but it isn’t working
The trace (this.ivar) gives btn_home, btn_service etc but nothing happens otherwise. I even tried it with a seperate mc because off-line (Ctrl-Enter) the preloader isn’t visible.
I have the file attached, maybe you see what i’m doing wrong