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

ActionScript 1 & ActionScript 2 Discussion :

Galerie Flash resize ss XML - boutons prev/next


Sujet :

ActionScript 1 & ActionScript 2

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 4
    Points : 2
    Points
    2
    Par défaut Galerie Flash resize ss XML - boutons prev/next
    Bonjour, je ne suis pas trop souvant sur les forums et vous devez etre patientes avec mon français et avec ma connaissance car suis autodidacte dans tout...
    J'ai trouvé une galerie qui retaille les images automatiquement. C'est parfait pour moi car ça n'utilise pas XML qui (a mon avis) relenti le chargement des images.
    Je voudrais développer cette galerie avec des boutons "next" (image prochaine) et "previous" (image précedente) pour faciliter le visit des images sans cliquer sur chaque thumbnail. J'ai trouvé un script dans une galerie tres similaire (en faite toute a fait pareil) mais qui utilise xml. Alors, bien évidemment ça marche pas car je ne suis pas suffisemment fort de changer le script. Regardez svp la totalité d'actionscript ci-dessous, j'ai marqué le point en question avec rouge. Si vous connaisez comment le changer, dites moi SVP SVP, HELP ! Merci

    LE SCRIPT :
    ----------------
    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
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    stop();
    space = 25;
    photo_mc._alpha = 100;
    var photo = new Array();
     
    MovieClip.prototype.loadPhoto = function(photo){
    photo_mc._alpha = 0;
    this.loadMovie(photo);
    _level0.onEnterFrame = function(){
    // modified the total and loaded so as to round it up to smaller number.
    var total = Math.round photo_mc.getBytesTotal)/ 1024);
    var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
    if (total != 0 && loaded>=total){
    var w = photo_mc._width + space;
    var h = photo_mc._height + space;
    border.resize(w, h);
    delete this.onEnterFrame;
    picinfo.info.text = photo;
    delete this.onEnterFrame;
    }
    }
    };
    MovieClip.prototype.resize = function(w, h){
    //the higher the slower the resize of the border
    var speed = 4;
    this.onEnterFrame = function(){
    this._width += (w - this._width)/speed;
    this._height += (h - this._height)/speed;
    nav._x = Math.round(this._x-this._width/2);
    nav._y = Math.round(this._y+this._height/2+spacing/2);
    prevb._x = nav._x-5;
    nextb._x = nav._x+this._width+5;
    nextb._y = prevb._y=this._y-this._height/2;
    picinfo._y = nextb._y-5;
    picinfo._x = border._x-picinfo._width/2;
    if( Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){
    this._width = w;
    this._height = h;
    photo_mc._x = this._x - this._width/2 + space/2;
    photo_mc._y = this._y - this._height/2 + space/2;
    photo_mc._alpha = 100;
    delete this.onEnterFrame;
    }
    }
    };
    gallery_xml.load("gallery.xml");
    prevb.onRelease = function() {
    cur--;
    if (cur<0) {
    containerMC.loadPic(pArray.length-1);
    } else {
    containerMC.loadPic(cur);
    }
    };
    nextb.onRelease = function() {
    cur++;
    if (cur > pArray.length-1) {
    containerMC.loadPic(0);
    } else {
    containerMC.loadPic(cur);
    }
    };
     
    pic1.onPress = function() {
    photo_mc.loadPhoto("p1.swf");
    };
    pic2.onPress = function() {
    photo_mc.loadPhoto("p2.swf");
    };
    pic3.onPress = function() {
    photo_mc.loadPhoto("p3.swf");
    };
    pic4.onPress = function() {
    photo_mc.loadPhoto("p4.swf");
    };
    pic5.onPress = function() {
    photo_mc.loadPhoto("p5.swf");
    };
    pic6.onPress = function() {
    photo_mc.loadPhoto("p6.swf");
    };
    pic7.onPress = function() {
    photo_mc.loadPhoto("p7.swf");
    };
    pic8.onPress = function() {
    photo_mc.loadPhoto("p8.swf");
    };
    pic9.onPress = function() {
    photo_mc.loadPhoto("p9.swf");
    };
    ///////////////Modified by Sokhodom Pheng //////////////////define the initiation function
    function init(photo) {
    photo_mc.loadPhoto(photo);
    }
    // call the initiation function
    //change the image name accordingly
    init("p1.swf");

  2. #2
    Candidat au Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 4
    Points : 2
    Points
    2
    Par défaut
    Please please help me !

    Je suis sure que la solution n'est pas compliquée...

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Février 2007
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 4
    Points : 2
    Points
    2

Discussions similaires

  1. [Galerie] Flash et xml
    Par webide dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 1
    Dernier message: 02/03/2009, 14h55
  2. Réponses: 8
    Dernier message: 10/07/2005, 00h10
  3. [FLASH MX]Problème de bouton et de _level
    Par Geilgestorm dans le forum Flash
    Réponses: 9
    Dernier message: 01/07/2004, 17h37
  4. [Débutant][FLASH MX 2004]les boutons ?
    Par Battosaiii dans le forum Flash
    Réponses: 3
    Dernier message: 04/05/2004, 17h43
  5. [FLASH MX 2004][XML]portée de variable
    Par marco_ dans le forum Flash
    Réponses: 8
    Dernier message: 29/04/2004, 16h47

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