Load images in the correct order, needs help..

I have tried loading in some images in the order of the xml files.. that contain them ..
they did load in one by one but .. in  random order .. so mabe i am doing too much or too liitle can some one give it asecond look for me ..
//-- load Xml
urlLoader.load(new URLRequest("loader_alpabet/loader_alpabet.xml"));
urlLoader.addEventListener(Event.COMPLETE,xmlReady);
this.addEventListener(Event.ENTER_FRAME,entFrm);
// process the Xml and create array of objs
function xmlReady(evt:Event):void {
     xml=new XML(evt.target.data);
     var xmlListUrls:XMLList=new XMLList(xml.image.url.text());
     var xmlListNames:XMLList=new XMLList(xml.image.name.text());
     var xmlListDescs:XMLList=new XMLList(xml.image.description.text());
     for (var g:Number = 0; g < xmlListNames.length(); g++) {
          imagePack.push({name:xmlListNames[g],url:xmlListUrls[g],desc:xmlListDescs[g]});
          if (xmlListUrls.length()==imagePack.length) {
               loaderMachine();
//this is where i position the images
function entFrm(evt:Event):void {
     if (imageIcons.length>0) {
          for (var g:Number = 0; g < imageIcons.length; g++) {
               imageIcons[g].x=(centerX+Math.cos(angle+g)*radiusX)-imageIcons[g].width/2;
               imageIcons[g].y=(centerY+Math.sin(angle+g)*radiusY)-imageIcons[g].height/2;
               imageIcons[g].scaleX=imageIcons[g].scaleY= ((imageIcons[g].y/150) - 0.5);
               stage.addChildAt(imageIcons[g], imageIcons[g].scaleX);
               angle+=speed;
//-- loader function
function loaderMachine():void {
     trace(imagePack.length);
     loader = new Loader();
     loader.load(new URLRequest(imagePack[count].url));
     loader.contentLoaderInfo.addEventListener(Event.COMPLETE,imageReady);
// put image on stage
function imageReady(evt:Event):void {
     var image:Bitmap = (Bitmap)(evt.target.content);
     addChild(image);
     imageIcons.push(image);
     count++;
     if (count<imagePack.length) {
          loaderMachine();

ah, I missed the 2nd version of the code
You have to take the loaderMachine(); call out of the loop, call it after the loop.
function xmlReady(evt:Event):void {
     xml=new XML(evt.currentTarget.data);
     var xmlListUrls:XMLList=new XMLList(xml.image.url.text());
     var xmlListNames:XMLList=new XMLList(xml.image.name.text());
     var xmlListDescs:XMLList=new XMLList(xml.image.description.text());
     for (var g:Number = 0; g < xmlListNames.length(); g++) {
          imagePack.push({name:xmlListNames[g],url:xmlListUrls[g],desc:xmlListDescs[g]});
      // start loading images
     loaderMachine();
You're overwriting you loader instance each time you load an image, that's not good if you want it to stick around (display each loaded image).
So in the method, create a local Loader instance and add it to the Array stack.
Don't start the enterFrame event handler until all images are loaded.
You can do so in the imageReady() event handler (check if counter equals array length).
Don't add event listeners in the enterFrame event handler, you're adding them over and over again.
So remove these from entFrm()
imageIcons[g].addEventListener(MouseEvent.MOUSE_OVER,btn_mouse);
imageIcons[g].addEventListener(MouseEvent.MOUSE_OUT,btn_mouse);
Don't use Event.target (unless you know what you're doing), use currentTarget instead.
function imageReady(evt:Event):void {
     var loader:Loader = (event.currentTarget as LoaderInfo).loader;
     loader.addEventListener(MouseEvent.MOUSE_OVER, btn_mouse);
     loader.addEventListener(MouseEvent.MOUSE_OUT, btn_mouse);
     addChild((loader);
     count++;
     if (count<imagePack.length) {
          loaderMachine();
    }else{
          addEventListener(Event.ENTERFRAME, entFrm);
Don't use Array.length in a loop condition, as this will check the lenght with each iteration, slowing down the loop.
Set it to a local variable once and use that as the loop condition.
var len:uint = imageIcons.length;
for(var i:uint=0; i<len; i++) {}
Last but not least, you're probably better off using a tween engine rather than an enterFrame event to move things around.
Look into TweenLite.
http://blog.greensock.com/tweenlite/
It now looks like the enterFrame event continues untill you roll over one of the buttons? If so, that can't be good..
function loaderMachine():void {
     var loader:Loader = new Loader();
     loader.load(new URLRequest(imagePack[count].url));
     loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageReady);
     imageIcons.push(loader);

Similar Messages

  • How do I export images in the correct order?

    Hello, this is probably an easy question - how do I export my images in the order in which they were taken? At the moment, the first image I've taken is exported last (so img_6700 is given the name image-099 and img_6799 is given image-001).
    I tried selecting the images in different orders and that doesn't seem to help. I'm using Aperture 2.1.2

    HI,
    when you go to export your images make sure you have the name format set to "current version name"
    its in the drop down menu 4th down
    D

  • Please help to load image in the database

    Hi to all. ....
    I need to save image file in the database thru forms ...
    I have some image file in the application server and I need to load it in the database in a Blob col..
    Any help ... ??
    Thank's in advance

    Hi!
    Your forms version is very important.
    If you use forms 10g and you want to load the image on the client, you need webutil.
    If you use forms 6 or you want to load the image from the application server to
    a image item in your form, you can use the read_image_file forms build-in:
    read_image_file ( 'x:\path\image.jpg.', 'JPG', 'block.image_item' );On forms 10g this will be executed on the server and the filename and path has to be
    a physical place on your servers harddisk.
    The image item has to be an item of type image and must be assinged to a blob colum in your table.
    Regards

  • Please help me!--rendering makes the images or video blurry (very pixelated) deteriorates the image  Adobe Premier Elements 13  need help!  .jpg and mpeg images,  but I have never "rendered" before since I got APE 13 about 6 weeks ago.  I am desperate for

    Please help me!--rendering makes the images or video blurry (very pixelated) deteriorates the image  Adobe Premier Elements 13  need help!  .jpg and mpeg images,  but I have never "rendered" before since I got APE 13 about 6 weeks ago.  I am desperate for assistance!

    That's going to be a ridiculous waste of money and energy.
    First of all, the current ATI drivers don't support multiple GPUs, so at the moment even a single 4870X2 would be only a 'normal' 4870 (which is quite a speed beast already). GFX drivers evolve rapidly, so things might look different next month, but when it comes to Linux and hardware there's one Golden Rule: stay away from the newest stuff and wait for proper support to get coded.
    I also wonder what power supply could possibly cope with the differences between idle and full load; that's way beyond 400W. But then, I'm one of those "quiet&green" types where >100W idle is already a bit much.
    I kind of understand that you want to get it done and not worry about hardware for the next 10 years or so, but that's simply not how the hardware world works and never did. At least not for the average consumer.

  • WHEN I IMPORT MEDIA FROM MY CAMCORDER TO iMovie it doesn't load up in the order of the way it was recorded and i have to piece the movie in the correct order when i make tmy project!

    WHEN I IMPORT MEDIA FROM MY CAMCORDER TO iMovie it doesn't load up in the order of the way it was recorded and i have to piece the movie in the correct order when i make tmy project!

    You might try restarting your device, your router and your Apple TV.

  • My 4G Ipod shuffle does not play songs in the correct order? Already restored to factory settings and no success.. Can anybody help me?

    My 4G Ipod shuffle does not play songs in the correct order? Already restored to factory settings and no success.. Can anybody help me?

    I FINALLY GOT IT! after months of relentless synching/autofilling problems on my 4th generation i figured out the solution.
    this is what i did: plugged in ipod on off mode~>manually deleting my ipod's songs~>restored factory settings~>unchecked automatic synch~>made a new playlist with exactly the songs & order i wanted for my ipod (just dragged old playlists into the new one)~>then autofilled that new playlist into my ipod. came out like a charm! (before u autofill UNCHECK random add songs)
    my ipod always ended up autofilling/synching my customized playlists wrong or it would automatically do my music library (and that was way unorganized), so this worked.

  • My iPod touch is not playing the songs on the playlists in the correct order. Can anyone help?

    My ipod touch is not playing the songs on the playlist in the correct order.

    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store         

  • How can I fix the tracks so they are in the correct order?

    I made a CD from an old vinyl "The Best of the Staples Singers". Then I downloaded the Artwork. The artwork was from a later version of the same album. On that later version the tracks were in a different order and when I printed the insert for my CD I got the track order associated with the later version of "The Best of the Staple Singers". I deleted the artwork, however the tracks still print the order from the later version. Just to throw in an oddity: the tracks show up in the correct order on the screen and I can print a "List" & get the correct order, just not the CD insert. Hopefully someone will have a resolution for this problem. Thanks, Karen29

    karen29 wrote:
    I made a CD from an old vinyl "The Best of the Staples Singers". Then I downloaded the Artwork. The artwork was from a later version of the same album. On that later version the tracks were in a different order and when I printed the insert for my CD I got the track order associated with the later version of "The Best of the Staple Singers". I deleted the artwork, however the tracks still print the order from the later version. Just to throw in an oddity: the tracks show up in the correct order on the screen and I can print a "List" & get the correct order, just not the CD insert. Hopefully someone will have a resolution for this problem. Thanks, Karen29
    Hello Karen.
    You have posted in the "Windows Compatibility" forum. What Windows® app are you using to manage, print, view, and burn your digital CD tracks that were converted from vinyl?
    If "Help" for that app does not tell you how to reorder your digital tracks for CD creation, someone who uses that app may be able to tell you how they do it, but we need to know which app you are using.
    EZ Jim
    Mac Pro Quad Core (Early 2009) 2.93Ghz w/Mac OS X (10.6.2)  MacBook Pro (13 inch, Mid 2009) 2.26GHz (10.6.2)
    LED Cinema Display  G4 PowerBook 1.67GHz (10.4.11)  iBookSE 366MHz (10.3.9)  External iSight

  • How do I make iPod Classic import (sync) photos via iTunes so that the photos stay in order by filename and can then be viewed as a slideshow in the correct order?

    I carefully number my iPod bound photos so that they are in a desired order by filename.  When I sync the photos to my iPod Classic they are not in the same order.  A typical filename would be:  001 001 IMG-3489.jpg followed by 001 002 IMG-3478.jpg.  Windows uses the first seven characters to order the files and does not care what follows the first seven so long as the first seven are not duplicated within the folder.  My iPod ignores that convention.  HELP! PLEASE!  I want to view my slideshows in the correct order.
    Thanks

    Does both your Windows and Macbook iTunes have the same library of songs?
    if it  does then, much easier to proceed, else try to load the Macbook with the same library as Windows.
    Note that only one of the Macbook USB port is good for iPod Classic, the other is too slow and may cause timeout, and I would suggest disconnect all other USB devices, while you Restore or Sync the iPod Classic.
    Connect the iPod to the Mac, (if iTunes launch, please close it back.)
    Use Disk Utility -> select the iPod Device->First Aid->Repair (use option FAT32)
    After the Repair complete, eject the iPod.
    Connect back to the Mac
    When iTunes launch, Restore the iPod when Prompted, (use FAT32)
    Sync your library.
    Good Luck!

  • Sometimes when I play songs in Itunes by double clicking on them, Itunes will place the song as the first one on the album.  It will chnage the order of the songs on the album, and I can not switch them back to the correct order.

    Sometimes when I play songs in Itunes by double clicking on them, Itunes will place the song as the first one on the album.  It will chnage the order of the songs on the album, and I can not switch them back to the correct order.  This onloy seems to happen when I double-click on the song to play it in itunes.  If I just hit play, this doesnt happen.  As a result, I have several albums now in which the songs are in the wrong order.  Its very frustrating, as this error then transfers over to my ipod every time I sync it.  When I choose the info. for the songs, it has them correctly listed (i.e., it lists the songs as being #1 of 19 on the CD, for example).  But then the song will have placed by Itunes as #5 of 19 for whatever reason.  Itunes does not do this every time, but does it with enough frequency to be maddening.  Any thoughts?

    The problem of tracks becoming de-linked between iTunes and the music files in your iTunes music folder happens for different reasons - this seems to come up fairly commonly in this forum.
    The solution can be to locate each song in the iTunes library, as you mentioned - or, but wait, before I get to that...
    trouble finding the original track in your iTunes music folder? maybe look for it under compilations, or if not using the 'group compilations preference' then look in the folder under the songs artist name, but what song artist name iTunes uses depends on what you have in the metedata tag spot for album artist or song artist. Any varyation in artist name spelling, in the menu item 'get info' metadata for any selected individual track will cause iTunes to create that as a separate artist folder in the library, even names like 'various' or any difference at all (even the word 'the' can change where in your iTunes music folder a track gets placed by iTunes). You can try to use the finder function of find file (finder munu item outside of iTunes) to locate hard to find items.
    Back to how to re-link any de-linked tracks .
    There may be scripts that can help re-link de-linked music files - or, at least provide you a list of such files, Scripts are easy to install and use...
    at Dougs Scripts, there is one called iTunes Track CPR that might work
    http://dougscripts.com/itunes/scripts/ss.php?sp=itunestrackcpr
    or, if you just want a list of de-linked tracks, go to
    http://dougscripts.com/itunes/
    and find the script called List MIA's, this will create a text file listing all de-linked tracks
    if you review the thread at
    https://discussions.apple.com/thread/3633708
    also the thread at
    https://discussions.apple.com/message/17513078#17513078
    you may find more insight into dealing with this kind of issue there, although some of that thread may not apply to your case, aspects of it might help.
    Good luck.

  • Is there a way to get the correct order from the dependent types of a sche

    Hi ,
    I have a CT facing the following problem:
    When trying to built a SQL script to create all the object types within a schema using the DBMS_METADATA packages.
    Did insert in a table the names of the types that will be exported following a concrete order, next loop into the table and call the DBMS_METADATA package for each row.
    These type are depedent between them, there are some type attributes calling other types and here the issue
    First : try to generate the order by created column of dba_objects and when the generated SQL script is launched a lot of type appearing as incomplete state due to the order isn't correct.
    Second : try to insert the table ordering by object_id colums of dba_tables view, it appears incomplete types too.
    Currently want to insert the table using a recursive query with connect by against the dba_type_attrs starting with the rows when ATTR_TYPE_NAME is not null (the types that are called by other types), but this way has a issue dificult to resolve: the roots of hierarchy are the rows when ATTR_TYPE_NAME is not null and we've dependencies between roots nodes
    The question is is there a way to get the correct order from the dependent types of a schema?
    Platform: IBM SP AIX
    DB version: 9.2.0.7
    Any help will be appreciated .
    Thanks in advance.

    The xxx_dependencies view should give you the dependencies betwee nthe various types. I would look at something along the lines of:
    SELECT object_name, referenced_name
    FROM (SELECT o.object_name, d.referenced_name
          FROM user_objects o, user_dependencies d
          WHERE o.object_name = d.name(+) and
                o.object_type = d.type(+) and
                d.referenced_type(+) = 'TYPE' and
                o.object_type = 'TYPE')
    START WITH referenced_name IS NULL
    CONNECT BY PRIOR object_name = referenced_nameThe outer join between user_objects and user_dependencies is required to generate the names of types which are not dependent on other types, or do not have other types dependent on them.
    HTH
    John

  • Photos synced from PC to iPad are not in the correct orientation or the correct order.

    Photos shot in portrait orientation are rotated on PC, but when synced return to original. Also, photos do not appear in the correct order.

    They will be in date modified order, with the Photos app you can't change the field that they are sorted by - you will need to adjust their date modified fields on your computer to be in the same order as date taken.
    Try deleting the photo cache from your computer and re-try syncing them and see if they are correctly oriented : iTunes: Understanding the iPod Photo Cache folder

  • When 40 subreports are added programmatically to a report the last subreport to be added is shown first while all other reports are in the correct order

    I am loading multiple sub-reports (up to 40) into a master report document using the Crystal SDK. This is accomplished by obtaining a reference to the detail area, adding a section to it, and then importing the subreport into the detail area. The master report does not contain a whereclause and contains no data other than the other sections so it is display only once.
    When I add the section to the master report I give an index of -1 so that it would always appear on the bottom in the report. This works until I print a report containing exactly 40 reports at which time the last section is shown at the top of the report. All other sections (and hence subreports) appear in the correct order. If I print less than 40 reports all sections are in the correct order. If I print more, the export process crashes as documented in Invalid Section Height when I load the nth subreport
    I am using Crystal Reports SDK 13.0.8. Visual Studio 2012. .NET 4.5.2.
    The pertinent bit of code is shown below. What might I be doing incorrectly? Is this a Crystal SDK bug?
    Thanks,
    Ryan
    private ReportDocument AddSubReportToParent(string subReportName, string fileName)
        try
            CrystalDecisions.ReportAppServer.ReportDefModel.ISCRArea headerArea = _crystalDocument.ReportClientDocument.ReportDefController.ReportDefinition.ReportHeaderArea;
            CrystalDecisions.ReportAppServer.ReportDefModel.ISCRArea detailArea = _crystalDocument.ReportClientDocument.ReportDefController.ReportDefinition.DetailArea;
            CrystalDecisions.ReportAppServer.ReportDefModel.ISCRArea footerArea = _crystalDocument.ReportClientDocument.ReportDefController.ReportDefinition.ReportFooterArea;
            CrystalDecisions.ReportAppServer.ReportDefModel.Section section = new CrystalDecisions.ReportAppServer.ReportDefModel.Section();
            // strip dots from name (any character that is not a number or letter causes a name/ID runtime error from the Crystal Reports SDK)
            string sectionName = "Section" + subReportName.Replace(".", "");
            section.Name = sectionName;
            section.Kind = CrystalDecisions.ReportAppServer.ReportDefModel.CrAreaSectionKindEnum.crAreaSectionKindDetail;
            section.Width = headerArea.Sections[0].Width;
           _crystalDocument.ReportClientDocument.ReportDefController.ReportSectionController.Add(section, detailArea, -1);
            _crystalDocument.ReportClientDocument.SubreportController.ImportSubreport(subReportName, _configSettings.InputPath + "\\" + fileName, section);
            ReportDocument subreport = _crystalDocument.OpenSubreport(subReportName);
            return subreport;
        catch (Exception ex)
            Logger.ErrorException(ex);
            throw;

    Hi Ryan
    The search string 'crystal net 40' (search box in top right corner, returns this KBA:
    2105208 - ER - CR .NET SDK has a Section limit set to 104 and subreport limit of 40
    SP 13 for "SAP Crystal Reports, Developer Version for Visual Studio .NET" can be downloaded here:
    SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow me on Twitter

  • How to make copied text appear in the correct order?

    I have a PDF document with text created from a Photoshop file.
    There were multiple text layers in this Photoshop document.
    Problem:
    When I do "select all text" in Acrobat and then "copy" and then paste it into a text editor the text is pasted out of order.
    This is somewhat expectable because of the multiple text layers in the original Photoshop file.
    Question:
    How can I tell Photoshop the desired order of the text layers when creating the PDF file?
    The layers are stacked in the correct order in the layer panel in Photoshop. I was hoping that was the issue, but it's not. Is there any other way in which I can specify the text order?
    Your help will be much appreciated!

    This is a screen capture taken of Acrobat XI Pro. In the left-hand side try right-clicking (or Ctrl-click on the Mac) ont he navigation pane and then choosing Content.

  • How to get photos in the correct order on the Ipad

    I am sure many people ask this but I have tried many methods and am unable to get my Ipad photos to be in the correct order in my albums. I have over 800 pictures and 4 folders and when I sync them they end up jumbled within my albums. On my windows PC in they are in the correct order i want them to be. I renamed all of them in the order. I also changed the date taken (They are set to the same date and time). Is there a way to fix these jumbled, out of order photos? It is just extremely frusterating... Seriously apple, you can create siri but you cant let us arrange our pictures, let alone delete them without hooking up to itunes??? Quite a disappointment! Anyway thanks for answering and your help! P.S. I have an Ipad 3

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

Maybe you are looking for