Pagina 1 di 4 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 39
  1. #1
    Utente bannato
    Registrato dal
    Nov 2006
    Messaggi
    533

    aiuto su script photogallery

    ho scaricato un bellissimo script per photogallery in scroll da xml con java popup

    l'ho inserito in un mc tramite
    loadMovie("gallery/gallery.swf", "gallery");

    sul fla ho cambiato tutti i percorsi dal _root a _root.gallery... e cosi funziona tutto tranne l'apertura del popup
    non capisco perchè

    questo è il codice in AS di un frame

    function getLabel(_arg1) {
    return (baseNode.childNodes[_arg1].childNodes[0].firstChild.nodeValue);
    }
    function getLink(_arg1) {
    return (baseNode.childNodes[_arg1].childNodes[1].firstChild.nodeValue);
    }
    function getWidth(_arg1) {
    return (baseNode.childNodes[_arg1].childNodes[2].firstChild.nodeValue);
    }
    function getHeight(_arg1) {
    return (baseNode.childNodes[_arg1].childNodes[3].firstChild.nodeValue);
    }
    function getPic(_arg1) {
    return (baseNode.childNodes[_arg1].childNodes[4].firstChild.nodeValue);
    }
    function alphaIn(_arg1) {
    if (_arg1.txt.txt._currentframe<9) {
    _arg1.txt.txt.play();
    }
    }
    function alphaOut(_arg1) {
    _arg1.txt.txt.gotoAndStop(1);
    }
    function launchProject(_arg1) {
    myURL = new String(("'gallery/popup"+_arg1.launchURL)+"'");
    myHeight = new String(("'height="+_arg1.launchHeight)+",");
    myWidth = new String(("width="+_arg1.launchWidth)+",");
    getURL((((("javascriptpenNewWindow("+myURL)+",'HMX',")+myHeight)+myWidth )+"toolbar=no,scrollbars=no')");
    }
    baseNode = featXML.firstChild;
    var child = baseNode.firstChild;
    while (child != null) {
    numItems++;
    child = child.nextSibling;
    }
    _root.gallery.createEmptyMovieClip("featuredProjec ts", 1);
    featuredProjects._y = 6;
    featuredProjects._visible = false;
    i = 0;
    while (i<numItems) {
    featuredProjects.attachMovie("thumb", "thumb"+i, i);
    myN = eval("featuredProjects.thumb"+i);
    myN.hitArea = myN.hA;
    myN.createEmptyMovieClip("pic", 1);
    myN.createEmptyMovieClip("txt", 2);
    myN.txt._y = -5;
    myN.hA._visible = false;
    myN.attachMovie("thumbLabel", "thumbLabel", 2);
    myN.thumbLabel.txt = getLabel(i);
    myN.thumbLabel._y = -33;
    myN.thumbLabel._alpha = 0;
    myPic = getPic(i);
    myLabel = getLabel(i);
    myN.pic.loadMovie("gallery/images/"+myPic, 1);
    myN.txt.attachMovie("txt", "txt", 2);
    myN.txt.txt.txt = myLabel;
    myN.launchURL = getLink(i);
    myN.launchWidth = getWidth(i);
    myN.launchHeight = getHeight(i);
    myN.onPress = function() {
    };
    i++;
    }
    il codice nel file html per il java script è questo

    <script language="JavaScript">
    <!-- //
    var popNameWindow = null; // This must be declared as a global
    function MakePop(width,height) {
    closePop();
    var features = 'width=' + width + ',height=' + height;

    popNameWindow = window.open('','HMX',features);
    popNameWindow.focus();
    }

    function openNewWindow(URLtoOpen, windowName, windowFeatures)
    {
    closePop();
    popNameWindow=window.open(URLtoOpen, windowName, windowFeatures);

    popNameWindow.focus();
    }
    function closePop() {
    if ( ( popNameWindow != null ) && ( !popNameWindow.closed )) {
    // window is still open -> close it
    popNameWindow.close();
    popNameWindow = null;
    }
    }

    // -->
    </script>
    qualcuno crede di sapere quale potrebbe essere il problema?

  2. #2
    Utente bannato
    Registrato dal
    Nov 2006
    Messaggi
    533
    dimenticavo il codice del bott che riachiama la funzione

    onClipEvent (load) {
    within = new Boolean(0);
    }
    onClipEvent (mouseMove) {
    if (this.hitTest(_root.gallery._xmouse, _root.gallery._ymouse, true) == true) {
    _root.gallery.alphaIn(_parent);
    within = true;
    } else if (within == true) {
    _root.gallery.alphaOut(_parent);
    within = false;
    }
    }
    onClipEvent (mouseDown) {
    if (this.hitTest(_root.gallery._xmouse, _root.gallery._ymouse, true) == true) {
    _root.gallery.launchProject(_parent);
    }
    }

  3. #3
    beh usa qualche trace x vedere se entri in quella funzione ...launchProject

    e se le var le leggi tutte correttamente.....

    oppure fa una prova......se invece di cambiare i percorsi provi a mettere nel primo frame della galleria
    this._lockroot=true;

    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

  4. #4
    Utente bannato
    Registrato dal
    Nov 2006
    Messaggi
    533
    Originariamente inviato da crescenzo
    beh usa qualche trace x vedere se entri in quella funzione ...launchProject

    e se le var le leggi tutte correttamente.....

    oppure fa una prova......se invece di cambiare i percorsi provi a mettere nel primo frame della galleria
    this._lockroot=true;

    ho scritto this._lockroot=true; nel primo frame della gallery.fla quello con i persorsi originali _root ma niente neanche apre la galleria

    la la prima opzione usando i trace scusa l'ignoranza ma nn so come fare

  5. #5
    Utente bannato
    Registrato dal
    Nov 2006
    Messaggi
    533
    ho letto come usare il trace
    nell'output esce
    [type Function]

  6. #6
    Utente bannato
    Registrato dal
    Nov 2006
    Messaggi
    533
    credo che voglia dire che nn passa
    è strano perchè il resto passa
    proprio nn vede lo script java openNewwindow

    stranissimo
    eppure nel bottone ho aggiunto l'istanza gallery
    onClipEvent (mouseDown) {
    if (this.hitTest(_root.gallery._xmouse, _root.gallery._ymouse, true) == true) {
    _root.gallery .launchProject(_parent);
    }
    }

  7. #7
    Utente bannato
    Registrato dal
    Nov 2006
    Messaggi
    533
    può essere d'aiuto se dico che il clicp simbolo6 dove risiedere il codice:

    onClipEvent (load) {
    within = new Boolean(0);
    }
    onClipEvent (mouseMove) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true) == true) {
    _root.alphaIn(_parent);
    within = true;
    } else if (within == true) {
    _root.alphaOut(_parent);
    within = false;
    }
    }
    onClipEvent (mouseDown) {
    if (this.hitTest(_root.gallery._xmouse, _root.gallery._ymouse, true) == true) {
    _root.gallery.launchProject(_parent);
    }
    }
    non è sul filmato ma solo sulla libreria ed è concatenato con il nome txt

    potrebbe essere per questo con il concatenamento dice esportalo nel primo fotogramma e se flash intende della root e dell'swf principale e non della gallery.swf

    e capendo questo ho provato a fare il trace così
    trace(_root.launchProject);
    ed esce nell'output il messaggio "undefined"

    è un miglioramento per capire?

  8. #8
    Utente bannato
    Registrato dal
    Nov 2006
    Messaggi
    533
    ho cercato a destra e a manca ma nn ho capito [type Function] e undefined con il trace

  9. #9
    Utente bannato
    Registrato dal
    Nov 2006
    Messaggi
    533
    c'è nessuno?

    e se fosse il _parent il problema?

    _root.gallery.launchProject(_parent)

  10. #10
    ehm scusami ma il lavoro incombe...cmq se puoi metti i files della gallery funzionante da quqlache parte che appena ho un attimo lo scarico e faccio qualche prova....ovviamente devi avere un pò di pazienza dato che ho tante cose da fare.......

    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

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.