The last few days I’ve been busy converting my Bulletstorm Point System to Scaleform, and one of the things I’ve had to do is dynamically spawn instances of a symbol, set their position/scale/alpha/etc., and attach them to the HUD.
For the longest time I tackled one major problem: the dynamic point messages that were supposed to pop up weren’t popping up. I tried everything I could, searched all the forums, checked my code a million times, and I still couldn’t figure out why they seemed to be completely invisible. I was about to give up.
Then it dawned on me. When you dynamically spawn an instance of a symbol and set its position, the position is set relative to the symbol’s local origin (that little hollow circle in Flash), NOT the global stage position (with 0,0 in the top left corner). This poses a major problem if the original instance is off the screen because when the new position is set, it will be set relative to this off-screen location and will still be off the screen (in other words, completely invisible).
Sticking dynamic objects out of the frame is a common Scaleform practice because you don’t want to see them at runtime, before they can be initialized. For example, in the UDK menus the cursor is off the screen to the left, safely out of view. I thought it would be okay to just dump my Bulletstorm message symbol off the frame, but I was wrong.
What you actually want to do is set the symbol’s location to (0,0), so that the little circle is directly over the scene’s top left corner. If parts of the symbol still stick into view, just set its visibility to false; you can always change it later once you set the correct position in UnrealScript. Now with the idea of local/global settings in mind, hopefully you can avoid this nasty Scaleform pitfall.