cimicimi
cimicimi

Reputation: 218

how to make invisible some layers with actionscript?

I have a map and i can use on (release), on (rollover) but i can't use onload function. I want some cities will be invisible on load. My code is here with images;

Here is my city code:

on (rollOver) {              //this code is on all city.
y = new String(_name);
a = y.slice(1, 3);
_parent.rbtxt(a);
}
on (rollOut) {
_parent.rbalon(a);
}
on (release) {
_parent.rpress(a);
}

Here is my actionscript codes:

ilad="a,Adana,Adıyaman,Afyon,Ağrı";  //.. more city
ilurl="a,adana,adıyaman,afyon,ağrı"; //.. more city
passivearray="b,adana,afyon"         //must be passive this cities.

function rbtxt(a) {
var Register_1_ = a;
var Register_2_ = this;
balon._visible = true;
arbtxt = ilad.split(",");
balon.txt.text = arbtxt[Register_1_];
Register_2_[("x" + Register_1_)].play();
balon._x = Register_2_[("x" + Register_1_)]._x;
balon._y = (Register_2_[("x" + Register_1_)]._y - Register_2_[("x" + Register_1_)]._height / 2) - 25;
}

function rbalon(a) {
balon._visible = false;
this[("x" + a)].gotoAndStop(1);
 }

Should be passive array is => passivecities. How can i make invisible somecities ?

Upvotes: 0

Views: 94

Answers (2)

Prid
Prid

Reputation: 1624

Have you tried:

on(load){
    this._visible = false;
}

Upvotes: 0

Nicholas Mansfield
Nicholas Mansfield

Reputation: 140

At the beginning of your script, you can use

movieclipName._visible=false;

Then you modify the same property to reverse that.

Upvotes: 1

Related Questions