软硬度:不可能调整外部加载的SWF内容 [英] Flex: Impossible to resize the external loaded SWF's content

查看:275
本文介绍了软硬度:不可能调整外部加载的SWF内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我尝试加载外部SWF的应用程序。所以,我们有:

I have an application where I try to load an external SWF. So, we have:

  • 在我的应用程序:舞台的尺寸是768x1280。的ScaleMode = EXACT_FIT。
  • 外部SWF:这是另一种应用程序,其中的阶段是:800×600。的ScaleMode = EXACT_FIT。

现在的问题是,外部SWF不会修改它的大小,虽然我申请的scaleX,的scaleY,改变其宽度等。 我也试图将其插入到Canvas容器(如如何调整外部SWF以适应集装箱?),但它并没有解决我的问题。 当外部SWF是我的应用程序加载的有趣的一块code是:

The problem is that the external SWF does not modify its size although I apply "scaleX, scaleY", change its width and so on. I also tried to insert it into a Canvas container (as "How to resize an external SWF to fit into a container?" ) but it didn't solve my problem. The interesting piece of code is when the external SWF is loaded by my application:

private function onLoadedApp( evt:Event ):void{ 
     stage.scaleMode = StageScaleMode.EXACT_FIT;    
     trace("Loading Application..");           
     var loaderInfo:LoaderInfo = evt.target as LoaderInfo;    
     loaderInfo.removeEventListener( Event.COMPLETE, onLoadedApp);   
     trace(loaderInfo.loader.content);           
     var swfApplication:SpriteUIComponent = new SpriteUIComponent(evt.target.loader.content );           
     if( SWFContainer.width < swfApplication.explicitWidth ){               
            var coef:Number = SWFContainer.width/swfApplication.explicitWidth;  
            swfApplication.scaleX = coef; 
            swfApplication.scaleY = swfApplication.scaleX;            
      }                
       SWFContainer.addElement(swfApplication);
}

我也尝试过的SWFLoader做到这一点,但external.swf的内容不会改变其原来的尺寸,虽然我添加了scaleContent参数。

I also tried to do it through SWFLoader, but the external.swf's content doesn't change its original size although I add the "scaleContent" parameter.

视觉效果我:

的外部SWF装载在合适的位置,并将其似乎有320×240暗淡。但是,它的宽度是有点裁剪,因为如果我舒展的Flash播放器我实现看外部SWF的阶段的其余部分。此外,外部SWF从来没有被调整,虽然我收缩/拉伸Flash播放器。它总是保持不变(如果我跟踪它的尺寸,我总是得到800×600,虽然我直观地看到320×240) - 如果我增加了舞台的宽度主要的应用程序,这个小夹子dissapear。

The external SWF is loaded on the suitable position and it "seems" to have 320x240 dim. But its width is a bit cropped, since if I stretch the Flash Player I achieve to see the rest of the external swf's stage. Besides, the external SWF never is resized although I shrink/stretch the Flash Player. It always remains fixed (if I trace its dimensions, I always get 800x600, although I visually see 320x240)- If I increase the stage's width of the main application, this little clip dissapear.

作者:

我才知道,原来舞台上的尺寸是800,这是比我的应用程序(768)的原始阶段,但我想,当我做大小调整,外部SWF的舞台都要装在容器中。它被装配,但外部SWF的一部分是没有看到。这就像Flash播放器记住的是,外部SWF舞台的宽度均大于我的应用程序的之一... ...

I know the original Stage's dimensions are 800, and this is greater than the original stage of my application (768), but I think, when I do the resizing, external SWF's Stage have to be fitted in the container. It is fitted, but a part of the external SWF is not seen. It's like Flash Player remembered that the external SWF Stage's width were greater than my application's one...

在此先感谢。

推荐答案

您是否尝试过使用上的外部SWF规模效应?

Have you tried to use a scale effect on "External SWF"?

<一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/effects/Scale.html#includeExamplesSummary"相对=nofollow>规模效应

这篇关于软硬度:不可能调整外部加载的SWF内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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