How to dynamically duplicate an item on the stage

Hello,
I have a box (lets call it 'xBox') on the stage that contains
a couple comboboxes and buttons.
One of the buttons (labelled 'add new search feature') when
clicked will duplicate the whole box 'xbox' and give it a new
unique name that can be referenced. So, now there would be two
boxes on the stage that look exactly the same.
You can click the 'add new search feature' button repeatedly
and each time a new 'xbox' will appear at the bottom below the
previously created 'xbox's....
I have played with states some, but am unsure how that would
apply to an infinite amount of new 'xbox's being created.
Is this possible? Any help is greatly appreciated.
here is the code:
<mx:Box direction="horizontal" borderStyle="solid"
paddingTop="10" paddingBottom="10" paddingLeft="10"
paddingRight="10">
<mx:ComboBox id="xField" width="100%">
<!-- An inline data provider -->
<mx:Array>
<mx:Object data="0" label="Yards gained" />
<mx:Object data="1" label="Shotgun" />
<mx:Object data="2" label="TD" />
<mx:Object data="3" label="Down" />
<mx:Object data="4" label="Leading" />
<mx:Object data="5" label="Quarter" />
<mx:Object data="6" label="Turf/grass" />
<mx:Object data="7" label="Stadium type" />
<mx:Object data="8" label="Home" />
<mx:Object data="9" label="Opponent" />
<mx:Object data="10" label="Month" />
<mx:Object data="11" label="Season" />
</mx:Array>
</mx:ComboBox>
<mx:ComboBox id="argument" width="100%">
<!-- An inline data provider -->
<mx:Array>
<mx:Object data="0" label="Equals" />
<mx:Object data="1" label="is greater" />
<mx:Object data="2" label="is less" />
<mx:Object data="3" label="is not" />
</mx:Array>
</mx:ComboBox>
<mx:TextInput id="enter_data"/>
<mx:Button label="Search"/>
<mx:Button label="Add new Search Feature"/>
</mx:Box>

Okay, what you want to do is, make a custom component out of
the xBox. Then in your main application you wan to make an array of
objects. Every time the button (to add xBoxes) is clicked add one
to the array, then also add it to the main app's list of children.
You want to add it to the array so that you can still reference it.
Try something like this:
import xBox;
import mx.collections.ArrayCollection;
private var xBoxArray : ArrayCollection = new
ArrayCollection();
private var location : int = 1;
private function buttonClickHandler() : void
var temp : xBox = new xBox ();
xBoxArray.addItemAt ( location, temp );
whereYouWantTheXBoxesToGo.addChildAt ( location,
xBoxArray.getItemAt ( location ) );
<mx:Button click="buttonClickHandler()"
label="More xBoxes" id="360" />
<mx:Box id="whereYouWantTheXBoxesToGo"/>
<!--
-->
This is just a rough guide of what to try. But something like
this should work.

Similar Messages

  • How can i delete purchased items from the cloud in iTunes

    how can i delete purchased items from the cloud in iTunes

    I had this problem as well. You can't delete them but you can hide them by swiping across from the cloud to. The other side then pressing hide

  • How to delete a line item from the sales order

    Hi all,
    how to delete a line item from the sales order for which the production is already happened and it has been delivered. the production order status is DLV.
    Regards
    Kumar

    Hi
    U can do this in two ways one u can short close the order by entering Reason for rejection in VA02 at header level and if yr order is multiple line item order u can enter the reason for rejection in any of the line item which u don't want to deliver.
    This is called short close ( as the qty is not delivered fully).
    Thx.

  • Is it possible to duplicate an item in the project panel with scripts?

    Hey  all, I'm trying to make a script that will duplicate an item in the project panel. I know you can duplicate an item in a comp, but I'd like to duplicate a project Item...app.project.item(2).duplicate();
    Something like that, is it possible with some other coding to do that?
    Thanks

    Dave, I'm trying to duplicate in a script running inside AE.  I guess I could try to do a system command to duplicate, but I'd really like to do it inside AE so I can keep track of the new layer.

  • How do I delete an item in the sidebar - iPhoto 11

    How do I delete an item on the iPhoto 11 sidebar?

    If they are listed under Albums, Projects or Slideshows just click on them and use the Delete key.  All other items , i.e under Library, Recent and Web can't be deleted.  However, if you hover the cursor to the right of Web or Recent you can hide them:
    OT

  • How do I duplicate an image on the main screen so that I can edit it and compare the result with the original?

    In Elements 12 How do I duplicate an image on the main screen (as well as the photo bin) so that i can compare any editing with the original?

    In full Editor, go to Edit>Preferences>General and check "Allow Floating Documents in Full Edit Mode"
    Open the image so that you see it in the project bin
    Right click the image thumbnail in the project bin, and duplicate. It will come in as xxxcopy
    On the Arrange icon at the top, select 2-up. You should see the original and the duplicate in the work area

  • How do I remove Completed items from the Completed Reminders List? The list is growing too long.

    How do I delete Completed items from the Completed Reminders List? The list is growing too long.

    The little box, next to the reminder on the reminder page.  Touch it, and it puts a check mark there, i suppose to mean completed.  Leave the app.  When you go back, the items are gone.  ( at least on mine...)

  • How can I delete all items on the "Done" list in Reminer-App? There are meanwhile hundreds of items (shopping, appoitments, ...) and I don't want to spend hours deleting them.

    How can I delete all items on the "Done" list in Reminer-App? There are meanwhile hundreds of items (shopping, appoitments, ...) and I don't want to spend hours deleting them.

    You can't remove the built-in root certificates, but you can remove their trust bits via the Edit button to prevent Firefox from using them as a trusted root certificate.
    Intermediate certificates that Firefox has stored when visiting websites that show as "Software Security Device" should never has trust bits set.
    Note that it is the responsibility of a server to send all required intermediate certificates to make it possible to build a certificate chain that ends with a built-in root certificate.

  • HT1766 I purchased an iPad air and chose a backup from my iPhone 5s.  The only issue is only 30 of my photos downloaded to my iPad and none of the music.  How can I get all items on the iPad?

    I purchased an iPad air and chose a backup from my iPhone 5s.  The only issue is only 30 of my photos downloaded to my iPad and none of the music.  How can I get all items on the iPad?

    you are using I tunes as the middle man for this back up, right?
    When you plug in the pad to i tunes, give it a unique name, like my pad.  I tune may be thinking it is talking to your phone.  It will keep track of what you what on each device.  Then plug your phone back in, and make sure your photos are uploaded to the computer - in i photo if you are using a mac, or in whatever photo program you are using on a windows device.  You also want to make sure you have uploaded to the computer all of your music.
    Once you get all that stuff there, plug the pad back in, and go through each of the tabs - selecting the music, photos etal that you want on the pad, then resync.

  • How i can call an item that the name of the bloc is a param --URGENT--

    how i can call an item that the name of the bloc is a param
    exp:
    DECLARE
    B VARCHAR2(20);
    begin
    B:='BLOC1';
    :B.Text1:='Hello'; --- a want this

    Looks like your talking 'bout Forms, don't you?
    What you're looking for is the copy built-in, syntax is e.g.
    COPY ('MY TEXT', 'EMP.ENAME');

  • How to exclude non-released items in the COLLECTION_COPY_ALL service call?

    I am using IdcCommand to copy all content items from one folder to another folder (archives folder) on every day.
    # Copy the latest version of the file from source location to target location
    @Properties LocalData
    IdcService=COLLECTION_COPY_ALL
    fromhasCollectionPath=true
    fromdCollectionPath=/Contribution Folders/folderA/
    tohasCollectionPath=true
    todCollectionPath=/Contribution Folders/folderB/
    @end
    <<EOD>>
    But this service also copies the unreleased/unpublished work-items from the workflow with dCollectionPath=/Contribution Folders/folderA/. How can I exclude the non-released items in the COLLECTION_COPY_ALL service call?

    Vipin Pillai wrote:I changes the source and target folders in the hda file dynamically as part of the requirement; these dynamic changes are not possible with Archiver. The archiver option is a complicated way of doing it. Actually that's not correct. It's actually much easier to use Archiver, but it requires some reading.
    You can certainly use dynamic values in Archiver, as the import map value fields are Idoc scriptable - it's just not openly obvious to do this. To illustrate, suppose I have a a custom field called "xSaleDate". I can export items out, and reimport them, applying today's date to the xSaleDate field using <$dateCurrent()$> in the import map field. Historically I tend to create custom components and put very complex logic in a resource include ("myExternalLogic"), and then in Archiver, in the import map just put <$include myExternalLogic$>.
    You can also do the same logic in a profile rule, which is even easier than an import map. Then the auto archiver suggestion becomes very powerful, and way simpler. I've done very many variations of this over the years, and it works well. Again it just requires some reading.

  • When a checkbox is selected with multiple items, how do I display those items at the bottom of a page so that follow-up on checked boxes can occur

    Hi,
    My name is Shawn and I work for Pfizer, an enterprise client of yours. We have thousands of LifeCycle licenses, but I don't know whom to contact to get support so I'm posting my question here.
    I am creating a PDF form that lets the user check a box when the want to select a web metric they need set up for their website. What I'd like to do is, once a user has checked this box (there are over 100), all the boxes they've checked out of the 100 or so metrics pop-up / show up / dynamically generate at the bottom page, and have additional checkboxes next to them for the development teams "eyes only" that they will have to in turn, when the form is emailed to them filled out, select TEST and VERIFY checkbox for each metric showing that they've tested and verified the metric was configured, and then a text field prompting them to say HOW they tested and verified / what method.
    How do I do this using LiveCycle?
    Thanks,
    Shawn

    What you're looking to do is created a dynamic form that changes on the click of a button.  This is done through script, and you have a couple of choices, there are several postings in these forms that provide guidance in this area (instancemanager is used for this dynamic capability).  Your second option is to use action builder and it will provide guidance for you as well.  Click on Tools > Action Builder.  Also depending on what version you have install location/EN/Samples/Forms/Purchase Order/Dynamic Interactive may help.

  • How can I delete an item from the main left column of iTunes?

    I'd like to delete an item from the main left hand column in iTunes (the column containing the main headings LIBRARY, STORE, SHARED, PLAYLISTS etc etc). Under the first heading 'LIBRARY' appear the items Library, Music, Movies, iTunes U, Books, Apps and Ringtones. I'd like to remove the item "Library" from that list - it appears immediately after the heading "LIBRARY" and serves no purpose whatsoever. (Neither does it appear to cause any harm, I must say, just a nuisance.) This item does not appear in any of the iTunes viewing options or controls lists. Neither does it appear in iTunes in the other accounts on my Mac and I have yet to see it any other iTunes on any other Mac.
    I've upgraded since about iTunes 8 assuming the problem would eventually disappear through the upgrades but it hasn’t, even through all the providedupgrade increments available for iTunes.
    I'm assuming it's from something I've installed in my main user account at some stage and it entered this item in the iTunes app. But I can't see how to remove it. The only things I can remember installing are "iTunes Batch Column Renamer" and "Join Together", both if which are just Scripts and which I use fairly regularly, but I don't recall either of them installing that particular item.
    Is there any folder I can navigate to to edit the list of items in that main left hand column of iTunes?
    Many thanks in advance for any help offered.

    on second thought, that you have an item "library" is indeed odd - there shouldn't be.
    suggest you try removing iTunes completely (click here and follow the instructions), then reinstall it using the standalone installer from here: http://www.apple.com/itunes/download/.
    note this will not do anything to your media files, playlists, ratings, etc.
    btw, you didn't install any 3rd party tools like this script:
    Change Hidden iTunes Preferences v2.4 
    This application will allow you to invoke hidden iTunes preferences:
    Show "Library" playlist
    Changing view setting is global
    Allow half-stars in ratings
    Hide "Ping" buttons
    Show/hide arrow links -- to either search the iTunes Store or search your library
    Load complete iTunes Store preview before playing
    Create playlists for purchased song collections
    Play songs while importing or converting
    Create file names with track number
    Maintain grid view for Search results
    Option-click zoom button for Mini Player&
    Show buttons horizontally
    Message was edited by: Jolly Giant

  • How to dynamic set messageInputText item data type?

    Hi,
    I have a LOV and other messageInputText items on the page. I need to be able to change the messageInputText item data type based on the value selected from LOV. How can I do that?
    DD

    1)Allow PPR on the item that receives the LOV values
    2)Edit the VO query and create a SQL based column, which in turn will control the switcher. Something like –
    decode(nvl(to_char(EmployeeEO.END_DATE), 'N'), 'N', 'DataType1', 'DataType2') AS DELETE_SWITCHER
    3)Now add a switcher region with two cases in your page. Each case should represent the two possible values defined in the SQL based column ( “DataType1”, DataType2” in the above example).
    4)Add two messageTextInput items under each case, but with different datatypes.

  • Items off the stage are showing up in the browser. How do I stop this?

    When learning Flash, I was taught in the beginning that only items that appear on the stage actually show up in the final animation.  Clearly, these people were wrong.  I thought it would be easy to have some text move in from off the right side of the stage to the middle, but the text still shows up even before it enters the stage in the browser.  I have tried to change this using various publishing options, HTML, and CSS, with no luck.  I did have to resize the stage, and I'm not sure if that means anything.  Can someone help me figure this out? Thank you.
    -Chris

    Here are a few things I noticed:
    No DOCTYPE for the page:
    http://www.w3schools.com/tags/tag_doctype.asp
    then validate the code here:
    http://validator.w3.org/
    Next, your main container is 1000px wide (as per your CSS) but in your IE conditional you are placing a 1500 px wide .swf inside.
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1500" height="217.....
    so for course that won't work. In IE that results in a bottom scroll bar no matter how wide a monitor... it's never wide enough to display without scrollbar
    FF is different because:
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="topbanner.swf" width="713" height="155">
    You're using smaller dimensions....so set them both the same.
    If your main container is 1000px wide, then the stage size of your .swf should be 1000px, not 1500, not 713. Then set the width/height of the <div> holding your .swf to the exact same size as the .swf. That should eliminate any off stage stuff from showing.
    Best of luck!
    Adninjastrator

Maybe you are looking for

  • Work processes ended by itself

    Hi all Yesterday, in our BI system, all of a sudden in the evening all our work processes went into the end state and the system froze. We did not issue a endsap or anything like that. We tried looking into the files but are not sure what exactly hap

  • My husband and I share an e-mail account.  Can we use the same e-mail account for two different iphone account i.d.'s?

    My husband and I do not have separate e-mail addresses.  Before he purchased an IPhone this was not a problem.  Does we need two separate e-mail addresses to create two separate Apple ID's and register, maintain two separate IPhones?

  • ADS FP_test_00 test error

    Hi Guys I am getting this error when i run the FP_TEST_00 script ADS: SOAP Runtime Exception: CSoapExceptionTransport :(100101) I have followed all the processes in the guide and the RFC is running okay. The system is on AS/400 and the ADS services a

  • Install printer driver for the hp 3511

    I have a mac 0S X older than 10.6 version and i need help finding and installing a driver

  • Remote network camera

    Hello all, I would like to know if anyone knows of a good camera to use as a remote camera to capture video and audio via the OS X server. I would like to set up a few cameras in different locations that connect to our OS X server (10.6.7). Most USB