简体   繁体   English

如何动态地向时间轴添加帧?

[英]how to add frames to timeline dynamically?

hate to ask but I actually need to dynamically add 240 frames to a pure AS3 project and then a stop frame on the last frame. 讨厌问,但我实际上需要动态添加240帧到纯AS3项目,然后在最后一帧上停止帧。

Yes we're back in 2009. 是的,我们回到了2009年。

Why? 为什么?

Because the dynamic, class driven PureAS3 application I've build (swf) is being delivered to a different media owner who's inhouse system (I kid you not) checks all Flash for 10 seconds of frames(hence 240) AND checks for a 'stop();'. 因为我构建的动态,类驱动的PureAS3应用程序(swf)正被传递给内部系统的不同媒体所有者(我小时候你不会)检查所有Flash 10秒的帧(因此240)并检查'停止' ();”。

Any help greatly received - I'm assuming this is possible but drawing a blank online - mainly lots of people (rightly so) advising again using the timeline. 任何帮助都很受欢迎 - 我假设这是可能的,但在网上画一个空白 - 主要是很多人(正确地说)使用时间线再次建议。

Rich 丰富

I personally think if you're not leveraging the timeline, you're working too hard. 我个人认为,如果你没有利用时间表,你就会努力工作。 Just all the drudgery involved in positioning and sizing things that you can just put on stage feels like a massive waste of time. 只是所有涉及定位和尺寸调整的苦差事都可以放在舞台上,感觉就像是浪费大量时间。 I think it's a shame Adobe was so focused on Flex during the release of Flash 9 that they never showed people how to keep the timeline and still have a nice class-based architecture. 我认为Adobe在Flash 9发布期间如此专注于Flex是一种耻辱,他们从未向人们展示如何保持时间轴并仍然拥有一个很好的基于类的架构。 But that's water under the bridge and you have what you have. 但那是桥下的水,你拥有你拥有的东西。

Have you tried just extending the timeline and putting a stop() frame script at the end? 您是否尝试过延长时间轴并在最后放置一个stop()帧脚本? If there's nothing on the stage anyway, adding more frames of nothing shouldn't cause an issue, nor should stopping at the end of nothing. 如果舞台上没有任何东西,那么添加更多的无框架不应该引起问题,也不应该在任何结束时停止。

Another thing you could try is having a main timeline with a stop() on frame 1. On frame 1 put a MC that has the Class you are currently using as your Document Class assigned as its Class. 您可以尝试的另一件事是在主框架1上有一个带有stop()的主时间轴。在第1帧上放置一个MC,它具有您当前使用的Class作为其Class类的文档类。 As long as you haven't done anything weird where Classes are reaching up to root or trying to know about things they shouldn't, that should also work. 只要你没有做过任何奇怪的事情,那些类正在达到root或试图了解他们不应该做的事情,那也应该有效。

Create a new SWF as a wrapper, with those 240 frames on its main timeline, the 241st frame should contain a stop() call and an instance of your project's Main class. 创建一个新的SWF作为包装器,在其主时间轴上有240帧,第241帧应包含stop()调用和项目Main类的实例。 This SWF should be validated with whatever engine they have, but retain all the functionality of your pure AS-driven project. 该SWF应该使用他们拥有的任何引擎进行验证,但保留纯AS驱动项目的所有功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM