如何向现有 Flash 应用程序添加缩放功能?
我有一个 Flash 应用程序,其中包含一个场景、三个帧和一堆 ActionScript 代码,以提供许多ExternalInterface 挂钩。这三个框架包含一个输入文本框,当使用 JavaScript 调整 标签的大小时,该输入文本框会增大和缩小(而不是缩放)以适应。
我现在想要添加放大/缩小此应用程序的功能,以便在不增加文本点大小的情况下放大屏幕上的小文本。我认为使用 Flash 对象的 Javascript Zoom(percent)
方法会很容易,但这不起作用,因为我的 ActionScript 代码包含:
Stage.align = "TL";
Stage.scaleMode = "noScale";
我怀疑我需要按照我的方式拍摄整部电影现在,并将其放入影片剪辑中,添加一个缩放ExternalInterface调用,以某种方式缩放影片剪辑,并将我现在拥有的外部接口方法从新的影片剪辑外部移动到舞台......但这听起来像是一个接近完整的过程改写?这个方法还能用吗?有更好的办法吗?
如果我能以任何方式澄清这个问题,请提问!我是 JavaScript 专家,不是 Flash 专家! :-)
I have a Flash application with one scene, three frames and a bunch of ActionScript code to provide a number of ExternalInterface hooks. The three frames contain a single Input Text box which, as the <embed>
tag is resized using JavaScript, grows and shrinks (not scales) to fit.
I now want to add the ability to zoom in/out of this application, for enlarging small text on screen without increasing the text point size. I thought this would be easy using the Javascript Zoom(percent)
method of the Flash object, but this doesn't work because my ActionScript code contains:
Stage.align = "TL";
Stage.scaleMode = "noScale";
I suspect I need to take the entire movie as I have it now, and put it inside a movie clip, add a zoom ExternalInterface call which somehow scales the movieClip, and move the External Inteterface methods I have now from the new Movie Clip outside to the stage... but this sounds like a near complete rewrite? Will this method even work? Is there a better way?
If I can clarify the question in any way, please ask! I'm a JavaScript expert not a Flash expert! :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您需要一个 vcam:
http://bryanheisey.com/blog/?p=1
它基本上是一个可调整的矩形,仅显示其边界内的内容。您可以将其放大或缩小以放大和缩小。您只需连接一个 actionListener 即可使其根据滚轮事件或某些按钮按下进行缩放。
如果您需要更多帮助,请告诉我。
I think that you want a vcam:
http://bryanheisey.com/blog/?p=1
It's basically an adjustable rectangle that only displays to screen what's inside of its boundaries. You can make it larger or smaller in order to zoom in and out. You could just wire up an actionListener to make it scale based on a scroll wheel event or some button press.
If you need more help, just let me know.