Introduction to Actionscript 3 Classes in Flash - Part 2 of 2 (by Nils Millahn)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,754
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 10, 2010

http://dndigital.net/training

This is a quick introduction on how to write and use external Actionscript 3 classes in Flash. It provides a good reference point for getting to grips with object oriented programming in Actionscript 3. The video demonstrates how to write an external class file to a MovieClip and add roll-over behaviour.

This is Part 2, of 2.

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (DNDigital)

  • Great tutorial! Do you have one on referencing functions from other classes? I've been struggling with that concept. Also on the This keyword. It's all confusing me very much at the moment...

  • @CillersFan Hi again - and thanks for the positive feedback. Have a look at the TweenLite videos, the Factory Pattern video and the Animated Menu for referencing other classes. It's actually very easy - just use 'dot-notation'!. "theOtherClass.theFunction()". The 'this' keyword is even simpler - it simply refers to the object that the code is in. Literally 'this', as per its English usage. You only need it rarely in AS3, in AS2 it was much more important. Hope that helps & happy coding!

  • CS4. No linkage button. Right click properties and it gives me the linkage. I click the pencil and it brings up Football.as. I publish and get 5007: An ActionScript file must have at least one externally visible definition . I right click in library and flash.display.MovieClip that was there in base class has now disappeared. I Click base class. "Base class specified is a native class and will be defined in the player at runtime. Can not be edited" If I save Football.as and reopen, it works. :(

  • @YouSpamTard Base class can't be edited, that is normal - and if you specify a custom class you don't normally need the base class. The 5007 error means that there is no class defined in Football.as. Make sure that you start with 'package' definition and then 'public class Football extends MovieClip'. It's a bit difficult to diagnose this one from afar but hopefully that will get it working.

  • My brain hurts

    BUT IT WORKS! :D

    Thanx!

  • @aNdYmAtTeR I guess 'no pain - no gain' does ring true after all :) Keep persevering!

see all

All Comments (24)

Sign In or Sign Up now to post a comment!
  • @samoguz0 Thank you for the positive feedback - I'm glad you're enjoying it! Happy coding :)

  • THANK YOU !!!!!!

    You are an awesome teacher. I understand perfectly everytime I watch your videos. You are really helping me to learn actionscript3. :)

  • @evaunitzero1 Ha ha - that really made me laugh :) As an American you would hold Arnie quite close to your heart too though I reckon? In any case, glad that you're enjoying the tutorials and let the language debate rage on!

  • he sounds more like and indian brit, which as an american, i think is an interesting accent. i like it :) Also THANK YOU for your wonderfully explained AS3 tut!

  • Loading comment...
Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more