缩放 Flash 中的图像以匹配 html 中定义的大小
我有一个 Flash 影片,可以从 xml 文件动态加载图像。 我想在不同页面上重复使用此 .swf 文件,但是第 1 页上的图像均为 400 x 200,第 2 页上的图像均为 745 x 422。当我尝试在另一个页面上重复使用此文件时,加载的图像会缩小(调整大小)-我希望它们匹配宽度/高度中定义的内容,但它们会根据舞台的缩放方式进行缩放。
我使用加载器(AS3)作为将它们放置在容器(精灵)上的图像,
slideLoader.load(new URLRequest(xmlSlideshow..image[intCurrentSlide].@src));
我尝试过使舞台大小不同来启动,但我真的希望它尽可能无关紧要 - 即:50 x 50。 html 的宽度/高度将设置为正在加载的图像的宽度/高度。
我不是闪存向导,所以如果我不清楚,请原谅我,如果需要,我会尽力提供更多见解。
I have a flash movie that loads images dynamically from an xml file. I want to re-use this .swf file on different pages, however the images on page1 are all 400 x 200 and the images on page2 are all 745 x 422. When i try to reuse this on another page, the loaded images are shrunken (resized) - i would like them to match whats defined in the width/height, but they get scaled depending on how the stage is scaled.
im using a loader (AS3) for the image that places them on a container(sprite)
slideLoader.load(new URLRequest(xmlSlideshow..image[intCurrentSlide].@src));
I have tried making the stage various sizes to start, but i would really like it to be irrelavant if possible - ie: 50 x 50. Then in html the width/height would be set to the width/height of the images being loaded.
Im not a flash wizard so please forgive me if im not clear, i'll try to give more insight if needed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
抱歉,我手头没有代码,但我知道您可以选择在启动时在画布上设置不调整大小。
理想情况下,您可以通过嵌入标签的属性传入高度/宽度,在画布上不调整大小并使用传入的尺寸来设置图像尺寸。
I apologize I don't have the code at hand, but I know you have the option to set a no-resize on the canvas at startup.
Ideally, you can pass in the height/width via the attributes of the embed tag, have a no resize on the canvas and use the passed in dimensions to set your image dimenions.
我相信就是这样:
I believe this is it:
有几件事......首先,您需要指定您的应用程序不可扩展。 (AS3 代码)
然后,一旦加载图像(向 SlideLoader 对象添加侦听器),就使用 flash 的ExternalInterface 类执行 javascript 函数。
你的 javascript 函数将是这样的:
Couple of things... firstly you'll need to specify your app not to scale. (AS3 code)
Then once your image is loaded (add a listener to the slideLoader object), execute a javascript function using flash's ExternalInterface class.
And your javascript function would be something like this: