PDA

View Full Version : Condition layer display to scale value


NeoWORX
12-27-2005, 12:47 PM
Hello,

I am struggling with what I thought would be quite easy to achieve... I would like to display layers only when a certain x_scale value is reached. Say, you zoom on a map and the more you zoom the more layers will be displayed (borders -> country names -> city names -> etc.).

Could you please put me on the right track?

Thanks,

Roberto

Flash Gordon
12-30-2005, 06:33 AM
what are "layers"?

NeoWORX
12-30-2005, 08:50 AM
OK, say I have a map of the world on one layer (what Flash calls layer). On the next layer I have the names of all the countries and on a third layer I have the names of cities. The movie is obviously cluttered with lots of text since its initial size if fairly small.

Right now I have a script that allows me to zoom on the whole scene (layer with map, layer with country names and layer with city names) when clicking with the mouse. What I would like to do is have my script display the names of the countries and cities only after I zoomed beyond a certain point. Say, the country names will appear when x_scale=300 and the city names when x_scale=600.

Sorry if I am not being clear or using the correct Flash terms, but me newbie.

Roberto

Flash Gordon
12-30-2005, 05:12 PM
well. you could make the names of countries a movie clip.

onEnterFrame = function() {
if(map._xscale > 300) {
delete this.onEnterFrame;
map.attachMovie("names", "names", 99);
}
}

Well, that is about the best I can do without actually seeing your fla.