problème avec movie
- 7lorac
- Novice


- Inscription: Sep 28, 2004
- Messages: 15
- Loc: New Jersey
- Status: Offline
Salut! J'ai essayé de faire le tutorial pour la galerie photo:
http://www.kirupa.com/developer/mx/photogallery.htm \
Je ne suis pas en mesure de le faire fonctionner pour mon film! Je ne sais pas quoi faire! Im so frustrés. Heres le code:
Quelqu'un peut-il m'aider?? Id really appreciate it!
Merci!
Carol
http://www.kirupa.com/developer/mx/photogallery.htm \
Je ne suis pas en mesure de le faire fonctionner pour mon film! Je ne sais pas quoi faire! Im so frustrés. Heres le code:
Code: [ Select ]
this.pathToPics = "images/";
this.pArray = ["001.jpeg", "002.jpeg", "003.jpeg", "004.jpeg"];
this.fadeSpeed = 20;
this.pIndex = 0;
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
var p = _root.photo;
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
this.pArray = ["001.jpeg", "002.jpeg", "003.jpeg", "004.jpeg"];
this.fadeSpeed = 20;
this.pIndex = 0;
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
var p = _root.photo;
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
- this.pathToPics = "images/";
- this.pArray = ["001.jpeg", "002.jpeg", "003.jpeg", "004.jpeg"];
- this.fadeSpeed = 20;
- this.pIndex = 0;
- loadMovie(this.pathToPics+this.pArray[0], _root.photo);
- MovieClip.prototype.changePhoto = function(d) {
- this.pIndex = (this.pIndex+d)%this.pArray.length;
- if (this.pIndex<0) {
- this.pIndex += this.pArray.length;
- }
- this.onEnterFrame = fadeOut;
- };
- MovieClip.prototype.fadeOut = function() {
- if (this.photo._alpha>this.fadeSpeed) {
- this.photo._alpha -= this.fadeSpeed;
- } else {
- this.loadPhoto();
- }
- };
- MovieClip.prototype.loadPhoto = function() {
- var p = _root.photo;
- p._alpha = 0;
- p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
- this.onEnterFrame = loadMeter;
- };
- MovieClip.prototype.loadMeter = function() {
- var i, l, t;
- l = this.photo.getBytesLoaded();
- t = this.photo.getBytesTotal();
- if (t>0 && t == l) {
- this.onEnterFrame = fadeIn;
- } else {
- trace(l/t);
- }
- };
- MovieClip.prototype.fadeIn = function() {
- if (this.photo._alpha<100-this.fadeSpeed) {
- this.photo._alpha += this.fadeSpeed;
- } else {
- this.photo._alpha = 100;
- this.onEnterFrame = null;
- }
- };
Quelqu'un peut-il m'aider?? Id really appreciate it!
Merci!
Carol
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Octobre 22nd, 2004, 8:07 am
- JLM
- Newbie


- Inscription: Oct 24, 2004
- Messages: 5
- Loc: Oxford
- Status: Offline
Eh bien, le code semble OK, il mai prendre un certain temps check it out alors voici quelque chose de semblable j'ai fait
http://www.justinfront.net/examples/piclken2.swf
http://www.justinfront.net/examples/piclken2.fla
JLM
Code: [ Select ]
MovieClip.prototype.scaleTo=function(m){
with(this){
_xscale=_yscale=100;
var p=new Object({H:_height/m._height,W:_width/m._width});
p=(p.H>p.W) ? p.H : p.W;
_yscale=_xscale=100/p;
_x=m._x-_width/2, _y=m._y-_height/2;
}};
Number.prototype.Rnd=function(){
var num=this
var newRnd=Math.round(Math.random()*(num-1)-(-1));
while((newRnd==this.Rnd.old)||(newRnd==this.Rnd.varyold)){
newRnd=Math.round(Math.random()*(num-1)-(-1));
}
trace( this.Rnd.veryold+ " "+this.Rnd.old+" "+newRnd);
this.Rnd.veryold=this.Rnd.old;
this.Rnd.old=newRnd;
return(newRnd);
};
//need some pictures Picture1.jpg, Picture2.jpg, Picture3.jpg
//and a movieClip that is _visible==false to scale to "myMask".
//and a movieClip to act as a button
_global.noPictures=3;
assessLoad = function(clip, loadFunc,myMask) {
if ((clip.getBytesLoaded()/clip.getBytesTotal() == 1)&&(clip._width>4)) {
clip[loadFunc](myMask);
clip._alpha=1;
clip.onEnterFrame=function(){
if(this._alpha<100){
this._alpha+=5;
} else {
this._alpha=100;
delete this.onEnterFrame;
}
}
clearInterval(loadInterval);
}
};
newPic_btn.onRelease=function(){newPic(this,"clip")};
function newPic(clip){
_root["clip"+this.status].swapDepths(50);
this.status=!this.status;
var genNum=noPictures.Rnd(noPictures);
var pic = "Picture"+genNum+".jpg";
trace(pic);
var clip=_root.createEmptyMovieClip("clip"+this.status*1,100);
clip._x=1000;
clip._y=1000;
clip.loadMovie(pic);
if(loadInterval!=undefined){
clearInterval(_root.loadInterval);
}
_root.loadInterval = setInterval(_root, "assessLoad", 40, clip, "scaleTo", _root.myMask);
};
size.onPress=function(){
this.startDrag();
this.onEnterFrame=function(){
rescale(this,_root.myMask);
}
}
size.onRelease=function(){
this.stopDrag();
rescale(this,_root.myMask);
this.onEnterFrame=null;
}
function rescale(mc,masc){
masc._width=2*Math.abs(mc._x-masc._x);
masc._height=2*Math.abs(mc._y-masc._y);
s=_root.newPic.status;
_root["clip"+s*1].scaleTo(masc);
_root["clip"+!s*1].scaleTo(masc);
}
rescale(size,_root.myMask);
newPic(newPic_btn,"clip");
with(this){
_xscale=_yscale=100;
var p=new Object({H:_height/m._height,W:_width/m._width});
p=(p.H>p.W) ? p.H : p.W;
_yscale=_xscale=100/p;
_x=m._x-_width/2, _y=m._y-_height/2;
}};
Number.prototype.Rnd=function(){
var num=this
var newRnd=Math.round(Math.random()*(num-1)-(-1));
while((newRnd==this.Rnd.old)||(newRnd==this.Rnd.varyold)){
newRnd=Math.round(Math.random()*(num-1)-(-1));
}
trace( this.Rnd.veryold+ " "+this.Rnd.old+" "+newRnd);
this.Rnd.veryold=this.Rnd.old;
this.Rnd.old=newRnd;
return(newRnd);
};
//need some pictures Picture1.jpg, Picture2.jpg, Picture3.jpg
//and a movieClip that is _visible==false to scale to "myMask".
//and a movieClip to act as a button
_global.noPictures=3;
assessLoad = function(clip, loadFunc,myMask) {
if ((clip.getBytesLoaded()/clip.getBytesTotal() == 1)&&(clip._width>4)) {
clip[loadFunc](myMask);
clip._alpha=1;
clip.onEnterFrame=function(){
if(this._alpha<100){
this._alpha+=5;
} else {
this._alpha=100;
delete this.onEnterFrame;
}
}
clearInterval(loadInterval);
}
};
newPic_btn.onRelease=function(){newPic(this,"clip")};
function newPic(clip){
_root["clip"+this.status].swapDepths(50);
this.status=!this.status;
var genNum=noPictures.Rnd(noPictures);
var pic = "Picture"+genNum+".jpg";
trace(pic);
var clip=_root.createEmptyMovieClip("clip"+this.status*1,100);
clip._x=1000;
clip._y=1000;
clip.loadMovie(pic);
if(loadInterval!=undefined){
clearInterval(_root.loadInterval);
}
_root.loadInterval = setInterval(_root, "assessLoad", 40, clip, "scaleTo", _root.myMask);
};
size.onPress=function(){
this.startDrag();
this.onEnterFrame=function(){
rescale(this,_root.myMask);
}
}
size.onRelease=function(){
this.stopDrag();
rescale(this,_root.myMask);
this.onEnterFrame=null;
}
function rescale(mc,masc){
masc._width=2*Math.abs(mc._x-masc._x);
masc._height=2*Math.abs(mc._y-masc._y);
s=_root.newPic.status;
_root["clip"+s*1].scaleTo(masc);
_root["clip"+!s*1].scaleTo(masc);
}
rescale(size,_root.myMask);
newPic(newPic_btn,"clip");
- MovieClip.prototype.scaleTo=function(m){
- with(this){
- _xscale=_yscale=100;
- var p=new Object({H:_height/m._height,W:_width/m._width});
- p=(p.H>p.W) ? p.H : p.W;
- _yscale=_xscale=100/p;
- _x=m._x-_width/2, _y=m._y-_height/2;
- }};
- Number.prototype.Rnd=function(){
- var num=this
- var newRnd=Math.round(Math.random()*(num-1)-(-1));
- while((newRnd==this.Rnd.old)||(newRnd==this.Rnd.varyold)){
- newRnd=Math.round(Math.random()*(num-1)-(-1));
- }
- trace( this.Rnd.veryold+ " "+this.Rnd.old+" "+newRnd);
- this.Rnd.veryold=this.Rnd.old;
- this.Rnd.old=newRnd;
- return(newRnd);
- };
- //need some pictures Picture1.jpg, Picture2.jpg, Picture3.jpg
- //and a movieClip that is _visible==false to scale to "myMask".
- //and a movieClip to act as a button
- _global.noPictures=3;
- assessLoad = function(clip, loadFunc,myMask) {
- if ((clip.getBytesLoaded()/clip.getBytesTotal() == 1)&&(clip._width>4)) {
- clip[loadFunc](myMask);
- clip._alpha=1;
- clip.onEnterFrame=function(){
- if(this._alpha<100){
- this._alpha+=5;
- } else {
- this._alpha=100;
- delete this.onEnterFrame;
- }
- }
- clearInterval(loadInterval);
- }
- };
- newPic_btn.onRelease=function(){newPic(this,"clip")};
- function newPic(clip){
- _root["clip"+this.status].swapDepths(50);
- this.status=!this.status;
- var genNum=noPictures.Rnd(noPictures);
- var pic = "Picture"+genNum+".jpg";
- trace(pic);
- var clip=_root.createEmptyMovieClip("clip"+this.status*1,100);
- clip._x=1000;
- clip._y=1000;
- clip.loadMovie(pic);
- if(loadInterval!=undefined){
- clearInterval(_root.loadInterval);
- }
- _root.loadInterval = setInterval(_root, "assessLoad", 40, clip, "scaleTo", _root.myMask);
- };
- size.onPress=function(){
- this.startDrag();
- this.onEnterFrame=function(){
- rescale(this,_root.myMask);
- }
- }
- size.onRelease=function(){
- this.stopDrag();
- rescale(this,_root.myMask);
- this.onEnterFrame=null;
- }
- function rescale(mc,masc){
- masc._width=2*Math.abs(mc._x-masc._x);
- masc._height=2*Math.abs(mc._y-masc._y);
- s=_root.newPic.status;
- _root["clip"+s*1].scaleTo(masc);
- _root["clip"+!s*1].scaleTo(masc);
- }
- rescale(size,_root.myMask);
- newPic(newPic_btn,"clip");
http://www.justinfront.net/examples/piclken2.swf
http://www.justinfront.net/examples/piclken2.fla
JLM
Page 1 sur 1
Pour répondre à ce sujet, vous devez vous connecter ou vous enregistrer. Il est gratuit.
Afficher de l'information
- Total des messages de ce sujet: 3 messages
- Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 94 invités
- Vous ne pouvez pas poster de nouveaux sujets
- Vous ne pouvez pas répondre aux sujets
- Vous ne pouvez pas éditer vos messages
- Vous ne pouvez pas supprimer vos messages
- Vous ne pouvez pas joindre des fichiers
