Hello coders, I'm in troubles with a nested clips iteration.

I really don't know where could be de bug, because when I'm trace
variables values, all seems to be right, but on the fly, the bug come
in action.

the concept is:

I have a set of data loaded from an xml file, the records contains
data which connect with a map.
These information could have 3 states (actual, future and past or 1, 2
and 3 code) and diferent events types. every one of these have an
unique id. like this

<provincia id="21" nombre="Guadalajara">
                        <promocion id="A001" nombre="luzhogar" tipo="2" 
tipologia="3"
coordenadasX="25" coordenadasY="40" link="00033.jps?valor"/>
                        <promocion id="A002" nombre="vidaverde" tipo="2" 
tipologia="1"
coordenadasX="40" coordenadasY="30" link="00011.jps?valor"/>
                </provincia>

so i have created an object to hande the data and I can do custom
searchs or apply filters to obtain subsets of data.

The issue appears when i try to expose a subset on the map, via icons
that reflects the state and other information from every record

when the tipology of each record is different from anothers, there is
no problem, but when two records have the same tipology code, the last
one override the first

I'm using this code:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function mostrarPromos(resultados) {
        cantidad = resultados.length;
        _root.mapa_MC.mapaPromocion.createEmptyMovieClip("datosPromociones",
_root.mapa_MC.mapaPromocion.getNextHighestDepth());
        var container = _root.mapa_MC.mapaPromocion.datosPromociones;
        
        for (var i = 0; i<cantidad; i++) {
                var mostrar = resultados[i];
                var clip = promocionesDatos[mostrar].promoId;
                container.createEmptyMovieClip(clip, 
container.getNextHighestDepth());
                var iconoTipo = "iconoTipo"+promocionesDatos[mostrar].tipoId;
                var clipIcono = "icono_"+clip;
                var clipDatos = "datos_"+clip;
                container[clip].attachMovie(iconoTipo, clipIcono,
container[clip].getNextHighestDepth());
                container[clip].attachMovie("detallesPromocion", clipDatos,
container[clip].getNextHighestDepth());
                container[clip][clipDatos]._alpha = 0;
                container[clip][clipDatos].nombreTipologia_txt.text =
promocionesDatos[mostrar].tipologiaNombre;
                container[clip][clipDatos].nombrePromocion_txt.text =
promocionesDatos[mostrar].promoNombre;
                container[clip][clipDatos].nombreProvincia_txt.text =
promocionesDatos[mostrar].provNombre;
                container[clip]._x = 
parseInt(promocionesDatos[mostrar].coordenadasX)+52;
                container[clip]._y = 
parseInt(promocionesDatos[mostrar].coordenadasY)+63;
                container[clip][clipDatos]._x = 14;
                container[clip][clipIcono].link = 
promocionesDatos[mostrar].link;
                container[clip][clipIcono].onRollOver = function() {
                        container[clip][clipDatos]._alpha = 100;
                };
                container[clip][clipIcono].onRollOut = function() {
                        container[clip][clipDatos]._alpha = 0;
                };
                container[clip][clipIcono].onRelease = function() {
                        getURL(this.link, "_self", "POST");
                };
                
        }
        
}


tracing this, reflect the correct data in each iteration, but I when
two or more records have the same tipology its goes wrong

If anybody can help me, I put the movie online to see it

http://www.e-foco.com/mapa/mapa_error.html

clicking in "costa" button you could see the error in action

thanks everybody.




--
SalU2


f a r i d | s i l v a | a b o i d
www.e-foco.com.ar
tel: +54 11 4115-0773
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to