Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289

    centrare scroll foto e relativa maskera

    ciao ciao...ho preso un tutorial di uno scroll di foto dove ho 2cartelle una con le img grandi e una con le img piccole un file txt ed un file php con filmato da 550larghezza x 330altezza
    il fla ha sullo stage un livello perle 2frecce da lo scroll..

    2fotogramma:

    function creaActionPulsanti() {
    for (i=0; i<num; i++) {
    _root.lefoto["foto"+i].useHandCursor = false;
    _root.lefoto["foto"+i].onRelease = function() {
    a = this._name;
    premuto('./foto.php?foto='+a,a,'');
    };
    _root.lefoto["foto"+i].onRollOver = function() {
    sopra(this._name);
    };
    _root.lefoto["foto"+i].onRollOut = _root.lefoto["foto"+i].onReleaseOutside = function() {
    ripristina(this._name);
    };
    }
    }


    3:fotogramma

    p_sx.useHandCursor = false;
    p_dx.useHandCursor = false;

    p_sx.onPress = function(){
    this.avanti = true;
    }
    p_sx.onRelease = p_sx.onReleaseOutside = function(){
    this.avanti = false;
    }
    p_dx.onPress = function(){
    this.avanti = true;
    }
    p_dx.onRelease = p_dx.onReleaseOutside = function(){
    this.avanti = false;
    }
    p_sx.onEnterFrame = function(){
    if(this.avanti){
    if(_root.lefoto._x < _root.maschera._x){
    _root.lefoto._x+=10;
    }
    }
    }
    p_dx.onEnterFrame = function(){
    if(this.avanti){
    if(_root.lefoto._x > (_root.maschera._x-(_root.lefoto._width - _root.maschera._width))){
    _root.lefoto._x -=10;
    }
    }
    }

    un livello con clip vuoto in cui vengono caricate le foto e la maschera...

    ed un livello con le azioni:

    1fotogramma:

    stop();
    lostage = stage.width;
    dati = new LoadVars();
    dati.load("./num_foto.txt");
    dati.onLoad = function(success) {
    if (success) {
    num = Number(dati.numero);
    alt_p = Number(dati.altez_p);
    larg_p = Number(dati.larg_p);
    alt = Number(dati.altez);
    larg = Number(dati.larg);
    nextFrame();
    }
    };

    MovieClip.prototype.sopra = function(nome) {
    _root.lefoto[nome]._alpha = 99;
    };
    MovieClip.prototype.ripristina = function(nome) {
    _root.lefoto[nome]._alpha = 50;
    };
    Movieclip.prototype.premuto = function(nome, titolo, feat) {
    var w = System.capabilities.screenResolutionX/2;
    var h = System.capabilities.screenResolutionY/2;
    var x = Math.round(w-(larg/2));
    var y = Math.round(h-(alt/2));
    getURL("javascript:window.open('"+nome+"','"+titol o+"','width="+larg+",height="+alt+",screenX="+x+", left="+x+",screenY="+y+",top="+y+","+feat+"');void (0);");
    };

    2fotogramma:

    posx = 0;
    for(i=0;i<num;i++){
    _root.lefoto.createEmptyMovieClip("foto"+i,10+i);
    _root.lefoto["foto"+i]._y = 40;
    _root.lefoto["foto"+i]._x = posx;
    posx = posx + larg_p + 10;
    }
    _root.lefoto._visible = 0;
    _root.createTextField("loading",1,200,150,250,18);

    function caricafoto(){
    car = _root.lefoto["foto"+i].getBytesLoaded();
    tot = _root.lefoto["foto"+i].getBytesTotal();
    perc = Math.round((car*100)/tot);
    j=i+1;
    _root.loading.text = "Loading foto " + j + "...... " + perc + "%";
    if(car>1024){
    if(car == tot){
    _root.lefoto["foto"+i]._alpha = 50;
    if(i<num-1){
    i++;
    _root.lefoto["foto"+i].loadMovie("./img_p/foto_"+i+".jpg");
    } else {
    clearInterval(a);
    _root.loading.removeTextField();
    _root.lefoto._visible = 1;
    creaActionPulsanti();
    nextFrame();
    }
    }
    }
    }
    i=0;
    _root.lefoto["foto"+i].loadMovie("img_p/foto_"+i+".jpg");
    a = setInterval(caricafoto, 100);

    3fotogramma:

    _root.createEmptyMovieClip("maschera",1);
    with(maschera){
    larghezza = _root.lostage - 70;
    altezza = alt_p + 20;
    _x = posx = _root.lefoto._x - 20;
    _y = posy = _root.lefoto._y - 10;

    beginFill(0xffffff,100);
    lineStyle(0,0x000000,100);
    moveTo(posx,posy);
    lineTo(posx+larghezza,posy);
    lineTo(posx+larghezza,posy+altezza);
    lineTo(posx,posy+altezza);
    lineTo(posx,posy);
    endFill();
    }
    _root.lefoto.setMask("maschera");

    il mio problema e che trasferisco il tutto su di un filmato 610larghezza x 80altezz
    disciple of dice.....

  2. #2
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289
    nessuno saèrebbe dirmi qualcosa???
    aitatemi..per favore...graxie a tutti comunque..ciao...
    disciple of dice.....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.