Dynamically create empty mcs and asign elements from array and loadmovie

I'm creating an educational game for my school students.
A little boy is flying through the city when he encounters objects flying from left to right.
He hears a SOUND eg: Dog - he must go and click the dog image with the flying cursor. There are at least 5 DIFFERENT objects that should be flying on the screen. There could be various of them at any one time.
I have the roots of the images in an xml file. And the actual swf are in a file called IMAGE and the sounds in SOUND.
My problem is that most tutorials I see use the attachmovie method but I don't want to put all the swf's in the library as there are hundreds.
I have to use the loadmovie method.
I take it I have to loop through the array and assign each element to an empty movieclip which in turn is in the loop so you get 5 empty clips - I will use i (index). It doesn't seem to be working. I shall keep trying and post back here if I get any luck but I'm running out of ideas.
Then the objects have to float across the screen. Don't know whether to use tween object or onEnterFrame handler or other. AND someone has mentioned using setinterval to "spit out" the objects.
BUT if I have five flying across the screen I'm left without clips to stick in any more.
Oh my head hurts but I will keep going.
CHEERS if any help is around. This should be quite a standard thng for game developpers. Code at the moment
function loadEnemies():Void {
enemy_xml = new XML();
enemy_xml.ignoreWhite = true;
enemy_xml.onLoad = function(success:Boolean) {
if (success) {
_root.parseEnemyXML();
//enemy_xml.load("level_"+level+".xml");
enemy_xml.load("data/animal_catch.xml");
function parseEnemyXML():Void {
rows = enemy_xml.firstChild.childNodes.length;
for (var i:Number = 0; i<rows; i++) {
var row_string:String = String(enemy_xml.firstChild.childNodes[i].firstChild.firstChild);
_root["row_"+i+"_array"] = row_string; //MAIN ARRAY holds an array images/dog_a.swf/ images/cat_a.swf etc... all five
_root.createEmptyMovieClip("enemyObjects", 1);
enemyObjects.createEmptyMovieClip("holder_"+i, i);
_root["object"+i] = new Sound(enemyObjects["holder_"+i]);
trace(row_string);
loadMovie["row_"+i+"_array"], ["holder_"+i]
if (level == 1) {
alerts_mc.play();
} else {
currRow = 0;
rowCounter = 0;
OK got to about here BUT
a. I started to get confused around the createEmptyMovieClip part
b. I KNOW I shouldn't have Sound(enemyObjetcs etc... BUT I copied the code from a tutorial and I don't know what to replace it with.
I'm close but I need a little polishing.

It doesn't do you much good to work with borrowed code that you do not understand.  Your best bet will be to start small, creating one functional piece of the puzzle at a time, and work your way up.  Start with making sure you are loading and parsing the xml properly, then set about loading the external content, then see about making that content move around, etc...
In the code you show, your loadMovie line of code does not resemble anything I have seen before, looking more like (but not quite like) a multi-dimensional array element than a loadMovie() function call.  If you find you need to have control of the items as soon as they load, then you should consider using MovieClipLoader.loadClip instead of loadMovie.  The MovieClipLoader class provides features, such as to be able to determine when items have fully loaded.

Similar Messages

  • Deleting all elements from array and array to spreadsheet string

    Hello,
    I would like to write a new data file for each "recording" session without closing the VI.  My problem is that the last "recording" session's data is at the top of every successive session's text file.  I do not want this.  I've tried to delete all rows from the array after my array to spreadsheet string function, but I think the problem is somewhere with the shift register and how the array is built.  I'm not too familiar with LabView and this aspect of my interface is driving me crazy.  Attached is my code and two successive data files.  I have not been able to find a solution on these or the LAVA forums.  Any help would be appreciated.
    Also, I know there is an easier way to write this kind of streaming data, but I need to do it this way for other devices and synchronization purposes.
    Attachments:
    testsecond.txt ‏90 KB
    test41.vi ‏80 KB
    testfirst.txt ‏78 KB

    A few more comments to your code:
    Your loop does not have a wait, meaning it spins the empty case millions if times per second, consuming all CPU while not doing anything. Add an indicator to [i] to see.
    To clear a 2D array in one case frame, just don't wire the output tunnel and set it to "use default if unwired". You'll get an empty array. No fancy tools needed.
    I probably would use an event structure and also protect the data if the save dialog is canceled.
    Here's a simple draft that probably requires a bit more work but should show some of the ideas.
    You should also
    add some protection that the VI cannot consume all available memory if it runs forever.
    Create a seperate case to save the data later if the file dialog is cancelled the first time.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    test41MOD.vi ‏107 KB

  • WebDynpro Java: how to remove blank element from Table and Dropdown.

    Hi  Folks
    In a webdynpro application,
    I created a table and witten the below code to populate the table
         IPrivateDummyView.IFirst_TableElement First_Table_Element = null;
         First_Table_Element = wdContext.nodeFirst_Table().createFirst_TableElement();
         First_Table_Element.setF_Value("One");
         wdContext.nodeFirst_Table().addElement(First_Table_Element);
         First_Table_Element = wdContext.nodeFirst_Table().createFirst_TableElement();
         First_Table_Element.setF_Value("2");
         wdContext.nodeFirst_Table().addElement(First_Table_Element);
    As per the code, i got 2 row in the table.
    But , i have one Empty row on top of the table ,  how to get ride of this.
    i find the same problem happening with dropdown too, where i used DDBI, i populated a the content as mention, but i initial 2 row as blank and then i have my own elements ,as per my code.

    >
    > how to remove blank element from Table and Dropdown
    >
    Change selection property of related node to from 0..1 to 1..1 (mandatory)
    Re: DropdownByIndex and empty line (Thread: DropdownByIndex and empty line )
    Re: Can the empty selection be removed from element dropdownbykey(Thread: Can the empty selection be removed from element dropdownbykey )
    Edited by: Anagha Jawalekar on Nov 18, 2008 10:28 PM

  • How to get the values of all elements and sub elements from  following xml

    how to get the values of all elements and sub elements from following xml...
    <?xml version="1.0" encoding="UTF-8" ?>
    <List_AML_Finacle xmlns="http://3i-infotech.com/Cust_AML_Finacle.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://3i-infotech.com/Cust_AML_Finacle.xsd List_AML_Finacle.xsd">
    <TransactionID>TransactionID</TransactionID>
    <Match>
    <Src_Matched_Field>Src_Matched_Field</Src_Matched_Field>
    <List_Matched_Field>
    <FSFM_Matches>
    <NUMBER>NUMBER</NUMBER>
    <TERROR>TERROR</TERROR>
    <TU>TU</TU>
    <NAMEU>NAMEU</NAMEU>
    <DESCRIPT>DESCRIPT</DESCRIPT>
    <KODCR>KODCR</KODCR>
    <KODCN>KODCN</KODCN>
    <AMR>AMR</AMR>
    <ADDRESS>ADDRESS</ADDRESS>
    <SD>SD</SD>
    <RG>RG</RG>
    <ND>ND</ND>
    <VD>VD</VD>
    <GR>GR</GR>
    <YR>YR</YR>
    <MR>MR</MR>
    <CB_DATE>CB_DATE</CB_DATE>
    <CE_DATE>CE_DATE</CE_DATE>
    <DIRECTOR>DIRECTOR</DIRECTOR>
    <FOUNDER>FOUNDER</FOUNDER>
    <TERRTYPE>TERRTYPE</TERRTYPE>
    </FSFM_Matches>
    <OfacMatchDetails>
    <UID>UID</UID>
    <TITLE>TITLE</TITLE>
    <SDNTYPE>SDNTYPE</SDNTYPE>
    <REMARKS>REMARKS</REMARKS>
    <ID_UID>ID_UID</ID_UID>
    <IDTYPE>IDTYPE</IDTYPE>
    <IDNUMBER>IDNUMBER</IDNUMBER>
    <IDCOUNTRY>IDCOUNTRY</IDCOUNTRY>
    <ISSUEDATE>ISSUEDATE</ISSUEDATE>
    <EXPIRATIONDATE>EXPIRATIONDATE</EXPIRATIONDATE>
    <ADDRESS1>ADDRESS1</ADDRESS1>
    <ADDRESS2>ADDRESS2</ADDRESS2>
    <ADDRESS3>ADDRESS3</ADDRESS3>
    <CITY>CITY</CITY>
    <STATEORPROVINCE>STATEORPROVINCE</STATEORPROVINCE>
    <POSTALCODE>POSTALCODE</POSTALCODE>
    <COUNTRY>COUNTRY</COUNTRY>
    </OfacMatchDetails>
    </List_Matched_Field>
    </Match>
    </List_AML_Finacle>

    avoid multi post
    http://forum.java.sun.com/thread.jspa?threadID=5249519

  • I lost all the information in the ical. I am using icloud and info desapear from ical and several times from my agenda too. But I desperately need the info from my ical. I tried using the time machine but i received a messagem saying that they can not mod

    I am using icloud and info desapear from ical and several times from my agenda too.
    But I desperately need the info from my ical.
    I tried using the time machine but i received a messagem saying that they can not modify ical.
    Can somebody help me?

    First of all, we are not Adobe.  This is a user to user forum.  We are consumers just like you. And I have arthritis, too, although not severe.
    Now let's see if we can help you resolve your problem.
    Where was it purchased from?
    Was it downloaded or was a disc purchased?
    What is your operating system?
    Is it version Photoshop Elements 13?
    Did you use a redemption code to get a serial number?
    Did you sign in/activate?
    Did you create an Adobe account?

  • A very good friend of mine dropped her iphone into water and now it is not working.Her husband recently passed away and text messages from him and from well wishers after his decease are feared lost. Is there any way to retrieve them?

    A very good friend of mine dropped her iphone into water and now it is not working.Her husband recently passed away and text messages from him and from well wishers after his decease are feared lost. Is there any way to retrieve them?
    I suggested contacting Compub in Nassau St as the info is priceless and worth the trouble of trying to regain?
    Any thoughts? The poor lady is very distress

    If she has backed up her iPhone she can replace that iPhone and set up the new iPhone from her backup.
    You can put the iPhone that went into water into a plastic baggie with either new silica gel packets (preferred) or raw rice and let it sit for  4 - 5 days. After that time remove the phone and connect it to power for at least a half hour. While it is still connected to power reset it by holding down the power and hold button, wait for the Apple logo then let go of the buttons. Might take several tries. If it revives immediately back it up.

  • Photoshop and premiere elements 12 Student and teacher edition:

    Hi there,
    i bought the student edition, entered everything recommended as name, etc, product code, sent a jpg file with school report and now i am waiting since three weeks for the serial number. What can i do?, photoshop and premiere elements 12 Student and teacher edition: i bought the student edition, entered everything recommended as name, etc, product code, sent a jpg file with school report and now i am waiting since three weeks for the serial number. What can i do?
    greetings
    luc

    You might want to reconsider due to version 13 coming out a few weeks ago.  MAybe you can change the purchase and exchange for version 13.  In the meantime you could install the trial version and use those for 30 days while waiting for a serial number to appear.
    Please see Return, cancel, or exchange an Adobe order -
    http://helpx.adobe.com/x-productkb/policy-pricing/return-cancel-or-change-order.html
    Phone support | Orders, returns exchanges
    http://helpx.adobe.com/x-productkb/global/phone-support-orders.html
    For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Get chat help with orders, refunds, and exchanges (non-CC)
    http://helpx.adobe.com/x-productkb/global/service-b.html ( http://adobe.ly/1d3k3a5 )
    PSE 13 Trial - http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements
    PE 13 Trial - http://www.adobe.com/cfusion/tdrc/index.cfm?product=premiere_elements

  • HT1535 I was syncing my notes and they disappeared from ipad and now I can't find them on my pc.

    I was syncing my notes and they disappeared from IPAD and now I can't find them.  Where or how can I retrieve them?

    Try Music App>Others

  • Rev Recognition and Charge Backs From SD and FICO Prospective

    Hello Guru's,
    Will anyone mail the Building Block link to make config settings for Revenue Recognition and Charge Backs from SD and FICO Prospective, that will be of  great help.
                   Full points for the link / doc

    Revenue recognition settings are explained in note 777996.

  • During sync all my purchased music and videos disappeared from computer and iPhone as well can you advice me what to do ?

    I made a recovery in my computer and i downloaded the latest iTunes software but during sync all my purchased music and videos disappeared from iPhone and never get to iTunes and there is no back up for music.Can somebody Advice me what to do ?

    Emma Norton wrote:
    I've tried looking for the devise in My computer but all it says is iCloud.
    You should not see anything labeled iCloud in Windows Explorer.

  • Album uploaded to Itunes match, plays on computer but won't play on ipod, no cloud symbol next to songs. Press play on 1 track and it skips through the album without playing. I've tried deleting the album from PC and downloading again from match and even

    Album uploaded to Itunes match, plays on computer but won't play on ipod, no cloud symbol next to songs. Press play on 1 track and it skips through the album without playing. I've tried deleting the album from PC and downloading again from match and even after syncing the album won't play on the ipod
    iPod touch, iOS 6.1

    I've just connected the ipod to my computer and checked the music on the iPod. The album that I am having trouble with shows an exclamation symbol next to it. I've tried deleting the album from iTunes and re downloading it then syncing but it doesn't appear to affect the information shown the iPod. The album neither deletes nor updates.

  • Is it possible to dynamically create a user variable at runtime from within a Widget?

    I'm trying to develop a custom Interactive Widget. This widget will allow the user to take multiple attempts, and needs to store information about previously completed attempts so they can (hopefully) see their improvements over time.
    I'm trying to figure out the best way to store the data about the previously completed attempts across multiple sessions in a LMS. It seems that the data stored in user variables is automatically stored/restored in suspend_data, which would be perfect. The issue is that I can't find a way to dynamically create a new user variable from within a Widget. It looks like I can only access user variables that the author has explicitly defined in the Captivate interface. I'd rather not have to force the author to define an empty User Variable that they'll never knowingly use, just to give the Widget a bucket to store its data.
    Does anyone have any ideas for what might be the best way to accomplish this? I'd like to stick to standard, "approved" APIs as much as possible, but I'd be willing to bend some rules if necessary.
    Thanks!

    Ryan,
    I assume you've asked this question here:
    https://groups.google.com/forum/?fromgroups#!topic/elearning-technology-and-development/e5 vWZfJ6X8I
    I asked a similar question here:
    https://groups.google.com/forum/?fromgroups#!searchin/elearning-technology-and-development /leichliter/elearning-technology-and-development/Au88bu7LB5o/TC7xlo8iBpQJ
    Philip gave you sound advice.  You'll have to hijack/re-purpose the comments or the suspend data.  I was successful in using SCORM comments in a Moodle system to store extra data I needed for a customer.  It's not ideal, but it gets the job done. Here's a thread about that:
    https://groups.google.com/forum/?fromgroups#!topic/elearning-technology-and-development/Yg YAMGfXQNw
    If you use suspend data, you have to watch out for a few things:
    1.  It's base 64 encoded... so any data you append to what Captivate outputs will need to be in base 64 (that's a good practice anyway since the data has to be serialized).
    2.  On course re-entry, you'll need to capture the suspend data before it hits Cp to strip off / read your needed data.  If the suspend data isn't in the format Cp expects, you'll get a nice white screen of death.
    Ideally, it would be nice to be able to dynamically create user variables for purposes like this... and it's been requested in Cp 6.... we'll see if it gets added (not holding my breath).  Until then, I'd use cmi.comments.
    Jim Leichliter

  • How to install Lightroom and Photoshop Elements from my old pc to my new pc?

    I have a new pc and want to install Lightroom 5.7 and Photoshop Elements 12 from my old pc to the new one.

    For LR here is a useful link:
    http://www.lightroomqueen.com/how-move-lightroom-to-new-computer/
    There is also a video tutorial which covers moving a LR catalog to a new computer:
    http://tv.adobe.com/watch/the-complete-picture-with-julieanne-kost/how-to-migrate-lr-to-an other-computer/
    For Elements you can simply install the application and then set up the Elements Editor for external editing in the LR Library prefs. I’m assuming you won’t be using Oranizer as well as LR. That can lead to confusion and broken links unless you are very disciplined.
    If you do intend to use Organizer the method is backup and restore, starting with an Organizer backup on the old PC.
    http://helpx.adobe.com/photoshop-elements/kb/backup-restore-move-catalog-photoshop.html

  • Price of Upgrade to Photoshop Elements 13 and Premier Elements from both in version 10

    Since the Adobe site is almost impossible to use in resolving problems, and any reference to Contact Us means Forums not Adobe themselves (fancy a Customer wanting to Contact the Company themselves - the cheek of it!) could anyone please advise what the cost would be to upgrade from Photoshop Elements 10 and Premier Elements 10 to their respective 13 versions. Thank you.

    Thank you for your quick response. Unfortunately after clicking through this link (and then a further 7 or 8 more) I got to a page that quoted £100 for the two. I''m sure this is a discounted price for a new purchase, and whilst I understand you will always get the full product when upgrading from one version of Adobe to the next, I do not think it is acceptable to charge such a large amount when I have already paid full price for a not very old previous version. Have I clicked to the wrong page? Does anyone have a link for direct access to upgrade that is at a much more reasonable price? Whilst I know software developers do not try and compete with large high street retailers, I believe I can purchase both Adobe suites as a package from a well known one for much less than this! Thank you.

  • Table Problems (Cell Shading and Default Format from EDD and Template)

    I have two problems related to tables using Structured FrameMaker (Version 10), whilst in-processing XML.
    I've designed two different table formats in my Template; Format A with black shading - 30% for THead and 3% for row, and Format B with blue shading - 30% for THead and 3% for row.
    If I create a structured document from scratch and insert a table, I get the required Black (30%) and Black (3%) shading.   If I then insert an informaltable, I get the required Blue (30%) and Blue (3%) shading.
    Although I've given the two table types different default formats in the EDD - Format A for table and Format B for informaltable - when I open the XML file (normally) from within FrameMaker I notice that all the tables default to Format A (black shading).   When I then import my EDD table should stay as Format A and informaltable should change to Format I.   This doesn't happen; they all stay at Format A.
    I can change informaltable by manually applying Format I, this worksI.  Obviously, with long documents which might have hundreds of tables we can't afford the time and manpower to do such things one at a time by hand.
    Do any of the Structure gurus have a fix for this, or can someone give me a hint of what I might be doing wrong?
    The second, but related question was a general one.   I see that Adobe says
    "Tables
    FrameMaker table formats are only partially integrated with the structure model. The content of
    a FrameMaker table is always fully structured, but the control over cell border ruling is limited and
    there is no structure format control over cell shading."
    I believe it could be useful to apply cell shading on an individual cell basis (although I'm not sure whether this is possible at the XML level - where someboddy might give an element an attribute of, say, shading (with options, such as, green, red, blue, yellow all at, say, 30%, with a default of red, for example.
    I've seen that there has been mention of plugins to achieve cell shading in structure; does anyone have an experience with such things, more to the point, can anyone point me in the right direction?   I don't mind paying fo a solution which I can implement myself.
    Any help or advice would be much appreciated.
    Regards
    Chris

    Hi,
    could you please provide some details on the EDD, RWR and some example XML?
    My wild guess goes into the direction of the RWR not containing enough information that get written out into XML.
    We're using table formatting with shaders too (using an attribute to control the specific formatting of each table) and it works like a charm in FM9 and FM11 when roundtripping.
    The context rules are used in the table group (i.e. tgroup element). This might already solve the issue .
    Cheers Alex

Maybe you are looking for

  • Get document info in INBOX

    Hi, Can every one tell me witch FM must be use to get liste of document (mail) received in the INBOX in WORKPLACE. the FM : SAP_WAPI_CREATE_WORKLIST give me the liste of workflow but I need more that to get the document(Mail) detail liste received. T

  • Error entering administrator name & password to make System Prefs changes

    I have been running Leopard with just fine but encountered this new problem today. I wanted to create a "Guest" account, but when I clicked on the lock in the System Preferences: Users screen to add that option, I typde in my administrator name & pas

  • Include attachments in PO_SOURCING_XSLFO

    Is there way to embed the actual content of the attachment (if it a Word Doc or a Text file) in the report? ie...is there syntax in xsl-fo that will allow us to specify a file name and will embed the text of the attachments for the Sourcing Style She

  • Two emails one must require password entered

    I have two hotmail email accounts ...one must be private password protected with its own contact address file..  How do I set up the private one?  The non private one is set up and appears when I touch "mail"

  • How do I import an MKV file into Premiere Pro CS6?

    How do I import an MKV file into Premiere Pro CS6?