begin process at 2012 05 26 10:18:26
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive Flash

 > 

Archives

 > 

ActionScript

 > 

J'aimerai faire une fonction avec un argument ???


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

J'aimerai faire une fonction avec un argument ???

mardi 6 mai 2003 à 16:32:03 | J'aimerai faire une fonction avec un argument ???

Martino26

Bonjour je fait un site web avec des images et des zoom sur les images et je veut faire des fonction avec des argument pour qu il soit plus facile d ajouter des images plustard et optimiser mon code en meme temps

ex pour le zoom


//code actuel sans fonction pour 2 photos
on (press) {
if ((compteur == 1) && (img1._height < 339)) {
img1._height = img1._height * 1.5;
img1._width = img1._width * 1.5;
cadrephoto._height = img1._height + 40;
cadrephoto._width = img1._width + 40;
}
if ((compteur == 2) && (img2._height < 339)) {
img2._height = img2._height * 1.5;
img2._width = img2._width * 1.5;
cadrephoto._height = img2._height + 40;
cadrephoto._width = img2._width + 40;
}

}


Je voudrait avoir un style de fonction

//code voulu pour plusieur photo a la fois :P
function.zoom(valeur) {
if (img + valeur + ._height < 339) {
img + valeur + ._height = img + valeur + ._height * 1.5;
img + valeur + ._width = img + valeur + ._width * 1.5;
cadrephoto._height = img + valeur + ._height + 40;
cadrephoto._width = img + valeur + ._width + 40;
}

}

et apres faire mon action de bouton avec

on (press) {
valeur = compteur;
zoom(valeur);
}



SVP si quelqu un sait si c'est possible repondez moi :)
mardi 6 mai 2003 à 18:55:24 | Re : J'aimerai faire une fonction avec un argument ???

tombal

Bon vu que tu sais ce qu'il faut faire, je te donne la syntaxe

Pour une fonction :
function nom_de_fonction (parametre) {
//code
}

Pour l'histoire du img1, img2...
_root["img"+x]._height = valeur


exemple :
function zoom (x,aggrandissement) {
_root.["img"+x].height = _root.["img"+x].height*aggrandissement;
//Tu fais praeil avec le reste
}

//pour zoomer l'image 3 d'un facteur 2
zoom (3,2);

Tombal

-------------------------------
Réponse au message :
-------------------------------

> Bonjour je fait un site web avec des images et des zoom sur les images et je veut faire des fonction avec des argument pour qu il soit plus facile d ajouter des images plustard et optimiser mon code en meme temps
>
> ex pour le zoom
>
>
> //code actuel sans fonction pour 2 photos
> on (press) {
> if ((compteur == 1) && (img1._height < 339)) {
> img1._height = img1._height * 1.5;
> img1._width = img1._width * 1.5;
> cadrephoto._height = img1._height + 40;
> cadrephoto._width = img1._width + 40;
> }
> if ((compteur == 2) && (img2._height < 339)) {
> img2._height = img2._height * 1.5;
> img2._width = img2._width * 1.5;
> cadrephoto._height = img2._height + 40;
> cadrephoto._width = img2._width + 40;
> }
>
> }
>
>
> Je voudrait avoir un style de fonction
>
> //code voulu pour plusieur photo a la fois :P
> function.zoom(valeur) {
> if (img + valeur + ._height < 339) {
> img + valeur + ._height = img + valeur + ._height * 1.5;
> img + valeur + ._width = img + valeur + ._width * 1.5;
> cadrephoto._height = img + valeur + ._height + 40;
> cadrephoto._width = img + valeur + ._width + 40;
> }
>
> }
>
> et apres faire mon action de bouton avec
>
> on (press) {
> valeur = compteur;
> zoom(valeur);
> }
>
>
>
> SVP si quelqu un sait si c'est possible repondez moi :)
mardi 6 mai 2003 à 19:55:58 | Re : J'aimerai faire une fonction avec un argument ???

Martino26

Merci tu ma bien compris a ce que je voit j ai tester et je ny arrive pas. Avec l aide quej ai trouver dans le dictionnaire action script je voit bien que tu as raison Mais j ai tj des erreur quand je compile

j ai pourtant fait ma fonction comme tu me la montrer
c'est peut-etre que je ne sait pas ou mettre ma fonction
la c'est dans la meme séquence et dans la scene 1
la scene de mon fond de mon site

function zoom(x) {
_root.["img"+x].height = _root.["img"+x].height * 1.5;
_root.["img"+x].width = _root.["img"+x].width * 1.5;
cadrephoto._height = _root.["img"+x].height + 40;
cadrephoto._width = _root.["img"+x].width + 40;
}


jai ses 4 erreur la une pour chaque ligne
Séquence = site, Calque = FOND, Image = 1 : Ligne 44 : Un nom de champ est attendu après l'opérateur '.'.
_root.["img"+x].height = _root.["img"+x].height * 1.5;

(meme erreur pour les 4 lignes)


et la fonction elle est declancher par un bouton avec
on (press) {
zoom(compteur);
}

compteur etant le numero de l image


Je fait plein de test en attendant ta reponse :)

-------------------------------
Réponse au message :
-------------------------------

> Bon vu que tu sais ce qu'il faut faire, je te donne la syntaxe
>
> Pour une fonction :
> function nom_de_fonction (parametre) {
> //code
> }
>
> Pour l'histoire du img1, img2...
> _root["img"+x]._height = valeur
>
>
> exemple :
> function zoom (x,aggrandissement) {
> _root.["img"+x].height = _root.["img"+x].height*aggrandissement;
> //Tu fais praeil avec le reste
> }
>
> //pour zoomer l'image 3 d'un facteur 2
> zoom (3,2);
>
> Tombal
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > Bonjour je fait un site web avec des images et des zoom sur les images et je veut faire des fonction avec des argument pour qu il soit plus facile d ajouter des images plustard et optimiser mon code en meme temps
> >
> > ex pour le zoom
> >
> >
> > //code actuel sans fonction pour 2 photos
> > on (press) {
> > if ((compteur == 1) && (img1._height < 339)) {
> > img1._height = img1._height * 1.5;
> > img1._width = img1._width * 1.5;
> > cadrephoto._height = img1._height + 40;
> > cadrephoto._width = img1._width + 40;
> > }
> > if ((compteur == 2) && (img2._height < 339)) {
> > img2._height = img2._height * 1.5;
> > img2._width = img2._width * 1.5;
> > cadrephoto._height = img2._height + 40;
> > cadrephoto._width = img2._width + 40;
> > }
> >
> > }
> >
> >
> > Je voudrait avoir un style de fonction
> >
> > //code voulu pour plusieur photo a la fois :P
> > function.zoom(valeur) {
> > if (img + valeur + ._height < 339) {
> > img + valeur + ._height = img + valeur + ._height * 1.5;
> > img + valeur + ._width = img + valeur + ._width * 1.5;
> > cadrephoto._height = img + valeur + ._height + 40;
> > cadrephoto._width = img + valeur + ._width + 40;
> > }
> >
> > }
> >
> > et apres faire mon action de bouton avec
> >
> > on (press) {
> > valeur = compteur;
> > zoom(valeur);
> > }
> >
> >
> >
> > SVP si quelqu un sait si c'est possible repondez moi :)
>
mardi 6 mai 2003 à 20:58:17 | Re : J'aimerai faire une fonction avec un argument ???

tombal

LOL tu a oublié des _ dans _height
enfin c'est plutot moi qui les ais oublié ;)

function zoom(x) {
_root.["img"+x]._height = _root.["img"+x]._height * 1.5;
_root.["img"+x]._width = _root.["img"+x]._width * 1.5;
cadrephoto._height = _root.["img"+x]._height + 40;
cadrephoto._width = _root.["img"+x]._width + 40;
}

Tombal

-------------------------------
Réponse au message :
-------------------------------

> Merci tu ma bien compris a ce que je voit j ai tester et je ny arrive pas. Avec l aide quej ai trouver dans le dictionnaire action script je voit bien que tu as raison Mais j ai tj des erreur quand je compile
>
> j ai pourtant fait ma fonction comme tu me la montrer
> c'est peut-etre que je ne sait pas ou mettre ma fonction
> la c'est dans la meme séquence et dans la scene 1
> la scene de mon fond de mon site
>
> function zoom(x) {
> _root.["img"+x].height = _root.["img"+x].height * 1.5;
> _root.["img"+x].width = _root.["img"+x].width * 1.5;
> cadrephoto._height = _root.["img"+x].height + 40;
> cadrephoto._width = _root.["img"+x].width + 40;
> }
>
>
> jai ses 4 erreur la une pour chaque ligne
> Séquence = site, Calque = FOND, Image = 1 : Ligne 44 : Un nom de champ est attendu après l'opérateur '.'.
> _root.["img"+x].height = _root.["img"+x].height * 1.5;
>
> (meme erreur pour les 4 lignes)
>
>
> et la fonction elle est declancher par un bouton avec
> on (press) {
> zoom(compteur);
> }
>
> compteur etant le numero de l image
>
>
> Je fait plein de test en attendant ta reponse :)
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > Bon vu que tu sais ce qu'il faut faire, je te donne la syntaxe
> >
> > Pour une fonction :
> > function nom_de_fonction (parametre) {
> > //code
> > }
> >
> > Pour l'histoire du img1, img2...
> > _root["img"+x]._height = valeur
> >
> >
> > exemple :
> > function zoom (x,aggrandissement) {
> > _root.["img"+x].height = _root.["img"+x].height*aggrandissement;
> > //Tu fais praeil avec le reste
> > }
> >
> > //pour zoomer l'image 3 d'un facteur 2
> > zoom (3,2);
> >
> > Tombal
> >
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > Bonjour je fait un site web avec des images et des zoom sur les images et je veut faire des fonction avec des argument pour qu il soit plus facile d ajouter des images plustard et optimiser mon code en meme temps
> > >
> > > ex pour le zoom
> > >
> > >
> > > //code actuel sans fonction pour 2 photos
> > > on (press) {
> > > if ((compteur == 1) && (img1._height < 339)) {
> > > img1._height = img1._height * 1.5;
> > > img1._width = img1._width * 1.5;
> > > cadrephoto._height = img1._height + 40;
> > > cadrephoto._width = img1._width + 40;
> > > }
> > > if ((compteur == 2) && (img2._height < 339)) {
> > > img2._height = img2._height * 1.5;
> > > img2._width = img2._width * 1.5;
> > > cadrephoto._height = img2._height + 40;
> > > cadrephoto._width = img2._width + 40;
> > > }
> > >
> > > }
> > >
> > >
> > > Je voudrait avoir un style de fonction
> > >
> > > //code voulu pour plusieur photo a la fois :P
> > > function.zoom(valeur) {
> > > if (img + valeur + ._height < 339) {
> > > img + valeur + ._height = img + valeur + ._height * 1.5;
> > > img + valeur + ._width = img + valeur + ._width * 1.5;
> > > cadrephoto._height = img + valeur + ._height + 40;
> > > cadrephoto._width = img + valeur + ._width + 40;
> > > }
> > >
> > > }
> > >
> > > et apres faire mon action de bouton avec
> > >
> > > on (press) {
> > > valeur = compteur;
> > > zoom(valeur);
> > > }
> > >
> > >
> > >
> > > SVP si quelqu un sait si c'est possible repondez moi :)
> >
>
mardi 6 mai 2003 à 21:00:35 | Re : J'aimerai faire une fonction avec un argument ???

tombal

Autre chose que j'ai pas vu, tu a mis de spoint la ou j'en ai pas mis =)
entre le _root et les crochet, il ne faut pas de point

function zoom(x) {
_root["img"+x]._height = _root["img"+x]._height * 1.5;
_root["img"+x]._width = _root.["img"+x]._width * 1.5;
cadrephoto._height = _root["img"+x]._height + 40;
cadrephoto._width = _root["img"+x]._width + 40;
}

Tombal


-------------------------------
Réponse au message :
-------------------------------

> LOL tu a oublié des _ dans _height
> enfin c'est plutot moi qui les ais oublié ;)
>
> function zoom(x) {
> _root.["img"+x]._height = _root.["img"+x]._height * 1.5;
> _root.["img"+x]._width = _root.["img"+x]._width * 1.5;
> cadrephoto._height = _root.["img"+x]._height + 40;
> cadrephoto._width = _root.["img"+x]._width + 40;
> }
>
> Tombal
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > Merci tu ma bien compris a ce que je voit j ai tester et je ny arrive pas. Avec l aide quej ai trouver dans le dictionnaire action script je voit bien que tu as raison Mais j ai tj des erreur quand je compile
> >
> > j ai pourtant fait ma fonction comme tu me la montrer
> > c'est peut-etre que je ne sait pas ou mettre ma fonction
> > la c'est dans la meme séquence et dans la scene 1
> > la scene de mon fond de mon site
> >
> > function zoom(x) {
> > _root.["img"+x].height = _root.["img"+x].height * 1.5;
> > _root.["img"+x].width = _root.["img"+x].width * 1.5;
> > cadrephoto._height = _root.["img"+x].height + 40;
> > cadrephoto._width = _root.["img"+x].width + 40;
> > }
> >
> >
> > jai ses 4 erreur la une pour chaque ligne
> > Séquence = site, Calque = FOND, Image = 1 : Ligne 44 : Un nom de champ est attendu après l'opérateur '.'.
> > _root.["img"+x].height = _root.["img"+x].height * 1.5;
> >
> > (meme erreur pour les 4 lignes)
> >
> >
> > et la fonction elle est declancher par un bouton avec
> > on (press) {
> > zoom(compteur);
> > }
> >
> > compteur etant le numero de l image
> >
> >
> > Je fait plein de test en attendant ta reponse :)
> >
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > Bon vu que tu sais ce qu'il faut faire, je te donne la syntaxe
> > >
> > > Pour une fonction :
> > > function nom_de_fonction (parametre) {
> > > //code
> > > }
> > >
> > > Pour l'histoire du img1, img2...
> > > _root["img"+x]._height = valeur
> > >
> > >
> > > exemple :
> > > function zoom (x,aggrandissement) {
> > > _root.["img"+x].height = _root.["img"+x].height*aggrandissement;
> > > //Tu fais praeil avec le reste
> > > }
> > >
> > > //pour zoomer l'image 3 d'un facteur 2
> > > zoom (3,2);
> > >
> > > Tombal
> > >
> > > -------------------------------
> > > Réponse au message :
> > > -------------------------------
> > >
> > > > Bonjour je fait un site web avec des images et des zoom sur les images et je veut faire des fonction avec des argument pour qu il soit plus facile d ajouter des images plustard et optimiser mon code en meme temps
> > > >
> > > > ex pour le zoom
> > > >
> > > >
> > > > //code actuel sans fonction pour 2 photos
> > > > on (press) {
> > > > if ((compteur == 1) && (img1._height < 339)) {
> > > > img1._height = img1._height * 1.5;
> > > > img1._width = img1._width * 1.5;
> > > > cadrephoto._height = img1._height + 40;
> > > > cadrephoto._width = img1._width + 40;
> > > > }
> > > > if ((compteur == 2) && (img2._height < 339)) {
> > > > img2._height = img2._height * 1.5;
> > > > img2._width = img2._width * 1.5;
> > > > cadrephoto._height = img2._height + 40;
> > > > cadrephoto._width = img2._width + 40;
> > > > }
> > > >
> > > > }
> > > >
> > > >
> > > > Je voudrait avoir un style de fonction
> > > >
> > > > //code voulu pour plusieur photo a la fois :P
> > > > function.zoom(valeur) {
> > > > if (img + valeur + ._height < 339) {
> > > > img + valeur + ._height = img + valeur + ._height * 1.5;
> > > > img + valeur + ._width = img + valeur + ._width * 1.5;
> > > > cadrephoto._height = img + valeur + ._height + 40;
> > > > cadrephoto._width = img + valeur + ._width + 40;
> > > > }
> > > >
> > > > }
> > > >
> > > > et apres faire mon action de bouton avec
> > > >
> > > > on (press) {
> > > > valeur = compteur;
> > > > zoom(valeur);
> > > > }
> > > >
> > > >
> > > >
> > > > SVP si quelqu un sait si c'est possible repondez moi :)
> > >
> >
>
mardi 6 mai 2003 à 21:03:17 | Re : J'aimerai faire une fonction avec un argument ???

tombal

ROOOOOO
Je suis fatigué aujourd'hui, excuse moi.......
(c le stress des exam)
C moi qui ais mis des point partout et oublier des trucs

Bon voici le bon code
function zoom(x) {
_root["img"+x]._height = _root["img"+x]._height * 1.5;
_root["img"+x]._width = _root["img"+x]._width * 1.5;
cadrephoto._height = _root["img"+x]._height + 40;
cadrephoto._width = _root["img"+x]._width + 40;
}

Tombal


-------------------------------
Réponse au message :
-------------------------------

> Autre chose que j'ai pas vu, tu a mis de spoint la ou j'en ai pas mis =)
> entre le _root et les crochet, il ne faut pas de point
>
> function zoom(x) {
> _root["img"+x]._height = _root["img"+x]._height * 1.5;
> _root["img"+x]._width = _root.["img"+x]._width * 1.5;
> cadrephoto._height = _root["img"+x]._height + 40;
> cadrephoto._width = _root["img"+x]._width + 40;
> }
>
> Tombal
>
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > LOL tu a oublié des _ dans _height
> > enfin c'est plutot moi qui les ais oublié ;)
> >
> > function zoom(x) {
> > _root.["img"+x]._height = _root.["img"+x]._height * 1.5;
> > _root.["img"+x]._width = _root.["img"+x]._width * 1.5;
> > cadrephoto._height = _root.["img"+x]._height + 40;
> > cadrephoto._width = _root.["img"+x]._width + 40;
> > }
> >
> > Tombal
> >
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > Merci tu ma bien compris a ce que je voit j ai tester et je ny arrive pas. Avec l aide quej ai trouver dans le dictionnaire action script je voit bien que tu as raison Mais j ai tj des erreur quand je compile
> > >
> > > j ai pourtant fait ma fonction comme tu me la montrer
> > > c'est peut-etre que je ne sait pas ou mettre ma fonction
> > > la c'est dans la meme séquence et dans la scene 1
> > > la scene de mon fond de mon site
> > >
> > > function zoom(x) {
> > > _root.["img"+x].height = _root.["img"+x].height * 1.5;
> > > _root.["img"+x].width = _root.["img"+x].width * 1.5;
> > > cadrephoto._height = _root.["img"+x].height + 40;
> > > cadrephoto._width = _root.["img"+x].width + 40;
> > > }
> > >
> > >
> > > jai ses 4 erreur la une pour chaque ligne
> > > Séquence = site, Calque = FOND, Image = 1 : Ligne 44 : Un nom de champ est attendu après l'opérateur '.'.
> > > _root.["img"+x].height = _root.["img"+x].height * 1.5;
> > >
> > > (meme erreur pour les 4 lignes)
> > >
> > >
> > > et la fonction elle est declancher par un bouton avec
> > > on (press) {
> > > zoom(compteur);
> > > }
> > >
> > > compteur etant le numero de l image
> > >
> > >
> > > Je fait plein de test en attendant ta reponse :)
> > >
> > > -------------------------------
> > > Réponse au message :
> > > -------------------------------
> > >
> > > > Bon vu que tu sais ce qu'il faut faire, je te donne la syntaxe
> > > >
> > > > Pour une fonction :
> > > > function nom_de_fonction (parametre) {
> > > > //code
> > > > }
> > > >
> > > > Pour l'histoire du img1, img2...
> > > > _root["img"+x]._height = valeur
> > > >
> > > >
> > > > exemple :
> > > > function zoom (x,aggrandissement) {
> > > > _root.["img"+x].height = _root.["img"+x].height*aggrandissement;
> > > > //Tu fais praeil avec le reste
> > > > }
> > > >
> > > > //pour zoomer l'image 3 d'un facteur 2
> > > > zoom (3,2);
> > > >
> > > > Tombal
> > > >
> > > > -------------------------------
> > > > Réponse au message :
> > > > -------------------------------
> > > >
> > > > > Bonjour je fait un site web avec des images et des zoom sur les images et je veut faire des fonction avec des argument pour qu il soit plus facile d ajouter des images plustard et optimiser mon code en meme temps
> > > > >
> > > > > ex pour le zoom
> > > > >
> > > > >
> > > > > //code actuel sans fonction pour 2 photos
> > > > > on (press) {
> > > > > if ((compteur == 1) && (img1._height < 339)) {
> > > > > img1._height = img1._height * 1.5;
> > > > > img1._width = img1._width * 1.5;
> > > > > cadrephoto._height = img1._height + 40;
> > > > > cadrephoto._width = img1._width + 40;
> > > > > }
> > > > > if ((compteur == 2) && (img2._height < 339)) {
> > > > > img2._height = img2._height * 1.5;
> > > > > img2._width = img2._width * 1.5;
> > > > > cadrephoto._height = img2._height + 40;
> > > > > cadrephoto._width = img2._width + 40;
> > > > > }
> > > > >
> > > > > }
> > > > >
> > > > >
> > > > > Je voudrait avoir un style de fonction
> > > > >
> > > > > //code voulu pour plusieur photo a la fois :P
> > > > > function.zoom(valeur) {
> > > > > if (img + valeur + ._height < 339) {
> > > > > img + valeur + ._height = img + valeur + ._height * 1.5;
> > > > > img + valeur + ._width = img + valeur + ._width * 1.5;
> > > > > cadrephoto._height = img + valeur + ._height + 40;
> > > > > cadrephoto._width = img + valeur + ._width + 40;
> > > > > }
> > > > >
> > > > > }
> > > > >
> > > > > et apres faire mon action de bouton avec
> > > > >
> > > > > on (press) {
> > > > > valeur = compteur;
> > > > > zoom(valeur);
> > > > > }
> > > > >
> > > > >
> > > > >
> > > > > SVP si quelqu un sait si c'est possible repondez moi :)
> > > >
> > >
> >
>
mardi 6 mai 2003 à 21:04:17 | Re : J'aimerai faire une fonction avec un argument ???

Martino26

Au moment ou tu ma repondu je venait d allumer cette erreur
aussi lol
mais j ai toujour cette erreur c comme si il voit pas img + x
j ai donc essayer aussi avec _root.img[x]._height mais rien de plus j allume vraiment pas :P

Séquence = site, Calque = FOND, Image = 1 : Ligne 44 : Un nom de champ est attendu après l'opérateur '.'.
> _root.["img"+x].height = _root.["img"+x]._height * 1.5;


-------------------------------
Réponse au message :
-------------------------------

> LOL tu a oublié des _ dans _height
> enfin c'est plutot moi qui les ais oublié ;)
>
> function zoom(x) {
> _root.["img"+x]._height = _root.["img"+x]._height * 1.5;
> _root.["img"+x]._width = _root.["img"+x]._width * 1.5;
> cadrephoto._height = _root.["img"+x]._height + 40;
> cadrephoto._width = _root.["img"+x]._width + 40;
> }
>
> Tombal
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > Merci tu ma bien compris a ce que je voit j ai tester et je ny arrive pas. Avec l aide quej ai trouver dans le dictionnaire action script je voit bien que tu as raison Mais j ai tj des erreur quand je compile
> >
> > j ai pourtant fait ma fonction comme tu me la montrer
> > c'est peut-etre que je ne sait pas ou mettre ma fonction
> > la c'est dans la meme séquence et dans la scene 1
> > la scene de mon fond de mon site
> >
> > function zoom(x) {
> > _root.["img"+x].height = _root.["img"+x].height * 1.5;
> > _root.["img"+x].width = _root.["img"+x].width * 1.5;
> > cadrephoto._height = _root.["img"+x].height + 40;
> > cadrephoto._width = _root.["img"+x].width + 40;
> > }
> >
> >
> > jai ses 4 erreur la une pour chaque ligne
> > Séquence = site, Calque = FOND, Image = 1 : Ligne 44 : Un nom de champ est attendu après l'opérateur '.'.
> > _root.["img"+x].height = _root.["img"+x].height * 1.5;
> >
> > (meme erreur pour les 4 lignes)
> >
> >
> > et la fonction elle est declancher par un bouton avec
> > on (press) {
> > zoom(compteur);
> > }
> >
> > compteur etant le numero de l image
> >
> >
> > Je fait plein de test en attendant ta reponse :)
> >
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > Bon vu que tu sais ce qu'il faut faire, je te donne la syntaxe
> > >
> > > Pour une fonction :
> > > function nom_de_fonction (parametre) {
> > > //code
> > > }
> > >
> > > Pour l'histoire du img1, img2...
> > > _root["img"+x]._height = valeur
> > >
> > >
> > > exemple :
> > > function zoom (x,aggrandissement) {
> > > _root.["img"+x].height = _root.["img"+x].height*aggrandissement;
> > > //Tu fais praeil avec le reste
> > > }
> > >
> > > //pour zoomer l'image 3 d'un facteur 2
> > > zoom (3,2);
> > >
> > > Tombal
> > >
> > > -------------------------------
> > > Réponse au message :
> > > -------------------------------
> > >
> > > > Bonjour je fait un site web avec des images et des zoom sur les images et je veut faire des fonction avec des argument pour qu il soit plus facile d ajouter des images plustard et optimiser mon code en meme temps
> > > >
> > > > ex pour le zoom
> > > >
> > > >
> > > > //code actuel sans fonction pour 2 photos
> > > > on (press) {
> > > > if ((compteur == 1) && (img1._height < 339)) {
> > > > img1._height = img1._height * 1.5;
> > > > img1._width = img1._width * 1.5;
> > > > cadrephoto._height = img1._height + 40;
> > > > cadrephoto._width = img1._width + 40;
> > > > }
> > > > if ((compteur == 2) && (img2._height < 339)) {
> > > > img2._height = img2._height * 1.5;
> > > > img2._width = img2._width * 1.5;
> > > > cadrephoto._height = img2._height + 40;
> > > > cadrephoto._width = img2._width + 40;
> > > > }
> > > >
> > > > }
> > > >
> > > >
> > > > Je voudrait avoir un style de fonction
> > > >
> > > > //code voulu pour plusieur photo a la fois :P
> > > > function.zoom(valeur) {
> > > > if (img + valeur + ._height < 339) {
> > > > img + valeur + ._height = img + valeur + ._height * 1.5;
> > > > img + valeur + ._width = img + valeur + ._width * 1.5;
> > > > cadrephoto._height = img + valeur + ._height + 40;
> > > > cadrephoto._width = img + valeur + ._width + 40;
> > > > }
> > > >
> > > > }
> > > >
> > > > et apres faire mon action de bouton avec
> > > >
> > > > on (press) {
> > > > valeur = compteur;
> > > > zoom(valeur);
> > > > }
> > > >
> > > >
> > > >
> > > > SVP si quelqu un sait si c'est possible repondez moi :)
> > >
> >
>
mardi 6 mai 2003 à 21:20:39 | Re : J'aimerai faire une fonction avec un argument ???

Martino26

Parfait ca !!
merci bien mec je t en doit une :)
tanks pour ta patience
besoin de quoi que se soit je suis sur mirc undernet sur #irc-jeux pseudo Martino26 @+


-------------------------------
Réponse au message :
-------------------------------

> ROOOOOO
> Je suis fatigué aujourd'hui, excuse moi.......
> (c le stress des exam)
> C moi qui ais mis des point partout et oublier des trucs
>
> Bon voici le bon code
> function zoom(x) {
> _root["img"+x]._height = _root["img"+x]._height * 1.5;
> _root["img"+x]._width = _root["img"+x]._width * 1.5;
> cadrephoto._height = _root["img"+x]._height + 40;
> cadrephoto._width = _root["img"+x]._width + 40;
> }
>
> Tombal
>
>
> -------------------------------
> Réponse au message :
> -------------------------------
>
> > Autre chose que j'ai pas vu, tu a mis de spoint la ou j'en ai pas mis =)
> > entre le _root et les crochet, il ne faut pas de point
> >
> > function zoom(x) {
> > _root["img"+x]._height = _root["img"+x]._height * 1.5;
> > _root["img"+x]._width = _root.["img"+x]._width * 1.5;
> > cadrephoto._height = _root["img"+x]._height + 40;
> > cadrephoto._width = _root["img"+x]._width + 40;
> > }
> >
> > Tombal
> >
> >
> > -------------------------------
> > Réponse au message :
> > -------------------------------
> >
> > > LOL tu a oublié des _ dans _height
> > > enfin c'est plutot moi qui les ais oublié ;)
> > >
> > > function zoom(x) {
> > > _root.["img"+x]._height = _root.["img"+x]._height * 1.5;
> > > _root.["img"+x]._width = _root.["img"+x]._width * 1.5;
> > > cadrephoto._height = _root.["img"+x]._height + 40;
> > > cadrephoto._width = _root.["img"+x]._width + 40;
> > > }
> > >
> > > Tombal
> > >
> > > -------------------------------
> > > Réponse au message :
> > > -------------------------------
> > >
> > > > Merci tu ma bien compris a ce que je voit j ai tester et je ny arrive pas. Avec l aide quej ai trouver dans le dictionnaire action script je voit bien que tu as raison Mais j ai tj des erreur quand je compile
> > > >
> > > > j ai pourtant fait ma fonction comme tu me la montrer
> > > > c'est peut-etre que je ne sait pas ou mettre ma fonction
> > > > la c'est dans la meme séquence et dans la scene 1
> > > > la scene de mon fond de mon site
> > > >
> > > > function zoom(x) {
> > > > _root.["img"+x].height = _root.["img"+x].height * 1.5;
> > > > _root.["img"+x].width = _root.["img"+x].width * 1.5;
> > > > cadrephoto._height = _root.["img"+x].height + 40;
> > > > cadrephoto._width = _root.["img"+x].width + 40;
> > > > }
> > > >
> > > >
> > > > jai ses 4 erreur la une pour chaque ligne
> > > > Séquence = site, Calque = FOND, Image = 1 : Ligne 44 : Un nom de champ est attendu après l'opérateur '.'.
> > > > _root.["img"+x].height = _root.["img"+x].height * 1.5;
> > > >
> > > > (meme erreur pour les 4 lignes)
> > > >
> > > >
> > > > et la fonction elle est declancher par un bouton avec
> > > > on (press) {
> > > > zoom(compteur);
> > > > }
> > > >
> > > > compteur etant le numero de l image
> > > >
> > > >
> > > > Je fait plein de test en attendant ta reponse :)
> > > >
> > > > -------------------------------
> > > > Réponse au message :
> > > > -------------------------------
> > > >
> > > > > Bon vu que tu sais ce qu'il faut faire, je te donne la syntaxe
> > > > >
> > > > > Pour une fonction :
> > > > > function nom_de_fonction (parametre) {
> > > > > //code
> > > > > }
> > > > >
> > > > > Pour l'histoire du img1, img2...
> > > > > _root["img"+x]._height = valeur
> > > > >
> > > > >
> > > > > exemple :
> > > > > function zoom (x,aggrandissement) {
> > > > > _root.["img"+x].height = _root.["img"+x].height*aggrandissement;
> > > > > //Tu fais praeil avec le reste
> > > > > }
> > > > >
> > > > > //pour zoomer l'image 3 d'un facteur 2
> > > > > zoom (3,2);
> > > > >
> > > > > Tombal
> > > > >
> > > > > -------------------------------
> > > > > Réponse au message :
> > > > > -------------------------------
> > > > >
> > > > > > Bonjour je fait un site web avec des images et des zoom sur les images et je veut faire des fonction avec des argument pour qu il soit plus facile d ajouter des images plustard et optimiser mon code en meme temps
> > > > > >
> > > > > > ex pour le zoom
> > > > > >
> > > > > >
> > > > > > //code actuel sans fonction pour 2 photos
> > > > > > on (press) {
> > > > > > if ((compteur == 1) && (img1._height < 339)) {
> > > > > > img1._height = img1._height * 1.5;
> > > > > > img1._width = img1._width * 1.5;
> > > > > > cadrephoto._height = img1._height + 40;
> > > > > > cadrephoto._width = img1._width + 40;
> > > > > > }
> > > > > > if ((compteur == 2) && (img2._height < 339)) {
> > > > > > img2._height = img2._height * 1.5;
> > > > > > img2._width = img2._width * 1.5;
> > > > > > cadrephoto._height = img2._height + 40;
> > > > > > cadrephoto._width = img2._width + 40;
> > > > > > }
> > > > > >
> > > > > > }
> > > > > >
> > > > > >
> > > > > > Je voudrait avoir un style de fonction
> > > > > >
> > > > > > //code voulu pour plusieur photo a la fois :P
> > > > > > function.zoom(valeur) {
> > > > > > if (img + valeur + ._height < 339) {
> > > > > > img + valeur + ._height = img + valeur + ._height * 1.5;
> > > > > > img + valeur + ._width = img + valeur + ._width * 1.5;
> > > > > > cadrephoto._height = img + valeur + ._height + 40;
> > > > > > cadrephoto._width = img + valeur + ._width + 40;
> > > > > > }
> > > > > >
> > > > > > }
> > > > > >
> > > > > > et apres faire mon action de bouton avec
> > > > > >
> > > > > > on (press) {
> > > > > > valeur = compteur;
> > > > > > zoom(valeur);
> > > > > > }
> > > > > >
> > > > > >
> > > > > >
> > > > > > SVP si quelqu un sait si c'est possible repondez moi :)
> > > > >
> > > >
> > >
> >
>


Cette discussion est classée dans : valeur, width, height, img1, img2


Répondre à ce message

Sujets en rapport avec ce message

creer une image à partir d'une autre [ par abdelkaoui ] Bonjour à tous.dans mon projet je doit selectionner une partie d'une image(la selection se fait par un cadre dont le fond est transparent). c'est à di comment centrer une popup à l'écran? [ par Oncle Simous ] Voilà mon code pour ouvrir une simple popup directement à l'ouverture du SWF... La popup s'ouvre de la bonne taille mais n'est pas centrée à l'écan :( galere pop-ups [ par ] Salut a tous ! A l'aide je galere severe avec les pop-ups.Voila sur ma page j'ai 4 images de petite taille que je voudrais ouvrir sur un click chacune galere pop-ups [ par ] Salut a tous ! A l'aide je galere severe avec les pop-ups.Voila sur ma page j'ai 4 images de petite taille que je voudrais ouvrir sur un click chacune images et taille [ par nicoxidine ] bonjour,je charge une image externe et je souhaitrais modifier sa taille, malheuresement ça ne fonctionne pas et je ne sais pas comment faire. j'ai re Problème taille swf height et width [ par actaruss ] Salut les amis, je voudrais charger plusieurs swf dans une anim flash, avec un affichage miniature et plein zoomé.Exemple : J'ai un clip nommé "charge Popup en java mais forcage en premier plan et ré-actualiser à chaque popup (pas cacher en arrière plan) [ par webed ] Bonjour, J'ai un FLA avec un lien qui ouvre une popup : on (release) { getURL("javascript:openWindownews(610,450)"); } Dans la page HTML ou se trou gallerie xml/image cliquable [ par jahrom1 ] bonjour j'ai toujours un souci avec ma gallerie xml de reussir a rendre chaque image cliquable et de m'afficher la fiche technique correpondante a l'i Probleme pour ouvrir 2 SWF en popup [ par croftman ] Bonjour,J'ai une intro sur un site qui une fois finis doit ouvrir 2 swf, j'ai mis ca dans le code du bouton:on (press) { getURL("javascript:open('site Murs [ par Leo17 ] Bonjour,Je voudrais faire rebondir une balle sur un mur. J'ai trouvé un tutorial pour ça, j'ai réussi à faire avancer ma balle, mais le code pour la f


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,217 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales