How exactly would i remove a Button from the actionBar “actionContent” in a flex mobile app?
I tried these:
this.stage.removeChild(menu_btn);
this.removeChild(menu_btn);
stage.removeChild(menu_btn);
this.stage.removeElement(menu_btn);
this.removeElement(menu_btn);
stage.removeElement(menu_btn);
I’m not having any luck with those. Im guessing where it is located in the actioncontent isn’t considered the stage. Any ideas?
<s:actionContent>
<s:CalloutButton id="menu_btn" icon="@Embed('assets/images/menu/menu_btn.png')" visible="false">
<s:VGroup>
<s:Button id="btn_one" label="Button" />
</s:VGroup>
</s:CalloutButton>
</s:actionContent>
The actionContent is setup like that, I know like with most mxml stuff I could give it an ID to reference it but im not sure how how to give the action content an id number <s:actionContent id="testID"> does not work. So how can i access this to remove it? making it invisible isn’t cutting it i need to actually remove it.
Being that
actionContentis a property of the ActionBar, it already is the “id” of an object, namely an Array. Try using anArraymethod to remove it. For instance, you could useactionContent.pop()if the thing you want to remove is the last element. Or use splice():which will remove the element from the Array.