SWiSH Forum Strona Główna SWiSH Forum
Forum użytkowników programów SWiSH

FAQFAQ  SzukajSzukaj  UżytkownicyUżytkownicy  GrupyGrupy  StatystykiStatystyki
RejestracjaRejestracja  ZalogujZaloguj  DownloadDownload

Poprzedni temat «» Następny temat
zewnetrzny plik
Autor Wiadomość
maja9 
Bywalec


Dołączył: 09 Wrz 2009
Posty: 17
Skąd: wrocek
Wysłany: Sro 22 Wrz, 2010 07:35   zewnetrzny plik
   Moje WWW: m-designs.pl


Witam
Wiem, że tematów było wiele, przeglądałem, ale nie znalazłem satysfakcjonującej odpowiedz, także liczę, że ktoś będzie tak dobry i mi pomoże. Do rzeczy.

Mam galerie podobna do tej w iTunes i chcę ją załadować do mojej sceny po naciśnięciu np. jakiegoś buttona. Ładuje, spoko, tylko jak scenę mam większą od zewnętrznego pliku to mi ją rozwala. Załącznik "Scena". A jak jest tych samych wymiarów czyli 500x500 to jest dobrze. I teraz Proszę Was drodzy profesjonaliści o to jak byście mogli stworzyć sampla o wymiarach np. 1024x650 i załadować ten nieszczęsny plik przypuśćmy na środku sceny.

Pozdrawiam i liczę na Was :)
 
     
^Januszr 



Pomógł: 216 razy
Dołączył: 11 Maj 2005
Posty: 1854
Skąd: Stolyca od urodzenia
Wysłany: Sro 22 Wrz, 2010 08:17   

Plik, który chcesz załadować w swojej konstrukcji odnosi się do wymiaru STAGE - czyli filmu i zawsze orientacja elementów będzie wynikiem dzielenia rozmiaru filmu na jakieś części. Według mnie pomóc może tylko plik źródłowy SWI - wystarczy pozamieniać kilka linii kodu i będzie dawało się ładować.
_________________
Niestety używam nieoficjalnych wersji Swish, które można zassać z forums.swishzone.com - jest na szczycie listy w BugsForum.
 
     
maja9 
Bywalec


Dołączył: 09 Wrz 2009
Posty: 17
Skąd: wrocek
Wysłany: Sro 22 Wrz, 2010 08:21   
   Moje WWW: m-designs.pl


z tym, że jest to plik flashowy, posiadam źródło ale co z tego jak nie znam Flasha :( ((
 
     
^Januszr 



Pomógł: 216 razy
Dołączył: 11 Maj 2005
Posty: 1854
Skąd: Stolyca od urodzenia
Wysłany: Sro 22 Wrz, 2010 09:21   

Poproś na forum flash. Tutaj jest forum swish. Prawdopodobnie ktoś mógłby poradzić Ci i tutaj co pozmieniać ale musisz wpisać tutaj skrypt.
_________________
Niestety używam nieoficjalnych wersji Swish, które można zassać z forums.swishzone.com - jest na szczycie listy w BugsForum.
 
     
maja9 
Bywalec


Dołączył: 09 Wrz 2009
Posty: 17
Skąd: wrocek
Wysłany: Sro 22 Wrz, 2010 09:30   
   Moje WWW: m-designs.pl


dzięki

Skrypt:

Kod:
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
var root:MovieClip = this;
var myMO:Object;
var myKO:Object;
var loadedAll:Boolean;
var distance:Number;
var autoJump:Number = .15;
// The distance to automatically resize to the exact target sizes
var maxSlide:Number = 100;
// The maximum slide speed
var minScaleDistance:Number = 100;
// The minimum distance from centerX to scale
var deleteMinDistance:Number = 0;
// The minimum point to delete items
var doubleClickURL:Boolean = true;
// Whether or not to open a link on double click
var deleteMaxDistance:Number = 500;
// The maximum point to delete items
var doubleClickRegister:Number = 500;
// The maximum delay (in milliseconds) to register as a double click
var _CDProportions:String = "auto";
// auto or resize
// auto will KEEP proportions
// Anything else will resize the art
var frontCDWidth:Number = 400;
// If _CDProportions is NOT auto art will be resized to have a width of this when it's at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM width of this when it's at the front
var frontCDHeight:Number = 250;
// If _CDProportions is NOT auto art will be resized to have a width of this when it's at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM width of this when it's at the front
var shelveCDHeight:Number = 150;
// If _CDProportions is NOT auto art will be resized to have a height of this when it's at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM height of this when it's at the front
var shelveCDWidth:Number = 120;
// If _CDProportions is NOT auto art will be resized to have a width of this when it's NOT at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM width of this when it's NOT at the front
var shelveCDSpacing:Number = 50;
// If _CDProportions is NOT auto art will be resized to have a height of this when it's NOT at the front
// Otherwise, if _CDProportions is auto art will be allowed to have a MAXIMUM height of this when it's NOT at the front
var centerDistance:Number = 60;
// The x distance from the front artwork to the preceding and succeding art
var albumEase:Number = 3;
// The ease speed for the art
var angle:Number = 8;
// The angle of art not at the front
var fadePointMin:Number = 10;
// Minimum point to fade
var fadePointMax:Number = 490;
// Maximum point to fade
var fadeDist:Number = 50;
// How far to fade for
var fadeType:String = "alpha";
// alpha or brightness
// If set to alpha, art will have an alpha fade to the sides
// If set to brightness, art will have a brightness fade to the sides
var current:Number = 1;
// The starting album number
var centerX:Number = Stage.width/2;
// Where to start the placement from
var centerY:Number = 155;
// Where to place art on the y axis
var clickDelay:Number = 750;
// When a user presses the scrollbar's track, how long to wait before skipping to the next/previous
var scrollBarStart:Number = 20;
// Distance from the left in the scrollBar movieclip to allow the scrollbar
var reflectionBlurX:Number = 0;
// How much blur to put on the x of reflections
var reflectionBlurY:Number = 0;
// How much blur to put on the y of reflections
var reflectionQuality:Number = 3;
// The quality of the blur of reflections - 1,2,3
var reflectionSpace:Number = 0;
// How far space on the y between the art and the reflection
var scrollerDelay:Number = 150;
// When the left/right scrollbar arrows are pressed, the delay before skipping to the next/previous
var scrollBarStop:Number = scrollBar.scroller._width+34;
// Distance from the right in the scrollBar movieclip to allow the scrollbar
var slideshowLooping:Boolean = true;
// Whether or not to loop the slidehow feature
var slideshowSpeed:Number = 2500;
// The speed (in milliseconds) of the slidehow feature
var unknownSong:String = "Unknown Title";
// Default caption for song's titles
var unknownArtist:String = "Unknown Artist";
// Default caption for song's artists
var unknownAlbum:String = "Unknown Album";
// Default caption for song's albums
var infostruc:Array = [];
var variableSetup:Array = [];
// LEAVE THESE (unless you know what you're doing =] `)
var xmlData:XML = new XML();
MovieClip.prototype.setSides = function(x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number, x4:Number, y4:Number):Void  {
    this.px1 = x1;
    this.py1 = y1;
    this.px2 = x2;
    this.py2 = y2;
    this.px3 = x3;
    this.py3 = y3;
    this.px4 = x4;
    this.py4 = y4;
};
MovieClip.prototype.DistortImage = function(ptexture, vseg:Number, hseg:Number) {
    if (ptexture instanceof BitmapData) {
        this.texture = ptexture;
    } else if (ptexture instanceof MovieClip) {
        this.texture = new BitmapData(ptexture._width, ptexture._height);
        this.texture.draw(ptexture);
    }
    this._w = this.texture.width;
    this._h = this.texture.height;
    this._aMcs = [];
    this._p = [];
    this._tri = [];
    this.init();
};
MovieClip.prototype.setTransform = function(x0:Number, y0:Number, x1:Number, y1:Number, x2:Number, y2:Number, x3:Number, y3:Number):Void  {
    this.dx30 = x3-x0;
    this.dy30 = y3-y0;
    this.dx21 = x2-x1;
    this.dy21 = y2-y1;
    for (var l in this._p) {
        this.point = this._p[l];
        var gx = (this.point.x-this._xMin)/this._w;
        var gy = (this.point.y-this._yMin)/this._h;
        var bx = x0+gy*(this.dx30);
        var by = y0+gy*(this.dy30);
        this.point.sx = bx+gx*((x1+gy*(this.dx21))-bx);
        this.point.sy = by+gx*((y1+gy*(this.dy21))-by);
    }
    this.render();
};
MovieClip.prototype.init = function(Void):Void  {
    this._p = [];
    this._tri = [];
    this.w2 = this._w/2;
    this.h2 = this._h/2;
    this._xMin = this._yMin=0;
    this._xMax = this._w;
    this._yMax = this._h;
    this._hsLen = this._w/2;
    this._vsLen = this._h/2;
    for (ix=0; ix<3; ix++) {
        for (iy=0; iy<3; iy++) {
            x = ix*this._hsLen;
            y = iy*this._vsLen;
            this._p.push({x:x, y:y, sx:x, sy:y});
        }
    }
    for (ix=0; ix<2; ix++) {
        for (iy=0; iy<2; iy++) {
            this.p0 = this._p[iy+ix*3];
            this.p1 = this._p[iy+ix*3+1];
            this.p2 = this._p[iy+(ix+1)*3];
            this.addTriangle(this.p0, this.p1, this.p2);
            this.p0 = this._p[iy+(ix+1)*3+1];
            this.p1 = this._p[iy+(ix+1)*3];
            this.p2 = this._p[iy+ix*3+1];
            this.addTriangle(this.p0, this.p1, this.p2);
        }
    }
    this.render();
};
MovieClip.prototype.addTriangle = function(p0:Object, p1:Object, p2:Object):Void  {
    this.tMat = {};
    this.u0 = p0.x;
    this.v0 = p0.y;
    this.u1 = p1.x;
    this.v1 = p1.y;
    this.u2 = p2.x;
    this.v2 = p2.y;
    this.tMat.tx = -this.v0*(this._w/(this.v1-this.v0));
    this.tMat.ty = -this.u0*(this._h/(this.u2-this.u0));
    this.tMat.a = this.tMat.d=0;
    this.tMat.b = this._h/(this.u2-this.u0);
    this.tMat.c = this._w/(this.v1-this.v0);
    this._tri.push([p0, p1, p2, this.tMat]);
};
MovieClip.prototype.render = function(Void):Void  {
    this.clear();
    this.ih = 1/this._h;
    this.iw = 1/this._w;
    this.tM = this.sM={};
    for (var l in this._tri) {
        a = this._tri[l];
        this.p0 = a[0];
        this.p1 = a[1];
        this.p2 = a[2];
        this.tM = a[3];
        this.sM.a = (this.p1.sx-(this.x0=this.p0.sx))*this.iw;
        this.sM.b = (this.p1.sy-(this.y0=this.p0.sy))*this.iw;
        this.sM.c = (this.p2.sx-this.x0)*this.ih;
        this.sM.d = (this.p2.sy-this.y0)*this.ih;
        this.sM.tx = this.x0;
        this.sM.ty = this.y0;
        this.sM = concat(this.sM, this.tM);
        this.beginBitmapFill(this.texture, this.sM, false, false);
        this.moveTo(this.x0, this.y0);
        this.lineTo(this.p1.sx, this.p1.sy);
        this.lineTo(this.p2.sx, this.p2.sy);
        this.endFill();
    }
};
function loadPlayList(url:String, albumID:Number) {
    delete myMO.onMouseWheel;
    delete myKO.onKeyDown;
    for (var i in infostruc) {
        root["_ref"+i] = root["_bmd"+i]=false;
    }
    loadedAll = false;
    infostruc = [];
    for (var i in root) {
        if ((root[i]._name.substr(0, 3) == "art" || root[i]._name.substr(0, 10) == "reflection") && (parseInt(root[i]._name.split("art")[1]) || parseInt(root[i]._name.split("reflection")[1]))) {
            root[i].swapDepths(root.getNextHighestDepth());
            root[i].removeMovieClip();
        }
    }
    current = albumID || 1;
    root.createEmptyMovieClip("loader", root.getNextHighestDepth());
    xmlData.load(url);
}
function init(Void):Void {
    myMO = {};
    myKO = {};
    Mouse.addListener(myMO);
    Key.addListener(myKO);
    for (var i in infostruc) {
        loader.clear();
        loader.gradient_mc.removeMovieClip();
        var art:MovieClip = loader.attachMovie("default", "art", 1);
        root["_shelveCDWidth"+i] = shelveCDWidth;
        root["_shelveCDHeight"+i] = shelveCDHeight;
        root["_frontCDWidth"+i] = frontCDWidth;
        root["_frontCDHeight"+i] = frontCDHeight;
        this["_bmd"+i] = new BitmapData(art._width, art._height, true, 0x00FFFFFF);
        this["_ref"+i] = new BitmapData(art._width, art._height, true, 0x00FFFFFF);
        this["_bmd"+i].draw(art);
        if (reflect) {
            var mc:MovieClip = loader.createEmptyMovieClip("gradient_mc", loader.getNextHighestDepth());
            var gradient_target:MovieClip = mc.attachMovie(maskImage, "mask", 1);
            gradient_target._width = art._width;
            gradient_target._height = art._height;
            gradient_target.cacheAsBitmap = true;
            art.cacheAsBitmap = true;
            art.setMask(gradient_target);
            this["_ref"+i].draw(loader);
        }
    }
    for (var i:Number = count=0; count<Stage.width-(centerDistance*3); count += shelveCDSpacing, i++) {
        var cArt:MovieClip = this.createEmptyMovieClip("art"+this.getNextHighestDepth(), this.getNextHighestDepth());
        var rArt:MovieClip = reflect ? this.createEmptyMovieClip("reflection"+(this.getNextHighestDepth()-1), this.getNextHighestDepth()) : null;
        rArt.id = cArt.id=rArt.cid=cArt.cid=Number(i)+1;
        rArt._x = cArt._x=Stage.width;
        cArt.DistortImage(this["_bmd"+cArt.id]);
        controlTheObject(cArt);
        rArt.DistortImage(this["_ref"+cArt.id]);
        controlTheObject(rArt);
        if (reflect) {
            var tmpFilter:BlurFilter = new BlurFilter(reflectionBlurX, reflectionBlurY, reflectionQuality);
            rArt.filterArray = cArt.filterArray=[];
            rArt.filterArray[0] = tmpFilter;
            rArt.filters = rArt.filterArray;
        }
        tmask = mask.duplicateMovieClip("_mask"+cArt.id, this.getNextHighestDepth(), {_x:mask._x, _y:mask._y});
        if (reflect) {
            rmask = mask.duplicateMovieClip("_rmask"+cArt.id, this.getNextHighestDepth(), {_x:mask._x, _y:mask._y});
            rArt.setMask(rmask);
        }
        cArt.setMask(tmask);
        rArt._visible = cArt._visible=false;
    }
    myMO.onMouseWheel = function(delta:Number):Void  {
        if (delta>0) {
            next();
        } else if (delta<=0) {
            previous();
        }
    };
    myKO.onKeyDown = function():Void  {
        if (Selection.getFocus() != "_level0.goto") {
            if (Key.isDown(Key.RIGHT)) {
                next();
            } else if (Key.isDown(Key.LEFT)) {
                previous();
            }
        }
    };
    scrollBar.scroller.onPress = function():Void  {
        dist = this._parent._xmouse-this._x;
        this.onMouseMove = function():Void  {
            tmp = 1+Math.ceil(((this._parent._xmouse-dist)-scrollBarStart)/(scrollBar._width-scrollBarStop)*(infostruc.length-1));
            if (tmp>infostruc.length) {
                tmp = infostruc.length;
            }
            if (tmp<1) {
                tmp = 1;
            }
            current = tmp;
            updateInfo();
        };
    };
    scrollBar.scroller.onRelease = scrollBar.scroller.onReleaseOutside=function ():Void {
        stopDrag();
        delete this.onMouseMove;
    };
    scrollBar.left.onPress = function():Void  {
        previous();
        shifter = setInterval(previous, scrollerDelay);
    };
    scrollBar.right.onPress = function():Void  {
        next();
        shifter = setInterval(next, scrollerDelay);
    };
    scrollBar.onMouseUp = function():Void  {
        clearInterval(shifter);
    };
    scrollBar.onMouseDown = function():Void  {
        if (this.hitTest(_xmouse, _ymouse, true) && !this.left.hitTest(_xmouse, _ymouse, true) && !this.right.hitTest(_xmouse, _ymouse, true)) {
            if (this._xmouse<this.scroller._x) {
                previous();
                shifter = setInterval(previous, clickDelay);
            }
            if (this._xmouse>this.scroller._x+this.scroller._width) {
                next();
                shifter = setInterval(next, clickDelay);
            }
        }
    };
    goto.restrict = "0-9";
    goto.onKillFocus = function():Void  {
        if (!isNaN(Number(this.text)+1)) {
            if (this.text>infostruc.length) {
                this.text = infostruc.length;
            }
            if (this.text<1) {
                this.text = 1;
            }
            current = Number(this.text);
        } else {
            this.text = current;
        }
        updateInfo();
    };
    fscreen.onPress = goFullScreen;
    slideShow.onPress = setSlideShow;
    distance = Number(i);
    mask.removeMovieClip();
    fscreen.swapDepths(1102);
    slideShow.swapDepths(1103);
    scrollBar.swapDepths(1101);
    i2.swapDepths(1105);
    i1.swapDepths(1106);
    loader.removeMovieClip();
    loadNext();
    updateInfo();
}
function setSlideShow():Void {
    if (isSliding) {
        clearInterval(sliderShow);
        slideShow.gotoAndStop(2);
        sliderShow = setInterval(function ():Void {
            if (current<infostruc.length) {
                next();
            } else if (slideshowLooping) {
                current = 0;
                next();
            }
        }, slideshowSpeed);
    } else {
        slideShow.gotoAndStop(1);
        clearInterval(sliderShow);
    }
    isSliding = !isSliding;
}
var slistener:Object = {};
Stage.addListener(slistener);
slistener.onFullScreen = updateButton();
function updateButton():Void {
    fscreen.gotoAndStop(1+(Stage["displayState"] == "fullScreen"));
}
function goFullScreen():Void {
    Stage.align = "MC";
    Stage["displayState"] = Stage["displayState"] == "normal" ? "fullScreen" : "normal";
    updateButton();
}
function concat(m1, m2):Object {
    var mat:Object = {};
    mat.a = m1.c*m2.b;
    mat.b = m1.d*m2.b;
    mat.c = m1.a*m2.c;
    mat.d = m1.b*m2.c;
    mat.tx = m1.a*m2.tx+m1.c*m2.ty+m1.tx;
    mat.ty = m1.b*m2.tx+m1.d*m2.ty+m1.ty;
    return mat;
}
function updateInfo():Void {
    goto.text = current;
    info = infostruc[current-1].info;
    author = infostruc[current-1].auth;
    album = infostruc[current-1].album;
    displayAlternArt(root["_bmd"+(current-1)], artDisplay._width, artDisplay._height);
    scrollBar.scroller._x = scrollBarStart+((current-1)/(infostruc.length-1)*(scrollBar._width-scrollBarStop));
}
function brightness(_prop:String, _old:Number, _new:Number, target:MovieClip):Void {
    var brightness_array:Array = [1, 0, 0, 0, _new, 0, 1, 0, 0, _new, 0, 0, 1, 0, _new, 0, 0, 0, 1, 0];
    target.filterArray[1] = new ColorMatrixFilter(brightness_array);
    target.filters = target.filterArray;
}
function controlTheObject(mc):Void {
    if (mc._name.indexOf("reflection") == -1) {
        mc.onPress = function():Void  {
            if (this.pressTime && (getTimer()-this.pressTime<=doubleClickRegister)) {
                this.pressTime = 0;
                root[infostruc[this.cid].onDoubleClick]();
                if (infostruc[this.cid].urlToGet && !doubleClickURL) {
                    getURL(infostruc[this.cid].urlToGet, "_"+infostruc[this.cid].urlAction);
                }
            } else {
                root[infostruc[this.cid].onClick]();
                this.pressTime = getTimer();
                current = this.cid+1;
            }
            updateInfo();
        };
    }
    mc.watch("_brightness", brightness, mc);
    mc.onEnterFrame = function():Void  {
        this._visible = true;
        if (infostruc[this.cid].loaded && !this.loadedImage) {
            this.allowUpdate = true;
            this.DistortImage(this._name.indexOf("reflection")>-1 ? this._parent["_ref"+this.cid] : this._parent["_bmd"+this.cid]);
            this.setTransform(this.px1, this.py1, this.px2, this.py2, this.px3, this.py3, this.px4, this.py4);
            this.loadedImage = true;
        }
        if (Math.round(Math.abs(this._x-this.x))>=1 || this.allowUpdate) {
            if (this._name.indexOf("reflection") == -1) {
                this._y = centerY+((shelveCDHeight/2)-(this._parent["_shelveCDHeight"+this.cid]/2));
                if (this._x>=centerX+centerDistance) {
                    this.swapDepths(-this._x);
                    this.setSides(-(this._parent["_shelveCDWidth"+this.cid]/2), -(this._parent["_shelveCDHeight"+this.cid]/2)+((Math.sin(angle*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), this._parent["_shelveCDWidth"+this.cid]/2, -(this._parent["_shelveCDHeight"+this.cid]/2), this._parent["_shelveCDWidth"+this.cid]/2, this._parent["_shelveCDHeight"+this.cid]/2, -(this._parent["_shelveCDWidth"+this.cid]/2), (this._parent["_shelveCDHeight"+this.cid]/2)-((Math.sin(angle*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])));
                } else if (this._x<=centerX-centerDistance) {
                    this.swapDepths(this._x);
                    this.setSides(-(this._parent["_shelveCDWidth"+this.cid]/2), -(this._parent["_shelveCDHeight"+this.cid]/2), this._parent["_shelveCDWidth"+this.cid]/2, -(this._parent["_shelveCDHeight"+this.cid]/2)+(Math.sin(angle*Math.PI/180)*this._parent["_frontCDWidth"+this.cid]), this._parent["_shelveCDWidth"+this.cid]/2, (this._parent["_shelveCDHeight"+this.cid]/2)-(Math.sin(angle*Math.PI/180)*this._parent["_frontCDWidth"+this.cid]), -(this._parent["_shelveCDWidth"+this.cid]/2), this._parent["_shelveCDHeight"+this.cid]/2);
                } else if (this.cid == current-1 || this.cid == current || this.cid == current-2) {
                    if (this._x>centerX-centerDistance && Math.floor(this._x)<centerX && angle-((this._x-(centerX-centerDistance))/centerDistance*angle)>autoJump) {
                        this.swapDepths(1002);
                        var sum:Number = this._parent["_shelveCDWidth"+this.cid]+((this._x-(centerX-centerDistance))/centerDistance*(this._parent["_frontCDWidth"+this.cid]-this._parent["_shelveCDWidth"+this.cid]));
                        var sum2:Number = angle-((this._x-(centerX-centerDistance))/centerDistance*angle);
                        var sum3:Number = this._parent["_shelveCDHeight"+this.cid]+((this._x-(centerX-centerDistance))/centerDistance*(this._parent["_frontCDHeight"+this.cid]-this._parent["_shelveCDHeight"+this.cid]));
                        this.setSides(-(sum/2), -(sum3/2), sum/2, -(sum3/2)+((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), sum/2, (sum3/2)-((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), -(sum/2), sum3/2);
                    } else if (this._x<centerX+centerDistance && Math.ceil(this._x)>centerX && angle-(((centerX+centerDistance)-this._x)/centerDistance*angle)>autoJump) {
                        this.swapDepths(1003);
                        var sum:Number = this._parent["_shelveCDWidth"+this.cid]+(((centerX+centerDistance)-this._x)/centerDistance*(this._parent["_frontCDWidth"+this.cid]-this._parent["_shelveCDWidth"+this.cid]));
                        var sum2:Number = angle-(((centerX+centerDistance)-this._x)/centerDistance*angle);
                        var sum3:Number = this._parent["_shelveCDHeight"+this.cid]+(((centerX+centerDistance)-this._x)/centerDistance*(this._parent["_frontCDHeight"+this.cid]-this._parent["_shelveCDHeight"+this.cid]));
                        this.setSides(-(sum/2), -(sum3/2)+((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), sum/2, -(sum3/2), sum/2, sum3/2, -(sum/2), (sum3/2)-((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])));
                    } else {
                        this.swapDepths(1004);
                        this.setSides(-(this._parent["_frontCDWidth"+this.cid]/2), -(this._parent["_frontCDHeight"+this.cid]/2), this._parent["_frontCDWidth"+this.cid]/2, -(this._parent["_frontCDHeight"+this.cid]/2), this._parent["_frontCDWidth"+this.cid]/2, this._parent["_frontCDHeight"+this.cid]/2, -(this._parent["_frontCDWidth"+this.cid]/2), this._parent["_frontCDHeight"+this.cid]/2);
                    }
                } else {
                    if (this._x>centerX-centerDistance && Math.floor(this._x)<centerX && angle-((this._x-(centerX-centerDistance))/centerDistance*angle)>autoJump) {
                        this.swapDepths(1002);
                        var sum2:Number = angle-((this._x-(centerX-centerDistance))/centerDistance*angle);
                        this.setSides(-(this._parent["_shelveCDWidth"+this.cid]/2), -(this._parent["_shelveCDHeight"+this.cid]/2), this._parent["_shelveCDWidth"+this.cid]/2, -(this._parent["_shelveCDHeight"+this.cid]/2)+((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), this._parent["_shelveCDWidth"+this.cid]/2, (this._parent["_shelveCDHeight"+this.cid]/2)-((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), -(this._parent["_shelveCDWidth"+this.cid]/2), this._parent["_shelveCDHeight"+this.cid]/2);
                    } else if (this._x<centerX+centerDistance && Math.ceil(this._x)>centerX && angle-(((centerX+centerDistance)-this._x)/centerDistance*angle)>autoJump) {
                        this.swapDepths(1003);
                        var sum2:Number = angle-(((centerX+centerDistance)-this._x)/centerDistance*angle);
                        this.setSides(-(this._parent["_shelveCDWidth"+this.cid]/2), -(this._parent["_shelveCDHeight"+this.cid]/2)+((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), this._parent["_shelveCDWidth"+this.cid]/2, -(this._parent["_shelveCDHeight"+this.cid]/2), this._parent["_shelveCDWidth"+this.cid]/2, this._parent["_shelveCDHeight"+this.cid]/2, -(this._parent["_shelveCDWidth"+this.cid]/2), (this._parent["_shelveCDHeight"+this.cid]/2)-((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])));
                    }
                }
            } else {
                this._yscale = -100;
                this._y = centerY+((shelveCDHeight/2)-(this._parent["_shelveCDHeight"+this.cid]/2))+this._parent["_shelveCDHeight"+this.cid]+reflectionSpace;
                if (this._x>=centerX+centerDistance) {
                    this.swapDepths(-this._x-333);
                    this.setSides(-(this._parent["_shelveCDWidth"+this.cid]/2), -(this._parent["_shelveCDHeight"+this.cid]/2)+(Math.sin(angle*Math.PI/180)*this._parent["_frontCDWidth"+this.cid]), -(this._parent["_shelveCDWidth"+this.cid]/2)+this._parent["_shelveCDWidth"+this.cid], -(this._parent["_shelveCDHeight"+this.cid]/2), -(this._parent["_shelveCDWidth"+this.cid]/2)+this._parent["_shelveCDWidth"+this.cid], this._parent["_shelveCDHeight"+this.cid]/2, -(this._parent["_shelveCDWidth"+this.cid]/2), (this._parent["_shelveCDHeight"+this.cid]/2)+((Math.sin(angle*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])));
                } else if (this._x<=centerX-centerDistance) {
                    this.swapDepths(this._x-333);
                    this.setSides(-(this._parent["_shelveCDWidth"+this.cid]/2), -(this._parent["_shelveCDHeight"+this.cid]/2), -(this._parent["_shelveCDWidth"+this.cid]/2)+this._parent["_shelveCDWidth"+this.cid], -(this._parent["_shelveCDHeight"+this.cid]/2)+((Math.sin(angle*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), -(this._parent["_shelveCDWidth"+this.cid]/2)+this._parent["_shelveCDWidth"+this.cid], (this._parent["_shelveCDHeight"+this.cid]/2)+(Math.sin(angle*Math.PI/180)*this._parent["_frontCDWidth"+this.cid]), -(this._parent["_shelveCDWidth"+this.cid]/2), this._parent["_shelveCDHeight"+this.cid]/2);
                } else if (this.cid == current-1 || this.cid == current || this.cid == current-2) {
                    if (this._x>centerX-centerDistance && this._x<centerX && !validateOk(this)) {
                        this.swapDepths(999);
                        var sum:Number = this._parent["_shelveCDWidth"+this.cid]+((this._x-(centerX-centerDistance))/centerDistance*(this._parent["_frontCDWidth"+this.cid]-this._parent["_shelveCDWidth"+this.cid]));
                        var sum2:Number = angle-((this._x-(centerX-centerDistance))/centerDistance*angle);
                        var sum3:Number = this._parent["_shelveCDHeight"+this.cid]+((shelveCDHeight/2)-(this._parent["_shelveCDHeight"+this.cid]/2))+((this._x-(centerX-centerDistance))/centerDistance*(this._parent["_frontCDHeight"+this.cid]-this._parent["_shelveCDHeight"+this.cid]));
                        this._y = centerY+sum3+reflectionSpace;
                        this.setSides(-(sum/2), -(sum3/2), sum/2, -(sum3/2)+((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), sum/2, (sum3/2)+((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), -(sum/2), sum3/2);
                    } else if (this._x<centerX+centerDistance && this._x>centerX && !validateOk(this)) {
                        this.swapDepths(998);
                        var sum:Number = this._parent["_shelveCDWidth"+this.cid]+(((centerX+centerDistance)-this._x)/centerDistance*(this._parent["_frontCDWidth"+this.cid]-this._parent["_shelveCDWidth"+this.cid]));
                        var sum2:Number = angle-(((centerX+centerDistance)-this._x)/centerDistance*angle);
                        var sum3:Number = this._parent["_shelveCDHeight"+this.cid]+((shelveCDHeight/2)-(this._parent["_shelveCDHeight"+this.cid]/2))+(((centerX+centerDistance)-this._x)/centerDistance*(this._parent["_frontCDHeight"+this.cid]-this._parent["_shelveCDHeight"+this.cid]));
                        this.setSides(-(sum/2), -(sum3/2)+((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])), sum/2, -(sum3/2), sum/2, sum3/2, -(sum/2), (sum3/2)+((Math.sin(sum2*Math.PI/180)*this._parent["_frontCDWidth"+this.cid])));
                        this._y = centerY+sum3+reflectionSpace;
                    } else if (!validateOk(this)) {
                        this.swapDepths(995);
                        this._y = centerY+((shelveCDHeight/2)-(this._parent["_shelveCDHeight"+this.cid]/2))+this._parent["_frontCDHeight"+this.cid]+reflectionSpace;
                        this.setSides(-(this._parent["_frontCDWidth"+this.cid]/2), -(this._parent["_frontCDHeight"+this.cid]/2), this._parent["_frontCDWidth"+this.cid]/2, -(this._parent["_frontCDHeight"+this.cid]/2), this._parent["_frontCDWidth"+this.cid]/2, this._parent["_frontCDHeight"+this.cid]/2, -(this._parent["_frontCDWidth"+this.cid]/2), this._parent["_frontCDHeight"+this.cid]/2);
                    }
                }
            }
            this.allowUpdate = false;
            this._x -= Math.min(Math.max((this._x-this.x)/albumEase, -maxSlide), maxSlide);
            this.setTransform(this.px1, this.py1, this.px2, this.py2, this.px3, this.py3, this.px4, this.py4);
            if (this._x<deleteMinDistance && this._parent["_ref"+(this.cid+distance)]) {
                this.cid += distance;
                this._x = deleteMaxDistance;
                controlTheObject(this);
                this._visible = false;
                this.loadedImage = infostruc[this.cid].loaded;
                this.DistortImage(this._name.indexOf("reflection")>-1 ? this._parent["_ref"+this.cid] : this._parent["_bmd"+this.cid]);
            }
            if (this._x>deleteMaxDistance && this._parent["_ref"+(this.cid-distance)]) {
                this.cid -= distance;
                this._x = deleteMinDistance;
                controlTheObject(this);
                this._visible = false;
                this.loadedImage = infostruc[this.cid].loaded;
                this.DistortImage(this._name.indexOf("reflection")>-1 ? this._parent["_ref"+this.cid] : this._parent["_bmd"+this.cid]);
            }
        } else if (Math.ceil(Math.abs(this._x-this.x)) == 0) {
            this._x = this.x;
        }
        if (this.cid+1>current) {
            this.x = (centerX+((this.cid+1-current)*shelveCDSpacing))+centerDistance;
        } else if (this.cid+1<current) {
            this.x = (centerX+((this.cid+1-current)*shelveCDSpacing))-centerDistance;
        } else {
            this.x = centerX+((this.cid+1-current)*shelveCDSpacing);
        }
        if (fadeType == "brightness") {
            if (this._x<fadePointMin+fadeDist) {
                this._brightness = -(250-((this._x-fadePointMin)/fadeDist*250));
            } else if (this._x>fadePointMax-fadeDist) {
                this._brightness = -(250-((fadePointMax-this._x)/fadeDist*250));
            } else {
                this._brightness = 0;
            }
        } else if (fadeType == "alpha") {
            if (this._x<fadePointMin+fadeDist) {
                this._alpha = ((this._x-fadePointMin)/fadeDist*100);
            } else if (this._x>fadePointMax-fadeDist) {
                this._alpha = ((fadePointMax-this._x)/fadeDist*100);
            } else {
                this._alpha = 100;
            }
        }
    };
}
function next():Void {
    if (current<infostruc.length) {
        current += 1;
    }
    updateInfo();
}
function previous():Void {
    if (current>1) {
        current -= 1;
    }
    updateInfo();
}
function displayAlternArt(art, width:Number, height:Number):Void {
    artDisplay.attachBitmap(art, 1);
    artDisplay._width = width;
    artDisplay._height = height;
}
function loadNext():Void {
    if (!loadedAll) {
        var num:Number = current-1;
        if (infostruc[current-1].loaded) {
            var num:Number = current-Math.floor(distance/2)-1>=0 ? current-Math.floor(distance/2)-1 : 0;
            while (infostruc[num].loaded && num<infostruc.length) {
                num++;
            }
            if (num>=infostruc.length) {
                var num:Number = current-1;
                while (infostruc[num].loaded && num>0) {
                    num--;
                }
                if (num<=0) {
                    loadedAll = true;
                }
            }
        }
        var newLoad:MovieClip = this.createEmptyMovieClip("artLoad"+num, this.getNextHighestDepth());
        newLoad.createEmptyMovieClip("art", newLoad.getNextHighestDepth());
        newLoad._alpha = 0;
        var mc:Object = {};
        mc.number = num;
        var artLoader:MovieClipLoader = new MovieClipLoader();
        artLoader.addListener(mc);
        artLoader.loadClip(infostruc[num].httpType+infostruc[num].art, newLoad.art);
        mc.onLoadError = function() {
            if (infostruc[this.number].onArtError) {
                root[infostruc[this.number].onArtError]();
            }
            infostruc[this.number].loaded = true;
            loadNext();
        };
        mc.onLoadInit = function(target:MovieClip) {
            if (infostruc[this.number].onArtLoad) {
                root[infostruc[this.number].onArtLoad]();
            }
            tw = target._width;
            ty = target._height;
            if (_CDProportions == "auto") {
                if (target._width>=target._height) {
                    target._width = Math.min(frontCDWidth, target._width);
                    target._yscale = target._xscale;
                } else {
                    target._height = Math.min(frontCDHeight, target._height);
                    target._xscale = target._yscale;
                }
            }
            root["_frontCDWidth"+this.number] = Math.min(frontCDWidth, target._width);
            root["_frontCDHeight"+this.number] = Math.min(frontCDHeight, target._height);
            target._width = tw;
            target._height = ty;
            root["_bmd"+this.number] = new BitmapData(target._width, target._height, transparent, 0x00FFFFFF);
            root["_ref"+this.number] = new BitmapData(target._width, target._height, transparent, 0x00FFFFFF);
            root["_bmd"+this.number].draw(target);
            if (reflect) {
                var mc:MovieClip = target._parent.createEmptyMovieClip("gradient_mc", target._parent.getNextHighestDepth());
                var gradient_target:MovieClip = mc.attachMovie(maskImage, "mask", 1);
                gradient_target._width = tw;
                gradient_target._height = ty;
                gradient_target.cacheAsBitmap = true;
                target._parent.cacheAsBitmap = true;
                if (transparent) {
                    target._parent.setMask(gradient_target);
                }
                root["_ref"+this.number].draw(target._parent);
            }
            infostruc[this.number].loaded = true;
            if (_CDProportions == "auto") {
                if (target._width>target._height) {
                    target._width = Math.min(shelveCDWidth, target._width);
                    target._yscale = target._xscale;
                } else {
                    target._height = Math.min(shelveCDHeight, target._height);
                    target._xscale = target._yscale;
                }
            }
            root["_shelveCDWidth"+this.number] = Math.min(shelveCDWidth, target._width);
            root["_shelveCDHeight"+this.number] = Math.min(shelveCDHeight, target._height);
            target._parent.removeMovieClip();
            updateInfo();
            loadNext();
        };
    }
}
xmlData.onLoad = function(success:Boolean):Void  {
    if (success) {
        variableSetup["artlocation"] = ["art", null];
        variableSetup["trackname"] = ["info", unknownSong];
        variableSetup["artist"] = ["auth", unknownArtist];
        variableSetup["albumname"] = ["album", unknownAlbum];
        variableSetup["httptype"] = ["httpType", "./"];
        variableSetup["linkto"] = ["urlToGet", undefined];
        variableSetup["linktarget"] = ["urlAction", undefined];
        variableSetup["onclickfunction"] = ["onClick", undefined];
        variableSetup["ondoubleclickfunction"] = ["onDoubleClick", undefined];
        variableSetup["onartload"] = ["onArtLoad", undefined];
        variableSetup["loaded"] = ["loaded", false];
        variableSetup["onarterror"] = ["onArtError", null];
        for (var i:Number = -1; this.childNodes[0].childNodes[++i]; ) {
            var nLen:Number = this.childNodes[0].childNodes[i].childNodes.length;
            var cNode:XMLNode = this.childNodes[0].childNodes[i].childNodes;
            var tmp:Object = {};
            for (var j:Number = 0; j<nLen; j++) {
                v = cNode[j].childNodes[0].nodeValue;
                tmp[variableSetup[cNode[j].nodeName.toLowerCase()][0]] = v.length ? unescape(v) : variableSetup[cNode[j].nodeName][1];
            }
            infostruc.push(tmp);
            transparent = this.firstChild.attributes.useTransparancy == "true";
            maskImage = this.firstChild.attributes.maskImage;
            reflect = this.firstChild.attributes.showReflections == "true";
            onPlaylistLoad = this.firstChild.attributes.onPlaylistLoad;
            isSliding = this.firstChild.attributes.startSliding == "true";
            root["_frontCDWidth"+i] = frontCDWidth;
            root["_frontCDHeight"+i] = frontCDHeight;
            root["_shelveCDWidth"+i] = shelveCDWidth;
            root["_shelveCDHeight"+i] = shelveCDHeight;
        }
        setSlideShow();
        root[onPlaylistLoad]();
        init();
        loadStat = "dupa";
    } else {
        loadStat = "There was an error loading that data, sorry.";
    }
};
function onArtErrorPreview():Void {
    trace("onArtError called =]");
}
function onArtLoadPreview():Void {
    trace("onArtLoad called =]");
}
function onPlaylistLoadPreview():Void {
    trace("onPlaylistLoad called =]");
}
function onClickPreview():Void {
    trace("onClickFunction called =]");
}
function onDoubleClickPreview():Void {
    trace("onDoubleClickFunction called =]");
}
i1.onPress = function():Void  {
    loadPlayList("./XML/albuminfo.xml");
};
i2.onPress = function():Void  {
    loadPlayList("./XML/albuminfo2.xml", 2);
};
i3.onPress = function():Void  {
    loadPlayList("./XML/albuminfo3.xml", 5);
};
xmlData.ignoreWhite = true;
loadPlayList("./XML/albuminfo.xml");
loader._visible = false;
mask._alpha = 0;
scrollBar.scroller._y = 0;


uffffffff trochę tego jest, mam nadzieję że będzie pomocna dusza :) )
 
     
^Januszr 



Pomógł: 216 razy
Dołączył: 11 Maj 2005
Posty: 1854
Skąd: Stolyca od urodzenia
Wysłany: Sro 22 Wrz, 2010 10:43   

Ja bym popróbował z tym:
Stage.align = "MC";

wedle tej instrukcji:
http://help.adobe.com/pl_...StageAlign.html

Ale tak na dobrą sprawę to ja nie znam się... I przyznam, że wartość MC do Stage.Align jest dla mnie conajmniej niezrozumiała...

Zawsze też warto po prostu wyszukać frazę STAGE i pozamieniać albo usunąć linie i popatrzeć co wyjdzie.
_________________
Niestety używam nieoficjalnych wersji Swish, które można zassać z forums.swishzone.com - jest na szczycie listy w BugsForum.
 
     
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

SWiSH - Create Flash animaton the easy way

Powered by phpBB modified by Przemo © 2003 phpBB Group
Nowe zasady dotyczące cookies. Wykorzystujemy pliki cookies, aby nasz serwis lepiej spełniał Państwa oczekiwania. Można zablokować zapisywanie cookies, zmieniając ustawienia przeglądarki.
         
Strona wygenerowana w 0.32 sekundy. Zapytań do SQL: 15