IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Flash Discussion :

[FLASH 8] Galerie photo : probleme avec l'actionscript


Sujet :

Flash

  1. #1
    Nouveau Candidat au Club
    Inscrit en
    Mars 2007
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 2
    Points : 1
    Points
    1
    Par défaut [FLASH 8] Galerie photo : probleme avec l'actionscript
    Bonjour a tous,

    Je me permets de vous contacter car je suis actuellement en train de travailler sur une galerie photo pour le site de mon asso mais je rencontre un probleme au niveau de l'actionscript... :

    Voilà, j'ai recupéré sur Flashkit cette galerie (que j'ai deja un peu modifié...).
    Pour ce que je veux faire cette galerie est parfaite... sauf que j'aimerai rajouter la possiblité que quand une des photos est affichée en grand, on puisse cliquer dessus pour la fermer (ou plutot devrais je dire, qu'elle retourne à sa position d'origine).

    Etant graphiste à la base, le code est loin d'être mon fort ; et tous les essais que j'ai fait ont lamentablement echoué
    Bref je rame !

    Si quelqu'un pouvait m'aider ou m'orienter vers une autre source ça serait vraiment sympath
    Je vous laisse le fichier source ainsi que le code qui me pose probleme (toutes les actions étant regroupées sur un seul et même bouton) :

    Code sur la 1ere image de la timeline :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    // this is a bounce factor, from 0 to a number < 1
    // I suggest values from 0.4 to 0.6
    bounce = 0.6;
    // animation speed, from 0.001 (soooooo slow) to a number < 1
    // affects bouncing. I suggst 0.5
    speed = 0.5;
    // offset, represent the frame of "Picture layered" object
    // that you want as 1st photo (the one in the top-left corner)
    frame_offset = 1;
    // thumbnails size
    thumb_x = 50;
    thumb_y = 50;
    // big potos size
    big_x = 300;
    big_y = 300;
    // offset where to move big photos starting from thumbnails
    // Play with it until you find the position you want
    offset_x = 150;
    offset_y = 150;
    // minimum alpha; this is the alpha when the image are thumbnails.
    // from 0 (invisible thumbnains) to 100 (100% solid thumbnails)
    alphamin = 100;
    stop()
    Code sur le bouton :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
     
    onClipEvent (load) {
    	this.pics.gotoAndStop(_root.frame_offset++);
    	bounce = _root.bounce;
    	speed = _root.speed;
    	final_width = _root.thumb_x;
    	final_height = _root.thumb_y;
    	final_x = this._x;
    	final_y = this._y;
    	startx = this._x;
    	starty = this._y;
    }
    onClipEvent (enterFrame) {
    	width = width*bounce+(final_width-this._width)*speed;
    	this._width += width;
    	if (Math.abs(final_width-this._width)<1) {
    		this._width = final_width;
    	}
    	height = height*bounce+(final_height-this._height)*speed;
    	this._height += height;
    	if (Math.abs(final_height-this._height)<1) {
    		this._height = final_height;
    	}
    	x = x*bounce+(final_x-this._x)*speed;
    	this._x += x;
    	if (Math.abs(final_x-this._x)<1) {
    		this._x = final_x;
    	}
    	y = y*bounce+(final_y-this._y)*speed;
    	this._y += y;
    	if (Math.abs(final_y-this._y)<1) {
    		this._y = final_y;
    	}
    	this._alpha = _root.alphamin+(100-_root.alphamin)*(this._x-_root.thumb_x)/(_root.big_x-_root.thumb_x);
     
     
    }
    onClipEvent (mouseDown) {
    	if (this.hitTest(_root._xmouse, _root._ymouse)) {
    		_parent._parent.swapDepths(10000);
    		_parent.swapDepths(10001);
    		this.swapDepths(10002);
    		_parent._parent[_root.url].image.final_width = _root.thumb_x;
    		_parent._parent[_root.url].image.final_height = _root.thumb_y;
    		_parent._parent[_root.url].image.final_x = _parent._parent[_root.url].image.startx;
    		_parent._parent[_root.url].image.final_y = _parent._parent[_root.url].image.starty;
    		_root.url = _parent._name;
    		final_width = _root.big_x;
    		final_height = _root.big_y;
    		final_x = _root.offset_x-_parent._x;
    		final_y = _root.offset_y-_parent._y;
    	}
    }
    D'avance je vous remercie

  2. #2
    Nouveau Candidat au Club
    Inscrit en
    Mars 2007
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 2
    Points : 1
    Points
    1
    Par défaut
    ...euh... personne pour un 'tit coup de main ?
    svpéééééééééé

Discussions similaires

  1. [JQuery] Galerie photo dynamique avec spry
    Par Invité dans le forum jQuery
    Réponses: 4
    Dernier message: 28/08/2008, 16h53
  2. [Galerie] Installation du script Pics engine
    Par proc187 dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 1
    Dernier message: 04/11/2006, 13h12
  3. [FLASH MX] Probleme avec XML
    Par celina5880 dans le forum Flash
    Réponses: 4
    Dernier message: 16/12/2004, 20h30
  4. Réponses: 13
    Dernier message: 18/11/2004, 10h58
  5. [flash MX] probleme avec setinterval et clearinterval
    Par yacinechaouche dans le forum Flash
    Réponses: 3
    Dernier message: 15/04/2004, 13h07

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo