2011-11-07 3 views
-1

하이 swf (video.swf) 안에 swf (text.swf)를로드하려고했습니다. 내 (text.swf)에서 text.swf를 일부 통과 시켰습니다. (text.swf) Changed.Without 내용 변경 어떻게 (text.swf) 크기를 조정할 수 있습니까? 사실 text.swf 내 크기가 400 * 44px.If 혼자 text.swf 크기를 실행할 경우 작습니다,하지만 내가 추가 할 때 (video.swf) 매우 큰 text.chat의 크기. 그래서 난 단지 text.swf의 크기를 조정하지만? (text.swf) 안에 내용도 변경되었습니다. 어떻게이 문제를 해결할 수 있습니까? 아무도 도와주세요Swf 내부의 Swf 크기를 조정하는 방법은 무엇입니까?

감사합니다 여기에 미리 내 코딩

 _loader.load(new URLRequest("text.swf")); 
    _loader.x=(((_stage.stageHeight)/100)*0.1); 
    _loader.y=(((_stage.stageWidth)/100)*49); 
    _loader.height=((_stage.stageWidth)/25); 
    _loader.width=(((_stage.stageWidth))); 

    mainContainer.addChild(_loader); 
+1

을이 -1 왜, 유 넣으면 -1 내 질문이어야 이유는 무엇 설명을 줘? – Mercy

답변

1

다음 번에 질문 텍스트의 서식을 지정하십시오 (일부 줄 바꿈을 추가하고 뒤에. 제출하기 전에 미리보기에서 어떻게 보이는지 확인하십시오).

아마 다음 코드는 당신을 도울 수 있습니다

/** 
* Reset text to original scale 
*/ 
function resetTextScaling(aContainer: DisplayObjectContainer): void 
{ 
    for(var index: int = aContainer.numChildren; index--;) 
    { 
    var child: DisplayObject = aContainer.getChildAt(index); 
    if (child is TextField) 
    { 
     var parentMatrix: Matrix = child.parent.transform.concatenatedMatrix; 
     // calc area of child as visible 
     var childWidth: Number = child.width * parentMatrix.a/child.scaleX; 
     var childHeight: Number = child.height * parentMatrix.d/child.scaleY; 
     // restore original font size 
     child.scaleX /= parentMatrix.a; 
     child.scaleY /= parentMatrix.d; 
     // resize child so it still uses the same area 
     child.width = childWidth; 
     child.height = childHeight; 
    } 
    else if (child is DisplayObjectContainer) 
    { 
     // process children 
     resetTextScaling(child as DisplayObjectContainer); 
    } 
    } 
} 

// make this call after _loader has been added to the stage 
// and has completed loading 
resetTextScaling(_loader); 
+0

나는 이것이 작동하지 않는 코딩을 시도했다. – Mercy

관련 문제