5 Replies Latest reply: Jul 26, 2011 7:59 AM by kglad RSS

    Similar concepts in Actionscript 3.0

    Kirubakaran Srinivasan Community Member

      Hi

       

      I would like to know onething over here that in AS3 we have many similar concepts like below followings

      These things are some kind of confusing concepts. If we understood these concepts very well then we can Optimize our coding by ingoring unwanted useages.

       

      1. Timer - setInterval
      2. EventDispatch - Dispatchevent
      3. loader - URLLoader
      4. overload - override
      5. Sprite - MovieClip - DisplayObject - DisplayObjectContainer

       

      If you know more than these things please and revert me back.

        • 1. Re: Similar concepts in Actionscript 3.0
          Desmond666 Community Member

          I said from the VERY start that I was new to Flash.

          I didn't say that I was totaly ignorant of any programming language. I have

          usded

          C/C++

          VB

          VB.NET

          C#

          to name a few

           

          I know about classes object orientated programming scope overloading 

          namespaces implcit and explict casting as well as interfaces.I know about 

          imports.

           

          Does anyone know what these do?

           

          import flash.display.Loader;

          import flash.utils.Timer;

           

          Because they are in my code and the following does not work

           

              var imageLoader:Loader;

          imageLoader = new Loader();  // Error dosen't understand previouse  line.

          var myTimer:Timer = new  Timer(2000,8);

          myTimer.addEventListener(TimerEvent.TIMER,  timerListener);  // Error

          dosen't understand previouse line.

           

          D:\MoveSlides\code\MovieSlides.as, Line 19 1120: Access of undefined 

          property imageLoader.

          D:\MoveSlides\code\MovieSlides.as, Line 21 1120: Access  of undefined

          property myTimer.

           

          My knowledge of programming says something is wrong here.

          Desmond

           

           

           

          In a message dated 26/07/2011 14:25:56 GMT Daylight Time, forums@adobe.com 

          writes:

           

           

          Hi

           

          I would like to know onething over here that in  AS3 we have many similar

          concepts like below followings

          These things are  some kind of confusing concepts. If we understood these

          concepts very well  then we can Optimize our coding by ingoring unwanted

          useages.

           

          1.  Timer - setInterval

          2. EventDispatch - Dispatchevent

          3. loader -  URLLoader

          4. overload - override

          5. Sprite - MovieClip - DisplayObject -  DisplayObjectContainer

           

          If you know more than these things please  and revert me  back.

          • 2. Re: Similar concepts in Actionscript 3.0
            kglad CommunityMVP

            :

             


            1. Timer - setInterval

            use the timer class.  you're less likely to have a scope problem.
            2. EventDispatch - Dispatchevent

            use dispatchEvent() to dispatch an event.

            there is no EventDispatch.  there's an EventDispatcher class that consists of objects that can use dispatchEvent().

            3. loader - URLLoader

            use the Loader() class to load a displayobject (like a bitmap or swf) and use the URLLoader() class to load data (like xml, text and call executables)
            4. overload - override

            use override to replace an inherited method

            overloading can't be done in as3.
            5. Sprite - MovieClip - DisplayObject - DisplayObjectContainer

            roughly:

            DisplayObject:  anything that can be added to the stage which includes all below

            DisplayObjectContainer:  anything that can be added to the stage and can contain child objects

            Sprite:  a displayobjectcontainer that can be dragged

            MovieClip:  a sprite with a timeline

            details:

            check each class in the help files.  as you move from top of my listing to the bottom you'll see each class adds more properties, methods and events.

            • 3. Re: Similar concepts in Actionscript 3.0
              Desmond666 Community Member

              use the timer class.  you're less likely to have a scope  problem.

              as in

              import flash.utils.Timer;  ???

               

              Desmond 

               

               

              In a message dated 26/07/2011 14:44:44 GMT Daylight Time, forums@adobe.com 

              writes:

               

              use the  timer class.  you're less likely to have a scope  problem.

              • 4. Re: Similar concepts in Actionscript 3.0
                Kirubakaran Srinivasan Community Member

                Hey guys

                 

                 

                Here i dont want any explanation. but i need more similar topics like the below topics

                 

                Only this thing i m expecting from this discussion.

                 

                1. Timer - setInterval
                2. EventDispatch - Dispatchevent
                3. loader - URLLoader
                4. overload - override
                5. Sprite - MovieClip - DisplayObject - DisplayObjectContainer

                 

                 

                No explanation, only needs more similar concepts/topics in AS3.0

                • 5. Re: Similar concepts in Actionscript 3.0
                  kglad CommunityMVP

                  please mark helpful/correct responses, if there are any.