Posicionamiento dinamico.
3 seguidores
Como podría posicionar un movieclip atendiendo a las dimensiones de la imagen que cargue dinamicamente en su interior.
mi peli es de 300*400. he probado esto, pero no rula
_root.createEmptyMovieClip(cargador,_root);
loadMovie("im"+fotonum+".jpg",cargador);
w=getProperty(_root.cargador,_width);
h=getProperty(_root.cargador,_height);
setProperty(_root.cargador,_x,(400-w)/2);
setProperty(_root.cargador,_y,(300-h)/2);
Josh
suponiendo que estas en _root:
<code>this.createEmptyMovieClip("cargador")
this.cargador.createEmptyMovieClip("imagen")
this.cargador.onEnterFrame = function() {
if(this.imagen.getBytesLoaded()>0 && this.imagen.getBytesLoaded()>=this.imagen.getBytesTotal()) {
this._x = Math.round((this._parent._width-this._width)/2);
this._y = Math.round((this._parent._height-this._height)/2);
delete this.onEnterFrame;
}
}
this.cargador.imagen.loadMovie("tuimagen.jpg")</code>
Neopolita
lo he adaptado:
onClipEvent (enterFrame) {
receptor2= new LocalConnection();
receptor2.cargador=function(fotonum)
{
_root.createEmptyMovieClip("cargador")
_root.cargador.createEmptyMovieClip("imagen")
_root.cargador.onEnterFrame = function() {
if(this.imagen.getBytesLoaded()>0 && this.imagen.getBytesLoaded()>=this.imagen.getBytesTotal()) {
this._x = Math.round((this._parent._width-this._width)/2);
this._y = Math.round((this._parent._height-this._height)/2);
delete this.onEnterFrame;
}
}
_root.cargador.imagen.loadMovie("im"+fotonum+".jpg");
}
receptor2.connect("conexion2");
}
y no rula
:-(
ozke
En principio estas metiendo un enterframe dentro de otro, por eso no rula no? :?
Neopolita
ahh,coño, gracias
Neopolita
no,desde un frame tampoco funciona