SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    NC
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Syntax error in class declaration extends MovieClip

    So, I'm trying to get used to OOP flash and I'm getting kicked even before I start.

    I have the beginning of the class which is implemented as such
    Code:
    class AuthorizeClass extends Movieclip
    {
    	
    }
    I have saved this in AuthorizeClass.as and include the class in test.swf like this:

    #include "AuthorizeClass.as"


    and I get this error:

    AuthorizeClass.as: Line 1: Syntax error.
    class AuthorizeClass extends Movieclip

    What gives?

  2. #2
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    class AuthorizeClass < Movieclip
    is how I've always seen inheritance in ruby..
    If you give someone a program,
    you will frustrate them for a day;
    if you teach them how to program,
    you will frustrate them for a lifetime.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2001
    Location
    Kaysville, UT
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. This is the Ruby forum - your question is about ActionScript.

    2. It has been a while since I used ActionScript, but since it is prototype based, here is how you'd do it:

    function AuthorizeClass(){
    }

    AuthorizeClass.prototype = new MovieClip();

    // Then add your methods like this:

    AuthorizeClass.prototype.newMethod = function(){
    // Do stuff
    };
    Spencer Uresk
    Rails App Hosting
    Cheap Hosting - Directory of hosting plans under $10/month!
    My blog: Tech and Java Articles


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •