How to detect last external item loaded?

I can't get my head around this. I know there's a clever way to do this but none of my ideas seem to be the solution. I'd like to dispatch an event when there are no more items to be loaded. I'm working with Drupal and AMFPHP and loading some nodes. The number of nodes may vary from day to day so I need a way to know when the last one has loaded.
In the code below, I am building an array to use elsewhere in the application. Once all nodes have finished loading I'd like to know what the final length of portfolioItems is.
public function onNodeLoad( node:Object )
   //trace("Node loaded");
   if (node.nid == 2) {
          about.aboutText_txt.htmlText = node.body;
   }else {
          var nodeStr:String=baseURL;
          nodeStr+=node.flashnode["filepath"];
          portfolioItems.push(nodeStr);
          portfolio.portItems = portfolioItems;   

Aha, good point! Thanks for the knock in the head.
I can set a counter on the event handler for the View Load, which is where the node loading gets kicked off. Then check to see if I've reached that last item inside the Node Load handler. I'm posting if anyone else needs an example like this.
var loadCounter:Number = 0;
// Called when a view gets loaded.
  public function onViewLoad( _view:Object )
   // Iterate through all of the nodes.
   for each (var node:Object in _view) {
    loadCounter ++;
    // Call Drupal to get the node.
    drupal.loadNode(node.nid, onNodeLoad);
   showAllElements();
// Called when Drupal returns with our node.
  public function onNodeLoad( node:Object )
   if (node.nid == 2) {
    //trace(node.body);
    about.aboutText_txt.htmlText = node.body;
   }else{
     var nodeStr:String=baseURL;
     nodeStr+=node.flashnode["filepath"];
     portfolioItems.push(nodeStr);
    if(portfolioItems.length == loadCounter){
          portfolio = new Portfolio();
          addPortfolio();
          portfolio.portItems = portfolioItems;

Similar Messages

  • How to detect if an item of JComboBox is highlighted?

    Good day.
    How to detect if the selected item of a JComboBox is highlighted or not?
    Thanks for your response.

    the above code can only detect a highlight if an item is selected from the combo box.
    But when the focus is transfered to other Combo box it can no longer keep track if the item was highlighted or not.
    for example:
    combo box 1 combo box 2
    item item2
    Highlight should be detected wheneverr the focus is transfered from combo box 1 to combo box 2 or vice versa.
    case:
    Combo box 1 item is highlighted before transfering the focus to combo box 2 item. by the time the focus is transfered , highlight in combox 1 item should be detected.
    The main problem here is how to detect if the previously focused item is highlighted or not.
    thank you for your time.

  • How to determine Last Lite Item of a Main Window in SCRIPTS

    Hi All,
    I have a requirement <b>to print a value after all the Line Items have been printed in a main window.</b>
    The question is <b>how do I determine the end of Line Items</b>?
    Also, this needs to be done without a change in the print program.
    Please suggest your valuable opinions.
    Thanks & Regards,
    Arun

    Hi yerram,
    1. There is no direct way,
       to know which is the last line time getting printed,
       (from inside the sapscript)
    2. Bcos, the sequence is controlled by the driver program.
    3. What u can do is check the driver program and the layout,
       to detect,
       some ELEMENT
       which must be getting printed, after all the line items are printed.
      (inside that element, u can write your own
       text to get printed)
    regards,
    amit m.

  • How to detect an external application close event?

    Hello,
    I have an executable running at startup (scheduled task) and always
    staying alive on my server. When the server is rebooted, I would like
    to take some actions (write in a event log, etc) before my application
    is closed by windows.
    So how can I detect that Windows is closing and that it's time to do the associate actions before the closing.
    I've tried the 'Application close event' in an event loop but doesn't seems to work.
    I'm using labview 8.2 on Windows server 2003.
    Thanks in advance!!
    Vincent

    I tied this and it did capture the application close event.  What I did was while running LabVIEW in developer mode I used Windows Task Manager to kill the process.  It did throw an Application Close event.  I don't have time to try other cases like shutdown or what happens if it is an EXE but hope this helps.
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
    Attachments:
    appClose.vi ‏13 KB

  • How to detect if external display is present

    I need my code to evaluate whether an external display is connected via a mini-display port.
    Ideally, I'd like to do this by having a bash command that determines a boolean True/False value for the presence of a file. I'm just not sure what file I should be looking for, presumably something in /dev/
    Any suggestions what it should be, or suggestions of a better way to make the determination (anything in applescript, bash, objective-c, or plain-old c will do)?
    TIA

    This seems to cover the same issue:
    http://macscripter.net/viewtopic.php?id=28627
    From what I can tell at the moment, a full answer is going to have to be done in Obj-C, but a short Applescript like this will at least get the number of displays connected:
    tell application "Image Events"
         launch
              get properties of every display
         quit
    end tell

  • I have a PowerBook G4 with a non-functioning monitor.  It used to work with an external monitor, but I reinstalled the OS, which cleared the display preferences and now when I restart it won't detect the external monitor. How do I fix?

    I have a PowerBook G4 with a non-functioning monitor.  It used to work with an external monitor, but I reinstalled the OS, which cleared the display preferences and now when I restart it won't detect the external monitor. This means I can't use the computer anymore. How do I fix? I tried using the Command+F2 keyboard shortcut, but it doesnt' work.  It's possible that since I reinstalled the OS, it still needs to be set up, so there's only a welcome screen (but since I can't see it I'm not sure).

    There is no limit to the number of times you can re-install Office on the same computer.
    You can activate by telephone:
    The last paragraph is the relevant bit

  • How to detect the end of a loaded swf file

    Hello Guys
    This is my first time on this forum, come here with a great
    hope
    I have loaded a picture file (jpeg) and a video file (swf)
    into the main flash file using xml
    on frame 3, I load the picture and on frame 7, I load the
    video, there is a stop action on frame 6
    Now when the flash is executed the picture is displayed ( it
    says "Click here to view the video")
    when the user click the picture , the video is loaded and
    starts to play ---- so far everything is working fine
    now what I want to do is, once the video finishes playing (
    not stoped) I want to display the picture again
    can you tell me how to detect the end of an external loaded
    swf files,
    Please help me
    Thanking You
    Shriram

  • How do I have itunes use/detect my external hard drive and place music on the external drive from the itunes store? There are no music files on my pc yet.  I will like to do this after installing itunes 11 on my pc for the first time. I am using windows 7

    How do I have itunes use/detect my external hard drive and place music on the external drive from the itunes store? There are no music files on my pc yet.  I will like to do this after installing itunes 11 on my pc for the first time. I am using windows 7.  HP computer intel Dual Core.  Thanks for any help!

    Hey idw3,
    Welcome to Apple Support Communities, and thanks for the question. Follow the instructions on this article to move your iTunes Media folder to an external hard drive:
    iTunes for Windows: Moving your iTunes Media folder
    http://support.apple.com/kb/HT1364
    Regards,
    David

  • How do I stop ITunes from loading songs into library when played from an external hard drive

    How do I stop ITunes from loading every song I play into my library from an external hard drive?

    Mac OS X: Double-Clicking a File Opens the Wrong Application - http://support.apple.com/kb/TS2291
    -= Changing the application used to open all files of a certain kind (written with reference to OSX 10.4 but may not have changed) =-
    1) In a Finder window highlight a file of the kind you want to change the application to open that kind of file.
    2) While that file is highlighted, select File > Get Info or press command (apple or propeller icon) + i to get a file information window.
    3) In the lower part of the info window there is an "open with" menu with a list of applications.
    4) If your application is already in the box then it is the default application for opening that kind of file and you don't need to do anything more.  Close the get info window.
    5) If the application showing in the menu is not the one with which you wish to open the file then select a new application. If your application does not appear there then select the "other..." and track down the application (usually in the Applications folder at the main level of the computer).
    6) If you wish to change all files of this type to open with this application in future, make sure the "change all" button is selected.
    7) Close the get info window.

  • How to detect the content of a Loader?

    I would like to create a text field for the user to input the
    img URL which will be put into the contentPath of a Loader.
    I have a question that how to detect when the user entered a
    invalid URL and the loader will load the default image??
    Thanks so much

    well if you are using the MCL you can set up a function to
    handle the loadError event and trap the error and print it out or
    stick a default image in it's place. read up on the moviecliploader
    class

  • How can I return to the last selected item in a dialog box

    In OS 9 using Dreamweaver (for example) when I was adding images to a document, each time I added one the dialog box would return to the last selected image and I could just arrow down to the next in the list, add it (exiting the dialog box) and then repeat the process until I had added all the images in the folder. Now, using OS 10.4, after I add an image, and return to the add image dialog box it goes to the first item in the folder list instead of the last selected item. this really slows the process down, and when I'm adding 100 items or so, it's a real drag. I figure there has to be a way to get the dialog box to return to the last selected item, but I don't know what it is. Help!

    sorry, that is not what I want to do.
    I want to return to the initial state before I quit the app.
    Actually, I want to return to the intial state after I click a row in a table the second time.
    Sorry, I didn't say clearly.

  • How do I interact with a loaded swf?

    Hi,
    I have a "lesson" that I'm building that will display a series of "pages" based on an XML file. I have simple navigation buttons that work to page through the XML file. but I'd like to use load an external SWF file with buttons to use as my navigation panel. Everything is AS 3.0. The code to load the navigation movie looks like this:
    // load navigator
       navLoader = new Loader;
       navLoader.contentLoaderInfo.addEventListener(Event.INIT, handleInit);
       navLoader.x = 50;
       navLoader.y = 200;
       lessonSprite.addChild(navLoader);
       navLoader.load( new URLRequest("Navigator1.swf"));
    The loaded navigation movie has two buttons. How do I add an event listener to those buttons so that they call a function in the parent movie so I can detect when the user clicks on the button named "GoNext" in the loaded movie?  I've tried several ways but I've had no luck. Could someone please point me in the right direction? This navigation panel is only one application of this sort of communication that I'll need in other parts of this type of lesson so I really need to figure out how to detect user interaction interaction with the loaded movie. Guess I need to know how to call a function in the parent movie from the loaded movie.
    Thanks,
    Peter H.

    Hey Pete,
    The answer that you seek and the simplest one as well will be from the MouseEvent. that  you will most likely have applied to your loaded swf.
    As long as both swfs are in the same domain, you wont have any issues with security and therefor, the MouseEvent. which bubbles up, will be able to reach your swf file which has loaded it.
    You can then write your code in your loaded swf to simply listen to the loadedMovieClip  by targeting the contents of navLoader just like this,
    navLoader.content.addEventListener(MouseEvent.MOUSE_DOWN,onDown)
    protected function onDown(me:MouseEvent){
    now providing you have given your two buttons names in your loaded swf, you will be able to perform addition tasks by receiving the name of the target.
    protected function onDown(me:MouseEvent){
    var btnClip:Movie= me.target as MovieClip
              var btnName=btnClip.name
    if(btnName==(button1)){
         //do the following
    }else{
           //it was button two
    button1 was just a random name in this case .
    This will do the trick

  • Jammed after start up - login items load, but desktop is unresponsive

    When I start up my iMac, everything seems to load up, start up items load, but the desktop is totally unresponsive. Apps will not run, windows will not open, close, resize or move, menu does not respond. All I have is a frozen screen, nothing responds except the mouse cursor.
    Whilst the desktop is unresponsive, the Activity Monitor icon in the Dock shows sporadic activity and there is disk noise from the boot drive, indicating it is doing something.
    I have tried:
    - resetting the PRAM - no effect, unresponsive desktop as before
    - restarting in Safe Mode &amp; preventing start up items from loading - no effect, unresponsive desktop as before
    - starting up from my backup clone external hard disk ( made using SuperDuper) - starts up to the backup disk's desktop, then jams as before
    - starting up using the Recovery Partition, (10.8.2) created when I first installed 10.8 - jams on OSX Utilities screen, no options are selectable
    - starting up using an install disc that  I made on a USB stick (10.8.2)  - jams on OSX Utilities screen, no options are selectable
    The problem started soon after I updated Safari &amp; iTunes to the most recent versions yesterday 23 October 2013

    OK, I've answered my own question and now I feel really stupid not spotting the problem myself before asking for help.
    Answer: - the left button of my mouse (Logitech Perfomance MX) has stopped working !
    Hence, no response when I clicked or dragged. Everthing works fine with a different mouse, or after remapping "left click" to the right button of the Logitech. Interesting on how even the OSX Utilities screen and the Hardware Test rely on a (working) mouse to operate.
    Apologies for wasting people's time.

  • Why won't my mac detect an external display?

    I have a mac book pro - system OS X 7.3 - but when I plug my rocketfish adapter to HDMI cable to samsung TV - the TV says it gets no  signal. I've done everything the experts have said about connecting with the right specific order. But my display doesn't detect any external devices nor does it show any "mirrored" button. It isn't there any more.

    How do you know it's not recognized and how is it formatted?

  • Create a list style with unique space after the last list item?

    I should start by saying that I'm a web designer and therefore extremely used to using CSS for type setting to the point that I now become frustrated when going back to the print world
    So here's what I'm trying to achieve:
    - I want to create a list style for bullet lists
    - I want there to be 3pt space after and space before paragraph breaks
    - I want there to be 9pt space after the entire list (or last list item)
    I can't for the life of me figure out how to do this short of overriding the space after amount on the last item each time I use my style.

    Hi supportneeder
    Welcome to the forum.
    Try this link:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=179&mforum=iworktips ntrick
    Pay attention to how +"styles work by example"+. Form up the list levels the way you want them and then select them to make the list style.
    Personally I can't help remarking on the obtuse behavior of programmers that they manufactured all the problems on the internet and only now, more than a decade later, patch together "solutions" they struggle to implement due to the legacy of all the awful standards we never needed to have in the first place.
    Peter
    btw The last list item is always a problem in typesetting. Usually you deal with it by having a particular style for that or the paragraph afte,r all of which can take multiple forms.

Maybe you are looking for

  • Why doesn't Apple allow changing your AppleID username?

    i realize this subject is best sent to Apple Feedback ("Contact Us" link found at the bottom right of most pages on Apple's site). I post here to hopefully assemble others who have the same questions or concerns, with the ultimate result being a call

  • Installed new hard drive on Media Center m7434n now it freezes and hangs up. Help Please

    HP Media Center m7434n  with Windows XP Professional  Service Pack 3 installed.   It is hanging up and freezing.  I have downloaded new drivers, etc  but nothing is helping.    I am a novice and 80 yrs old.  Please help. Thanks,  bjh

  • How do I create an outline in illustrator?

    Hello All, I am trying to create artwork for printing and I have been asked to save the document as an eps file. This is the file: I need the sbsgroup to be an outline and be transparent in the middle...how do I remove the blue from the background? I

  • I takes ages for iTunes 8 to load...

    ... at least compared to iTunes 7. Even Photoshop CS3 and Final Cut Pro load faster! The icon bounces once, then the screen is blank for 20 seconds or so, and finally, the iTunes windows appears. In iTunes 7 I just clicked, and BOOM! i had my library

  • What version control system you use?

    We are 20 developer and we use bitkeeper as a version control system. But we have 4 envirronnement. dev/test/pre-prod/prod. Sometimes, 2-3 projects are affecting the same packages. And different packages version is all over the place since we have 4