XmlList problem in parseXML(event)

Hi All,
Working on an image app, and need to list visually my images
from xml file as in 1 2 3 4 5 6 7 8 9 10
but am instead getting 0 1 2 3 4 5 6 7 8 9
How do I get rid of the 0 and have it start a 1 2 3 4 etc...
Code attached ;)
Kind Regards,
Boxing Boom

Hi,
Started loop at 1, in thinking it would start at 1 as i.e.
1234 etc... it works but then the first image is no longer
available.
Here is more of the code:
//on load complete of the xml parse the data
private function parseXML(event){
//generate the xml object
xml=new XML(event.target.data);
//ignorre the white spaces
xml.ignoreWhitespace=true;
//generate the xmlList object
xmlList=xml.img;
//init the image pos
imgPos=0;
//and the total image number
imgTotal=xmlList.length();
//add the menu holder to the stage
addChild(menuHolder);
//create a menu item variable
var menuItem:Sprite;
//and a textfield
var menuText:TextField;
//assign a new format for the text field
var format:TextFormat = new TextFormat();
format.font = "_sans";
format.bold = true;
format.color = 0xdd047b;
format.align='center';
format.size = 14;
//loop on the items to generate the menu
for(var i=1;i<xmlList.length();i++){ //i=0; to keep 1st
photo in play
//the text field
menuText=new TextField();
//size fo the text
menuText.width=20;
menuText.height=20;
menuText.defaultTextFormat=format;
//set the text
menuText.text=i;
//not selectable
menuText.selectable=false;
//show border
menuText.border=false;
//menuText.borderColor=0x000000;
//give it the name text
menuText.name="text";
menuItem=new Sprite();
//add it to the menu item
menuItem.addChildAt(menuText,0);
//menuItem placement
menuItem.x=i*(menuItem.width+10);
//draw the back ground ot use the backgroundColor text field
proprety instead
menuItem.graphics.beginFill(0x333333,1);
menuItem.graphics.drawRoundRect(0,0,menuItem.width,menuItem.height,6,6);
menuItem.graphics.endFill();
//disable the mouse children
menuItem.mouseChildren=false
//enable the button mode and use the hand cursor
menuItem.useHandCursor=true;
menuItem.buttonMode=true;
//add the on click event
menuItem.addEventListener(MouseEvent.CLICK,handleItemClick);
//add the menu item to the menu holder
menuHolder.addChild(menuItem);
//reupdate the position of the childs
resizeHandler(null);
//start loading the images one after one
loadNextImage();
//handle the menu item click
private function handleItemClick(e:Event){
var item:Sprite=e.target as Sprite;
//retrieve the text
var _text:TextField=item.getChildByName("text") as
TextField;
//parse it to int and show the image at that position
showImageAt(parseInt(_text.text));
//load the images via this function
private function loadNextImage(){
//Trivial Test to stop the loading
if(imgPos==imgTotal){
return;
//get the url
var url:String=xmlList[imgPos].toString();
//assign it to the urlRequest objecct
urlRequest.url=url;
//load it
loader.load(urlRequest)
Thanks in advance for any help ;)
Kind Regards,
Boxing Boom

Similar Messages

  • I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?

    I have no problems copying iMovie Events from one Mac to another, however, how can I copy iMovie Projects from one Mac to another?  Any help will be appreciated.  Thank you.

    This should give you some good insight, I'd probably store them on an External HD on the old machine and then just drag and drop to the new machine.
    https://discussions.apple.com/docs/DOC-4141

  • ICal error "There was a problem receiving this event invitation"

    Whenever I try accepting an event invitation I get a dialog prompt that says
    *There was a problem receiving this event invitation*
    Someone invited you to an event using an email address that isnt on your "me" card in Address Book. Find your email address in the following list and add it to your card in Address Book
    Problem is I've done that, my vCard is up to date. It was working fine, I cant recieve any invites anymore, wether they come from OSX or Windows. Can anyone help?

    I ran into this same issue. To resolve this, go into the Address Book application. Select the vCard that is "your" card. Now in the menu bar, go to "Card". On the drop down menu, select "Make this my card". You should now be able to accept iCal invitations without any issues. When I upgraded to 10.5.1 the issue came back and this method seemed to resolve it.

  • How do I identify a problem in an event?

    Friends,
    I've updated to FCP X 10.1.  An event that I created after updating and for which I created a project suddenly displayed a yellow hazard symbol next to the name of the event.  This suggests that there is some sort of problem with the event or project.  How can I identify more specifically what the problem is?  Everything looks good when I look at the event and enclosed project.
    Thanks!
    Steve

    It means at least one peice of media is offline, and needs to be relinked.
    Select the Event, go to File > Relink Files, then swith from All to Missing Files.  You can then relink anything that is offline.

  • At event calendering site, getting message "There was a problem with your event submission. If you have disabled JavaScript please enable it and try your submission again." Javascript is ENABLED on my computer.

    I'm trying to submit an event to the events calendar at http://calendar.jtnews.net/events/index.php?com=submit. After I enter the Authentication words and press Enter, I get the message, "There was a problem with your event submission. If you have disabled JavaScript please enable it and try your submission again." According to my Firefox/Tools, etc., button, Javascript is enabled. I

    Hello mjswooosh,
    I'm very disheartened to hear that you've had ongoing problems when attempting to order from BestBuy.com. Our goal is ever to provide a fun and efficient shopping environment! Certainly creating aggravation serves neither you nor us and I apologize sincerely for this having been your experience.
    We recommend the troubleshooting steps you mentioned (i.e., clearing the browser cache, deleting temporary internet files and cookies) because this is the most common cause of this type of problem. I too have encountered this issue from time to time and these steps have almost always resolved the problem. I say almost always because there's one further step you can try: ensure that you have signed out of BestBuy.com, then perform the browser maintenance steps we've recommended. Afterward, before signing in to BestBuy.com, add your desired items to your cart and sign in as part of the checkout process. When the standard steps have not netted a resolution for me, this has solved the problem each time.
    I hope this helps. I'm very grateful that you took the time to write to us with your concerns and for sharing your very valuable feedback about your online experience.
    Sincerely,
    John|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Problems with close event scripts and closing Photoshop

    Hi!
    We are having problems with close event scripts ("Cls ") when closing/quitting Photoshop.
    The close event scripts are working without problem when closing an image. But when quitting Photoshop without having closed all images we are observing the following behaviour:
    with CS2 the close event scripts are not triggered at all
    with CS4  the close event scripts are triggered and executed correctly. But after that the Photshop process freezes. No visible GUI, you have to kill the process with the task manager.
    I can reproduce this behaviour even with a small script consisting of a single alert('hello') and even an empty script. Is this an known bug or am I doing something wrong?
    Thanks for your help!
      Eric

    Check your energy saver settings under system preferences. That is where you set sleep setting.

  • SCOM-Difference between Problem Count and Event Count in Application Failure Analysis Report

    Dear All, 
    Could someone explain me clearly , the difference between  Problem Count and
    Event Count in Application Failure Analysis  Report. Please help me in understanding What is meant be problem and event in the report .
    Thanks in Advance.
    Regards,
    Rajesh Kumar C

    Hello Rajesh,
    The "problem" is the logically grouped set of the exception events which have the identical hash calculated over several fields as "Stack", "Source", "Failed Function" and so on... So, even if exceptions are different
    in the other properties but hash matches over the considered properties - then all those exceptions go into the same "problem group".
    So, event is an instance of the problem. One event contributes to one problem but one problem might have a huge event count if you have a repeating issue.
    The logic is similar for the performance analysis report, only fields that go into the "problem" hash are different. e.g. "Stack" is not used in hash for perf events...
    Dmitry Matveev

  • Problem Posting an Event to the EventQueue

    Hi all,
    while i develop a java application i get problem posting ana event to the EventQueue using postEvent method.Here is the problem.i have a menu which have 3 menu items (Load, store, hide).i want when the user click "hide" the code in "store" option excuted plus extra code in option "hide".i tried to implement this using the postEvent of EventQueue. i simlate this by tring to post ActionEvent to simulate user cliks option "store" but this didn't work. can anyone tell me what's the problem.thanks

    try JMenuItem's doClick(). that simulates the user clicking on your menu item.
    thomas

  • XMLList problem - doesn't return anything at all

    Hey guys,
    I'm having a real problem here.
    I was just trying to learn some AS3 (particularly - XML integration)
    and got stuck on an absolutely basic thing which there shouldn't be
    any problems with. Something that should work, doesn't ... and I have
    no idea why ... maybe you could shed some light ...
    so ... here's the code:
    var urlReq:URLRequest = new URLRequest("galeria.xml");
    var loader:URLLoader = new URLLoader(urlReq);
    loader.addEventListener(Event.COMPLETE, onLoaded);
    function onLoaded(event:Event):void
        var xml:XML = new XML(event.target.data);
        trace(xml);
        var lista:XMLList = xml.galeria.foto;
        trace(lista);
    to best of my knowledge the last trace in the function
    should return something, anything ... but it doesn't, just a blank line
    and furthermore - the first trace two lines above returns the contents
    of the XML file as is ... so - what's going on? I've seen tons of tutorials and stuff
    and according to all of them - the above piece of code should work ... but it doesn't.
    of course the xml file is in the same directory as the fla file. oh, and one more thing
    - I'm using win7 and the latest version of Flash CS4 if that matters at all.
    just for the sake of it - I'm attaching the xml file and the fla file as well.
    please, help ...
    Regards,
    Martin

    that should be:
    var urlReq:URLRequest = new URLRequest("galeria.xml");
    var loader:URLLoader = new URLLoader(urlReq);
    loader.addEventListener(Event.COMPLETE, onLoaded);
    function onLoaded(event:Event):void
        var xml:XML = new XML(event.target.data);
        trace(xml);
        var lista:XMLList = xml.foto;
        trace(lista);

  • Another instance of severe new problem in iCal - events duplicated infinite

    This is like other posted problems. I just went Leopard - Snow Leopard. Have used iCal for years and consider myself experienced. On my first attempt to add a repeating event following the OS upgrade, the repeating event was duplicated hundreds perhaps thousands of times before I even completed the entry in the popup dialog. As you all know, that dialog does not allow cancel or delete. The event is duplicated multiple times in the same day. It seems to have no termination date. It cannot be selected in order to delete it. The color is even a pastel shade of the group color that it was supposed to have.
    I have turned off iSync and hope that I can remove theses ridiculous events before they spread to every Mac and Ipod.
    I cannot find a database to delete or I'd delete it and try to resync from me.com.
    Help, Apple -- we need your attention on this one. It is definitely a **** up in iCal.

    O.k. - I am not experienced in spite of many years of using this turkey. First of, the sync/don't sync button in preferences - forget it. iCal syncs with MobileMe no matter what the setting. Bummer - except that once the hundreds of duplicate, repeat events are transfered to MobileMe, you can delete them from the web interface - unlike the iCal application that forbids deleting unwanted events.
    Second new discovery. You can put in a repeated event on the MobileMe website with no trouble but, bummer again, the new event on MobileMe does not sync back to the iCal on the iMac.
    Final and most important discovery. I got the problem in the first place by blindly supplying the information asked for and, I kid you not, iCal 4 asks for the end date of a repeated event twice. If you answer the question twice, as I did, you get N * N events. So I hope I can avoid the problem in the future. But really, iCal needs methods to delete repeated events. Also as a former long-term Palm user, I sorely miss the option to restore a calendar from another machine. (the ability to sync or overwrite the local application).

  • HT2513 Problem Creating Recurring Events in iCal.

    Hello.
    I'm having some issues creating a recurring event in one of my iCoud Calendars on iCal.
    If I create a new event then go in and change the recurrance, time, and name it stays in my iCal for a few seconds then defaults back to a basic appointment with no name, time, or recurence. I then need to go back into the event and reprogram everything. It will then save the changes.
    Its a little annoying as I need to reprogram the even and save it twice.
    Has anyone had this problems, and could offer assistance?
    Thank You!

    The same thing happened to me! I'm in another discussion thread about this and it seems many people have the same problem and it all started about a week ago

  • Time zone compatability problem with timed event created on iOS and pushed to Windows7 Outlook calendar for sharing

    Hi, I am in Jerusalem time zone. My Windows7 LAPTOP time zone is set to it (UTC+02:00 Jerusalem). My iPhone5 and iPad are both "Set Automatically" (ON)  to Jerusalem. When I create any new event in my outlook on my Laptop it's generated with the Jerusalem time zone and pushed properly via iCloud to my iPhone and iPad. However when I create a new timed event on either my iPhone or iPad. or even in iCloud calendar (in a browser) the event is pushed to outlook on my Laptop in a "Beirut" time zone. Now that both Jerusalem and Beirut are on the same time zone (UTC + 02:00) it doesn't create any problem (though I prefer to see that the pushed events are indeed in Jerusalem time zone and not Beirut...). However, at and around day time saving change days there are problems of events created on iOS devices or even in iCloud (using browser) and pushed to outlook at the wrong times (1 hour earlier or later, depends on the change direction in Jerusalem time...) with a Beirut time stamp.
    How can I resolve this problem and make sure all timed events, created on iOS devices at a Jerusalem time zone, appear as such after pushed via iCloud to my windows7 Outlook calendatr?  Thanks!

    I also have this issue (iPhone 5).  Outlook needs to be configured properly in that timezone option needs to be selected.  Which is challenging enough.
    However the bigger issue for me is that when I open the ICN file:
    1.  I have no way to accept decline etc.
    2.  When the event is populating the calendar in the wrong time I can neither cut and paste nor select and move.  It is totally static.
    So for every meeting request I have to ensure it populates the right time as per my time zone. and if it doesnt i have to manually enter a second meeting 'X' hours earlier/later depending on which time zone the meeting was generated in.
    I spoke to Apple.  Their solution is make sure Outlook is properly configured.  Fine...but good luck.  I need a work around that is Apple based.  Because this *****.
    They said they would send to the development team.  I am not holding my breath.

  • Problems with Repeating Events on Palm and iCal

    Hi,
    I'm having a problem with daily-repeating events entered into either my Palm or iCal. When I put events in my palm and sync them to iCal, the iCal calendars look right, but then the Palm events become truncated,i.e. only the first day of daily event will be visible. If I do nothing but just sync again, the events in iCal become weirdly duplicated, i.e. if an event had two repeats, the "original" occurrance will be there, along with a second, starting on next day of the series, lasting for the same number of repeats. Is there any way to make one calendar the overwriting calendar while using iSync? Or do you know of some other fix? This problem doesn't seem to affect other repeating events, either monthly or yearly.
    Thanks
    20" iMac with Intel   Mac OS X (10.4.10)   500 GB HD, 2GB RAM 60GB Video iPod

    As I just posted in another thread, there are a whole series of 'representation disconnects' between the Palm calendaring application and iCal.
    While this article— iSync: About Syncing Recurrent Events Between iCal and Palm OS Based Devices—would lead to you believe that iSync is primarily the issue, it's not: this behavior occurs primarily because of the differences between the calendaring programs in each environment, and only secondarily because of the manner in which records are pushed and pulled by the synchronization framework.
    iSync itself is simply another compliant sync client, and there is unfortunately no workaround for the issues delineated in the article.

  • Problem with register event callback in use of instrument control

    now, i use the register event callback to register a value change of a boolean control on the front panel, and wire the cluster's ref of the instrument control parameters to the user parameter input, then create the callback vi. In the callback vi, i select the pump-control subvi, and pass the user parameter to the subvi. The problem is that,  when i press the boolean control, the instrument (here is pump) can act, but immediately, the code crashes.
    I use labview 8.6
    Attachments:
    callback vi.png ‏8 KB
    register event callback.png ‏8 KB

    You would wire the event registration wire that comes out of the Register for Events node into an event structure.  You will need to right click on the event structure and check off "Show Dynamic Event Terminals" and it into that.  Then you can create a new Event Case that uses the dynamic event.  You can place your subVI in that event in whatever way you want.  (Just drop the subVI in or do a Call by Reference there, or whatever.)  Look in the Example Finder for "Dynamically Register for Events.vi".

  • ICal 3.x .ics import - problem with recurring events and non-unique UIDs

    Upgraded to Leopard over the holiday break. Under Tiger's iCal (v2.x), .ics files exported from other calendar programs (Outlook via iAppoint/O2M in this case) and imported into iCal behaved 'normally'. However, in iCal 3.x in Leopard, for recurring appointments in the exported calendar, only the last appointment in the series shows up in iCal (although some meetings show up for about 0.25 seconds during the calendar import, then immediately disappear! This post by MalcolmS provided the critical clue - it seems that for recurring events, the .ics file has all of the events in the series with the same UID. Previous versions of iCal didn't care, but v3 apparently does - and deletes all earlier versions of the event, leaving only the last one with that UID. I confirmed that is the case by opening the .ics file in Word, which clearly showed all of the recurring events, and all the events in a series (e.g. a weekly meeting for the year) had the same UID. After the import to iCal, only the last one is in the calendar (in the above example, the one meeting of the series occurring in the last week of December). Manually editing the UIDs of a recurring series in the .ics file (to make them actually unique) allows them to all show up in iCal after import.
    Since many of the events in my Outlook calendar are accepted invites for recurring appointments, re-creating them as individual calendar events in Outlook is not a viable option. The frequency of changes to my calendar means I usually export it once per day (or twice); thus, manually editing the .ics files is also not a viable option.
    Any suggestions on workarounds for this problem? Alternatively, any other suggestions for getting the calendar data from Outlook into iCal?
    Thanks in advance!

    Moot point, as direct iPhone access to the Exchange server is now supported by our IT department.

Maybe you are looking for