Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You're using the right conceptual approach. However, elements in a group (or VGroup or HGroup) must implement <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/IVisualElement.html" rel="nofollow">IVisualElement</a>, which neither <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Sprite.html" rel="nofollow">Sprite</a> nor <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html" rel="nofollow">TextField</a> implement.</p> <p>You have a few options to consider:</p> <ol> <li>Use a <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/core/SpriteVisualElement.html" rel="nofollow">SpriteVisualElement</a> instead of a Sprite; or use a <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/supportClasses/StyleableTextField.html" rel="nofollow">StyleableTextField</a> instead of a TextField. </li> <li>Wrap up the Sprite or TextField as a child of UIComponent; then use that UIComponent as the element in the group. </li> <li>Use MX Containers, such as HBox or VBox. </li> <li>Use a UIComponent instead of a Group. You'll have to write your own layout code in updateDisplayList() for this to work.</li> </ol> <p>My preference is the first approach, followed by the fourth approach. Approach 2 adds a lot of extra coding, and approach 3 is undesirable due to the dependency on the MX/Halo architecture.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload