4 Replies Latest reply on Nov 2, 2007 2:45 PM by kglad

    Checking for existence of object

    RGracia Level 1
      I need to write a function to check if a NetStream object with the name "stream" has been created yet and then act accordingly based on if yes or no. Is it possible to check for that in ActionScript 3.0?
        • 1. Re: Checking for existence of object
          kglad Adobe Community Professional & MVP
          yes, but you may need to do something to quiet the compiler:

          • 2. Re: Checking for existence of object
            RGracia Level 1
            Thanks kglad. That would be ideal. Let me describe a bit what my scenario is:

            I have a main timeline (flash file) with some labels. there's a menu system that serves as navigation for all the available sections of the site, which will potentially be many. depending on the section being looked at, let's say for instance, you are currently in section 2, and at that frame label I have a video/bio movie clip with subsections controlled by frame labels as well. The code that starts the video is in the timeline of the video/bio movie clip. what I want is to device some code that will detect if the stage at the current label contains the video/bio mc and if that video is playing, then stop close that NetStream object when another selection is made on the main menu.
            • 3. Re: Checking for existence of object
              RGracia Level 1
              Right now when you move to another section (frame label) the video continues to play if it was playing before.
              • 4. Re: Checking for existence of object
                kglad Adobe Community Professional & MVP
                if you know the path/name of your NetStream instance, use the code i gave (with the correct path/name). or, just assume it's playing and close it and get it ready for gc, if it's no longer needed.