Some of my legacy Flex applications use onEnterFrame to manage animations and interactions (like whether the spacecraft hits the asteroid in a game). I want to migrate some of this material to Apache Royale. Is there an equivalent of onEnterFrame in Apache Royale, which compiles to JavaScript rather than to a Flash movie? I believe JavaScript does not have an equivalent of a Flash movie's timeline.
Apache Royale offers a choice of component sets. Royale has support for many Apache Flex APIs, but not many Adobe Flash APIs because there is no timeline as you mentioned.
EnterFrame
events are used for many things as you mentioned and what the right replacement is for your app will depend on what you are using that event for.
If your usage of enterFrame
was to run some code every once in a while then:
org.apache.royale.utils.Timer
enterFrame
supported on the Application. EnterFrame
is technically a Flash API, but it should be easy enough to add support for enterFrame
events and tie it to a Timer.If you are using enterFrame
to synchronize application code with animations then you will need to understand how those animations are going to work in the browser and use whatever update mechanism your animations use.