闪光/动作:如何当一个较大的装载到中心较小的SWF?较小、闪光、较大、动作

2023-09-08 11:53:41 作者:被作业虐的人

我想提出一个互动的故事书项目给了这些说明:

I am making an interactive storybook project given these specifications:

我的书有13页,其中从外部加载到书SWF 1页= 1瑞士法郎。正如你可以看到,页面的swf必须在2个按钮,它们都100x450每间中心的研究。每当我尝试加载SWF,通常它在某个时候切断。

My book has 13 pages, where 1 page = 1 swf loaded externally into the book swf. As you can see, the page swf must be centered in between the 2 buttons that are both 100x450 each. Whenever I try to load the swf, usually it's cut off at some point.

总之,我如何集中我的外部SWF加载的时候?

In short, how do I center my externally swf when loaded?

推荐答案

请在completeHandler功能就像给波纹管

Make the completeHandler Function like given bellow

function completeHandler(event:Event):void{         
    this.container.addChild(event.target.content);
    this.container.x = this.stage.stageWidth/2 - event.target.width /2;
    this.container.y = this.stage.stageHeight/2 - event.target.height /2;           
}

U可以改变this.stage.stageWidth与中心容器的宽度和适用相同的宽度也

U can change this.stage.stageWidth with the center container width and apply same for width also