闪光/动作:如何当一个较大的装载到中心较小的SWF? [英] Flash/ActionScript: How to center smaller swf when loaded in a larger one?

查看:102
本文介绍了闪光/动作:如何当一个较大的装载到中心较小的SWF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

这篇关于闪光/动作:如何当一个较大的装载到中心较小的SWF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆