Ergebnis 1 bis 8 von 8

Thema: AC2 remove movieclip

  1. #1
    TP-Newbie
    Registriert seit
    Sep 2009
    Beiträge
    4

    AC2 remove movieclip

    hallo da draussen,

    ich bin recht neu bei flash und hoffe mir kann jemand helfen das script zu vervollständigen.
    es gibt horizontal laufende thumbnails. nach auswahl eines thumbs wird die gallery mit einem full_image überlagert. jetzt müsste man im nächsten schritt das full_image wieder schliessen um an die thumbnails zu kommen, aber das gelingt mir nicht.
    ich lade die bilder durch eine xlm datei ins script. alles läuft gut soweit, nur das schliessen des full_image nicht.

    danke im vorraus...

    Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    var myGalleryXML = new XML();
    myGalleryXML.ignoreWhite = true;
    myGalleryXML.load("gallery.xml");
    myGalleryXML.onLoad = function() {
    _root.gallery_x = myGalleryXML.firstChild.attributes.gallery_x;
    _root.gallery_y = myGalleryXML.firstChild.attributes.gallery_y;
    _root.gallery_width = myGalleryXML.firstChild.attributes.gallery_width;
    _root.gallery_height = myGalleryXML.firstChild.attributes.gallery_height;
    
    _root.myImages = myGalleryXML.firstChild.childNodes;
    _root.myImagesTotal = myImages.length;
    
    _root.thumb_height = myGalleryXML.firstChild.attributes.thumb_height;
    _root.thumb_width = myGalleryXML.firstChild.attributes.thumb_width;
    
    _root.full_x = myGalleryXML.firstChild.attributes.full_x;
    _root.full_y = myGalleryXML.firstChild.attributes.full_y;
    
    callThumbs();
    createMask();
    scrolling();
    
    };
    function callThumbs() {
    
    _root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());
    container_mc._x = _root.gallery_x;
    container_mc._y = _root.gallery_y;
    
    var clipLoader = new MovieClipLoader();
    var preloader = new Object();
    clipLoader.addListener(preloader);
    
    for (i=0; i<_root.myImagesTotal; i++) {
    thumbURL = myImages[i].attributes.thumb_url;
    myThumb_mc = container_mc.createEmptyMovieClip(i, container_mc.getNextHighestDepth() );
    myThumb_mc._x = _root.thumb_height*i;
    clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);
    
    preloader.onLoadComplete=function(target){
    new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true)*3;
    target.onRelease=function(){
    callFullImage(this._name);
    }
    
    target.onRollOver=function(){
    this._alpha=75;
    };
    
    target.onRollOut=function(){
    this._alpha=100;
    };
    
    }
    }
    }
    function callFullImage(myNumber) {
    
    myURL = myImages[myNumber].attributes.full_url;
    _root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
    fullImage_mc._x = _root.full_x;
    fullImage_mc._y = _root.full_y;
    
    var fullClipLoader = new MovieClipLoader();
    fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc);
    
    
    fullImage_mc.onRelease = function(){
    
    fullImage_mc.removeMovieClip();
    }
    }???????????????????????
    
    
    
    function createMask() {
    
    _root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());
    
    mask_mc._x = _root.gallery_x;
    mask_mc._y = _root.gallery_y;
    
    mask_mc.beginFill(0x000000,100);
    mask_mc.lineTo(_root.gallery_width,0);
    mask_mc.lineTo(_root.gallery_width,_root.gallery_height);
    mask_mc.lineTo(0,_root.gallery_height);
    mask_mc.lineTo(0,0);
    
    container_mc.setMask(mask_mc);
    
    }
    function scrolling() { 
    _root.onEnterFrame = function() {
    if (mask_mc._xmouse<(mask_mc._width*(1/3)) || mask_mc._xmouse>(mask_mc._width*(2/3))) {
    container_mc._x += Math.cos(((mask_mc._xmouse)/mask_mc._width)*Math.PI)*3;
    
    if (container_mc._x>mask_mc._x) {
    container_mc._x = mask_mc._x;
    }
    
    if (container_mc._x<(mask_mc._x-(container_mc._width-mask_mc._width))) {
    container_mc._x = mask_mc._x-(container_mc._width-mask_mc._width);
    }
    }
    };
    }

  2. #2
    TP-Moderator Avatar von Wanderratte
    Registriert seit
    Mar 2002
    Beiträge
    5.487
    Hallo,

    versuch es mal so
    PHP-Code:
    fullImage_mc.onRelease = function() {

        
    removeMovieClip(this);

    }; 
    Gruß

    Wanderratte
    Gebildet ist,
    wer weiß,
    wo er findet,
    was er nicht weiß.

    4bugs
    Home
    Amazon Wunschzettel

  3. #3
    TP-Newbie
    Registriert seit
    Sep 2009
    Beiträge
    4
    hm, leider nein. ich hänge schon den ganzen tag an diesem einen befehl. vielleicht liegt es daran das ich die bilder aus einer datei lade?

  4. #4
    TP-Moderator Avatar von Wanderratte
    Registriert seit
    Mar 2002
    Beiträge
    5.487
    Hallo,

    ich habe es jetzt nicht gestet aber so sollte es gehen:
    PHP-Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;

    var 
    myGalleryXML = new XML();
    myGalleryXML.ignoreWhite true;
    myGalleryXML.load("gallery.xml");

    myGalleryXML.onLoad = function() {
        
    _root.gallery_x myGalleryXML.firstChild.attributes.gallery_x;
        
    _root.gallery_y myGalleryXML.firstChild.attributes.gallery_y;
        
    _root.gallery_width myGalleryXML.firstChild.attributes.gallery_width;
        
    _root.gallery_height myGalleryXML.firstChild.attributes.gallery_height;

        
    _root.myImages myGalleryXML.firstChild.childNodes;
        
    _root.myImagesTotal myImages.length;

        
    _root.thumb_height myGalleryXML.firstChild.attributes.thumb_height;
        
    _root.thumb_width myGalleryXML.firstChild.attributes.thumb_width;

        
    _root.full_x myGalleryXML.firstChild.attributes.full_x;
        
    _root.full_y myGalleryXML.firstChild.attributes.full_y;

        
    callThumbs();
        
    createMask();
        
    scrolling();

    };
    var 
    mclListener:Object = new Object();
    mclListener.onLoadInit = function(target_mc:MovieClip) {
        
    target_mc.onRelease = function() {

            
    removeMovieClip(this);
        };

    };
    function 
    callThumbs() {

        
    _root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());
        
    container_mc._x _root.gallery_x;
        
    container_mc._y _root.gallery_y;

        var 
    clipLoader = new MovieClipLoader();
        var 
    preloader = new Object();
        
    clipLoader.addListener(preloader);

        for (
    i=0i<_root.myImagesTotali++) {
            
    thumbURL myImages[i].attributes.thumb_url;
            
    myThumb_mc container_mc.createEmptyMovieClip(icontainer_mc.getNextHighestDepth());
            
    myThumb_mc._x _root.thumb_height*i;
            
    clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);

            
    preloader.onLoadComplete = function(target) {
                new 
    Tween(target"_alpha"Strong.easeOut0100.5true)*3;
                
    target.onRelease = function() {
                    
    callFullImage(this._name);
                };

                
    target.onRollOver = function() {
                    
    this._alpha 75;
                };

                
    target.onRollOut = function() {
                    
    this._alpha 100;
                };

            };
        }
    }
    function 
    callFullImage(myNumber) {

        
    myURL myImages[myNumber].attributes.full_url;
        
    _root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
        
    fullImage_mc._x _root.full_x;
        
    fullImage_mc._y _root.full_y;
        var 
    fullClipLoader:MovieClipLoader = new MovieClipLoader();
        
    fullClipLoader.addListener(mclListener);
        
    fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc);

    }



    function 
    createMask() {

        
    _root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());

        
    mask_mc._x _root.gallery_x;
        
    mask_mc._y _root.gallery_y;

        
    mask_mc.beginFill(0x000000,100);
        
    mask_mc.lineTo(_root.gallery_width,0);
        
    mask_mc.lineTo(_root.gallery_width,_root.gallery_height);
        
    mask_mc.lineTo(0,_root.gallery_height);
        
    mask_mc.lineTo(0,0);

        
    container_mc.setMask(mask_mc);

    }
    function 
    scrolling() {
        
    _root.onEnterFrame = function() {
            if (
    mask_mc._xmouse<(mask_mc._width*(1/3)) || mask_mc._xmouse>(mask_mc._width*(2/3))) {
                
    container_mc._x += Math.cos(((mask_mc._xmouse)/mask_mc._width)*Math.PI)*3;

                if (
    container_mc._x>mask_mc._x) {
                    
    container_mc._x mask_mc._x;
                }

                if (
    container_mc._x<(mask_mc._x-(container_mc._width-mask_mc._width))) {
                    
    container_mc._x mask_mc._x-(container_mc._width-mask_mc._width);
                }
            }
        };

    Packe eine Beispieldatei mit allen Daten zusammen und hänge sie hier dran, dann schaue ich mal rein.
    Gruß

    Wanderratte
    Gebildet ist,
    wer weiß,
    wo er findet,
    was er nicht weiß.

    4bugs
    Home
    Amazon Wunschzettel

  5. #5
    TP-Newbie
    Registriert seit
    Sep 2009
    Beiträge
    4
    tausend dank!!!! der tag ist gerettet. dachte schon das wochenende ist hin.

    funktioniert super...

    wenn ich das ergebniss als swf. posten soll, fragt einfach.

    gruss

  6. #6
    TP-Moderator Avatar von Wanderratte
    Registriert seit
    Mar 2002
    Beiträge
    5.487
    Warum nicht und wenn du ganz mutig bist, schreibe ein wenig Text zu der Galerie und ich nehme sie in der AS - Sammlung auf
    Also Ordnerstruktur, wie die XML aussieht usw. halt das wichtigste.

    Übrigens lag der "Fehler" wirklich darin, dass du ein Bild eingeladen hast.
    In dem Moment wo du das onRelease zugewiesen hast, war für Flash noch keine Fläche vorhanden. Durch den Eventlistener 'onLoadInit' wird das onRelease erst dem MC zugewiesen wenn das Bild geladen ist
    Gruß

    Wanderratte
    Gebildet ist,
    wer weiß,
    wo er findet,
    was er nicht weiß.

    4bugs
    Home
    Amazon Wunschzettel

  7. #7
    TP-Newbie
    Registriert seit
    Sep 2009
    Beiträge
    4
    wird gemacht. wo lade ich die daten hoch? hier in den thread?

    hier schonmal die daten. das ganze sieht dann so aus...

    danke nochmal.
    Angehängte Dateien Angehängte Dateien

  8. #8
    TP-Moderator Avatar von Wanderratte
    Registriert seit
    Mar 2002
    Beiträge
    5.487
    Schreibe hier im Thread rein und ich werde es nacher in die richtige Rubrik schieben
    Gruß

    Wanderratte
    Gebildet ist,
    wer weiß,
    wo er findet,
    was er nicht weiß.

    4bugs
    Home
    Amazon Wunschzettel

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Ähnliche Themen

  1. movieclip ausblenden usw...
    Von b.b.entert im Forum Flash & Multimedia
    Antworten: 2
    Letzter Beitrag: 16.06.2004, 09:36
  2. MovieClip Steuern
    Von Tom im Forum Flash & Multimedia
    Antworten: 4
    Letzter Beitrag: 09.01.2004, 22:40
  3. Movieclip-Problem
    Von December im Forum Flash & Multimedia
    Antworten: 7
    Letzter Beitrag: 16.12.2003, 08:04
  4. Movieclip Verformen???
    Von Smake im Forum Flash & Multimedia
    Antworten: 1
    Letzter Beitrag: 23.11.2003, 13:33
  5. Wie spielt man den movieclip ab?
    Von torres im Forum Flash & Multimedia
    Antworten: 7
    Letzter Beitrag: 11.06.2003, 09:52

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

     

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

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