Flash 中的动态对象布局
我有一个一般性的 Flash 问题。我有 2 个 .SWF 包装器(Playbook 和 Android,工作完美),可以接受任何 .SWF 文件并将其包装为应用程序。我希望制作 1 个应用程序并使其在 Blackberry Playbook 和任何 Android 设备上运行。从技术上讲,一切都很完美,但我遇到的问题是布局。
例如,如果一个对象放置在 x= 512 y=400 处,那么它在 Playbook 上看起来很棒,但在不是 1024x800px 的 Android 屏幕上看起来很糟糕。我想要做的是类似 (x=DeviceWidth/2), (y=DeviceHeight/2) 的操作,以便它自动调整大小和重新定位。下面显示了我需要更改代码的示例
bt1.tween("_y", 400, 0.5, "easeOutBack");
这可能吗?如果是的话,其语法是什么?或者我在哪里可以找到此信息?
感谢您的帮助
问候
I have a general Flash question. I have got 2 .SWF wrappers (Playbook and Android,that work perfectly) that takes any .SWF file and wraps it up as an application. I'm hoping to make 1 application and have it run on both the Blackberry Playbook and any Android device. Technically everything is perfect but the problem I am having is with the layout.
For example if an object is placed at x= 512 y=400 then it looks great on the Playbook but that looks horrible on an Android screen thats not 1024x800px. What I want to be able to do is something like (x=DeviceWidth/2), (y= DeviceHeight/2) so that it resizes and repositions itself automatically. An example of where I need to change the code is shown below
bt1.tween("_y", 400, 0.5, "easeOutBack");
Is this possible? If so what is the syntax for this or where can I find this info?
Thanks for your help
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Flextras 说的是对的,您可以重写 updateDisplayList 函数来计算内容应该去哪里,但您正在尝试使用补间(我不确定为什么)。如果您将其包含在组或任何其他基于绝对的容器中,则还可以使用绝对居中(horizontalCenter=0、verticalCenter=0),但它对补间没有帮助。
在你的情况下,你可能想要做这样的事情:
What Flextras said is right, you can override the
updateDisplayList
function to calculate where things should go, but you're trying to use a tween (which I'm not sure why). You can also use absolute centering (horizontalCenter=0, verticalCenter=0) if you have it contained within a Group or any other absolute based container, but it won't help with the tween.In your case, you'll probably want to do something like this: