2009-11-07 2 views
0

플래시에서 AS3 (http://designreviver.com/tutorials/create-an-interactive-stack-of-photos/)을 사용하여 사진 스택을 만드는 방법에 대한 자습서를 찾았습니다. 사진의 스택 AS3 - 간단한 것만 붙임

나는 사진 스택의 동적 XML 버전을 만들기 위해 노력하고 난 분명히 문제 (:) 나는 폴라로이드라는 클래스가

있고, 메신저에 그것의 여러 인스턴스를 추가하는 루프를 사용하여 무대로 다음 : 다음 사진을 슬라이드하고 폴라로이드의 다른 모든 인스턴스 뒤에가는 있도록 인덱스를 변경하는 두 가지 기능을 사용

function processXML(e:Event):void { 
    var myXML:XML=new XML(e.target.data); 

    my_images=myXML.IMAGE; 
    my_total=my_images.length(); 
    photoCount=my_total; 

    for (var i:Number = 1; i <= my_total; i++) { 
     imageNo=i; 
     this.addChild(new polaroid ).name="photo"+imageNo; 
     this.getChildByName("photo"+imageNo).addEventListener(MouseEvent.MOUSE_DOWN, photoSlideOut); 
     this.getChildByName("photo"+imageNo).rotation = Math.floor(Math.random()*(rotationRange*2))-rotationRange; 
    } 
} 

.

function photoSlideOut(e:Event):void { 
    e.target.parent.setChildIndex(e.target, e.target.parent.numChildren - 1); 
    Tweener.addTween(e.target, {x: photoDestX, time: speed, transition: easeType, onComplete:photoSlideIn, onCompleteParams:[e.target]}); 
    Tweener.addTween(e.target, {rotation: Math.floor(Math.random()*(rotationRange*2))-rotationRange, time: speed*2, transition: easeType}); 
} 
function photoSlideIn(p:MovieClip):void { 
    p.parent.setChildIndex(p, 0); 
    Tweener.addTween(p, {x: photoOriginX, time: speed, transition: easeType}); 
} 

는 photoSlideOut 잘 작동하는 것 같군 및 photoslidein의 트윈 노력하고 있습니다 - 그래도 난 클릭 된 폴라로이드의 인스턴스의 자식 인덱스를 변경하는 것 캔트.

누구나 내가 여기서 잘못 가고있는 생각이 있습니까?

도움을 주시면 감사하겠습니다.

답변

0

target 대신 currentTarget을 사용해보십시오.