Comunidad de diseño web y desarrollo en internet online

Problemas con el atributo id (etiqueta <img>) con CSS

Citar            
MensajeEscrito el 11 Sep 2008 06:37 pm
Hola a todos, hace años que no paso por aquí. Disculpen mi ingratitud :P

Tengo un problema y no encuentro la solución(si la hay) y es el siguiente:


Trabajando en Flash 8 con texfields con HTML no tengo problemas para agregar un MovieClip(de la biblioteca) con la etiqueta <img> y utilizando el atributo id acceder a el por medio del textfield,
pero cuando quiero hacer lo mismo utilizando un estilo CSS en mi textfield es como si el atributo id no funcionara. Si alguien sabe porque puede ser :'(

Este es el Código:

Sin CSS(no hay problemas)

Código :

texto_txt.htmlText += "<img width='124' height='124' src=\"clip\" vspace='5' hspace='10' align='left' id='clip'></img>";

y por ejemplo hacer algo como esto: text_txt.clip._alpha = 60;

Con CSS

Código :

var estilo:TextField.StyleSheet = new TextField.StyleSheet();
estilo.load("digicss.css");
texto_txt.styleSheet = estilo;
texto_txt.htmlText += "<titulo><p align='center'>CSS Prueba</p></titulo>";
texto_txt.htmlText += "<img width='124' height='124' src=\"clip\" vspace='5' hspace='10' align='left' id='clip'></img>";


Después de agregarle el estilo al textfield no puedo acceder más con el id, si alguien sabe porque estoy agradecido.
Busque en todas partes pero no encontre nada.

Saludos.

Por roxer

3 de clabLevel



 

firefox
Citar            
MensajeEscrito el 11 Sep 2008 07:26 pm
Haz un onLoad del estilo y después que lea puedes hacer lo que quieras con el clip.


Código ActionScript :

var estilo:TextField.StyleSheet = new TextField.StyleSheet();
estilo.load("digicss.css");

estilo.onLoad = function():Void{

   texto_txt.styleSheet = estilo;
   texto_txt.htmlText += "<titulo><p align='center'>CSS Prueba</p></titulo>";
   texto_txt.htmlText += "<img width='124' height='124' src=\"clip\" vspace='5' hspace='10' align='left' id='clip'></img>";
   
   //---Ahora puedes acceder al clip
   texto_txt.clip._alpha = 20;
}

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox
Citar            
MensajeEscrito el 11 Sep 2008 07:31 pm
Uh, mil gracias. Me tenía los pelos de punta esto.

Gracias de nuevo y saludos.

Por roxer

3 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.