I’ve discovered a few interesting quirks of text fields while I’ve been working with Flash lately and want to share one with you (I’ll share the other in a later post). While working with TextField objects, I noticed that a carriage return is appended to any value that is entered into a text field in the Flash IDE. However, this is not so when the text property of the TextField object is modified with ActionScript. Essentially, this adds an unexpected character to text fields created in Flash’s IDE that have not been modified with ActionScript, which can cause confusion if you are using ActionScript to work with text fields that have been placed on the stage.
Continue reading ‘Flash text fields have extra newlines/carriage returns (”\n” and “\r”)’ »
Something I discovered a while ago has popped up in one of my old projects and I decided to share what I found. My Virtual Cube application, which renders 3D interactive virtual Rubik’s cubes, uses ActionScript’s Timer class to create a timer to keep track of how long it takes a user to solve a scrambled cube. While using the application, I noticed the timer running slower while using the 5×5x5 cube and faster with the 2×2x2 cube. What would be three seconds while using the small cube would be six or seven seconds for the large cube.
What was happening was the frame rate was slowing down because the Sandy 3D engine (an ActionScript 3D engine I use to render the 3D Rubik’s cubes) was taking longer to render the more complex (5×5x5) cube and all of its “cubies” that rotate. But what makes it rather odd was that this slowdown in frame rate was affecting the timer the user saw in the application. Because Flash had to work harder, and longer, to display the more complex cube every frame it would take that much longer for my TimerEvent.TIMER event to dispatch and update my timer in the user interface.
Continue reading ‘ActionScript Timer class seem offset/inaccurate/way off? It is!’ »