3 Replies Latest reply on Jul 28, 2006 8:01 AM by Peter Lorent

    Some component questions

    fred_sl Level 1
      I have some questions but I would also like to know if what I've learned is accurate.

      Linkage Identifier versus Class Name

      When you create a symbol, you can set Linkage Identifier and AS 2.0 Class name. I believe the identifier is how you reference a symbol in the Library from ActionScript . And the Class name is what links a symbol to a file storing the class definition (.as file). I'm wondering if anyone knows why two names are needed. Why wouldn't Flash developers make Linkage Identifier automatically identify the class file and class name (if it exists)? Can anyone explain why both are needed? Also, is there any problem with setting Identifier and Class name to the same string?


      new() versus UIObject.createClassObject()

      I understand I can create a new object with new MyClassName() and I can also call UIObject.createClassObject(MyClassName...). What's the difference? The only thing I can think of is the first type of class either has no graphic elements or consists of dynamically rendered/created graphic elements. And, the second type has static graphic elements designed on the Flash stage.


      Component compiled clip versus Movie Clip compiled clip

      I believe the only difference between these two is that a component is linked to a class definition in an .as file?


      Loader component versus MovieClip.loadClip

      Is Loader generally better than creating an empty MovieClip and loading content into that?
        • 1. Re: Some component questions
          Peter Lorent Level 2
          >>Why wouldn't Flash developers make Linkage Identifier automatically identify the class file and class name (if it exists)?
          You can link just one class to a movieclip symbol but you can link the class to as many individual movieclip symbols as you want/need. Having the same name for class and movieclip symbol would prevent that.

          >>Also, is there any problem with setting Identifier and Class name to the same string?
          No. (and you could have easily tested that btw)

          >>I understand I can create a new object with new MyClassName() and I can also call UIObject.createClassObject(MyClassName...). What's the difference?
          You use createClassObject to dynamically attach components to a timeline at runtime where the new keyword is used to init an instance of a custom object.

          >>I believe the only difference between these two is that a component is linked to a class definition in an .as file?
          It's up to you whether you want to compile with code in the movieclip or with seperate class files.

          >>Is Loader generally better than creating an empty MovieClip and loading content into that?
          It's not a question of better but of ease of use. The components are predefined pieces of software so you can easily add the functionality you need. At a small price: more bytes in your swf.
          • 2. Re: Some component questions
            fred_sl Level 1
            quote:

            No. (and you could have easily tested that btw)


            I did test it. I needed to know if it's poor style or could bring about negative side effects that I'm unaware of.

            Thanks for your answers.
            • 3. Re: Some component questions
              Peter Lorent Level 2
              You're welcome.

              >>I needed to know if it's poor style or could bring about negative side effects that I'm unaware of
              Ok. Not that I know of. I usually don't assign the same name.