07.07.07

Flash CS3 / Flex 2 Error #1017

Posted in errors, Flash, Flash Remoting, quicktip at 12:02 am by Curtis J. Morley

ActionScript 3 Error #1017: The definition of base class ImportedClass was not found.

Description 1
You may get this error from importing a custom class that does not have the proper package path into a parent class. Another reason you will get this error is if you forget to import the Class that the subclass is extending(see example 2).

Bad Code 1
(subClass called ImportedClass)

package
{import flash.display.MovieClip;
public class ImportedClass extends MovieClip
{
public function ImportingClass()
{
trace("Message");}}}

Parent Class called ImportingClass

package com.cjm
{
import flash.display.MovieClip;
import ImportedClass;
public class ImportingClass extends MovieClip
{
public function ImportingClass()
{
trace("Message");}}}

Good Code 1

(SubClass called ImportedClass)

package com.cjm
{
import flash.display.MovieClip;
public class ImportedClass extends MovieClip
{
public function ImportingClass()
{
trace("Message");}}}
ImportingClasspackage com.cjm
{
import flash.display.MovieClip;
import ImportedClass;
public class ImportingClass extends MovieClip
{
public function ImportingClass()
{
trace("Message");}}}

Bad Code 2

package com.cjm
{
//import flash.display.MovieClip;
public class ImportedClass extends MovieClip
{
public function ImportingClass()
{
trace("Message");}}}

Good Code 2

package com.cjm
{
import flash.display.MovieClip;
public class ImportedClass extends MovieClip
{
public function ImportingClass()
{
trace("Message");}}}

Description 2
ActionScript Error #1017: The definition of base class MovieClip was not found.
This ActionScript Error is due to forgetting to import the MovieClip (or any other  referenced class).

Bad Code 3

package com.cjm.sound
{
public class SoundControl extends MovieClip

Good Code 3

package com.cjm.sound
{
import flash.display.MovieClip;
public class SoundControl extends MovieClip

As always - Happy Flashing

8 Comments »

  1. curtismorley.com » New info on ActionScript Error #1017 said,

    February 10, 2008 at 5:43 am

    […] Flex / Flash Error #1017 has some new info.  I added the case where an import statement was forgotten. Check out code example 3 to see the solution to ActionScript Error #1017. […]

  2. curtismorley.com » Search Engine Optimization Example said,

    June 2, 2008 at 4:41 pm

    […] Flex 2 Error – #2 on Google […]

  3. frustrated said,

    December 7, 2008 at 3:42 pm

    huh?

  4. GettingStarted said,

    February 24, 2011 at 12:20 am

    ActionScript 3 Error #1017: The definition of base class MovieClip was not found.

    I dont get it why it appeared!!! Where do i go wrong?

  5. GettingStarted said,

    February 24, 2011 at 2:19 am

    solved ^^, missing import at beggining

  6. Melony said,

    September 28, 2011 at 12:22 pm

    I am getting a 1017 error on a project I am working on, and can not figure it out for the life of me. I can correct the error by taking the base class out, but then I cannot connect my file to the appropriate actionscript file to run that particular function. I have already been working on this way too long. Here is an example of the code I am using;

    package com.threedify.im
    {
    import flash.display.SimpleButton;
    import flash.events.MouseEvent;
    import flash.events.*;

    public class TimelineButton extends SimpleButton
    {
    public var action:TimelineOperation;

    public function TimelineButton() {
    action = new TimelineOperation();
    this.addEventListener(MouseEvent.CLICK,clickFunction);
    }
    public function clickFunction(me:MouseEvent){
    if (action!=null) {
    action.performOperation();
    }
    }
    }
    }

    It should also be noted that in my project, I have adjusted the symbol properties to the following settings;

    Class: roundedgreenstop
    Base Class: com.threedify.im.TimelineButton

    and have enabled the export for actionscript and export in frame 1 options.

    Any help would be greatly appreciated. Thanks in advance. By the way I love your site and use it on a daily basis.

  7. Melony said,

    September 29, 2011 at 6:43 am

    I’m having some issues with this error that I can’t seem to correct. Here’s the code for the base class;

    package com.threedify.im {
    import flash.display.MovieClip;
    import flash.text.TextField;

    public class SceneSequence extends MovieClip {
    public var chapterTitle:String;
    public var subheading:String;
    public var main:Main;

    public var chapterTitleField:TextField;
    public var subheadingField:TextField;

    public function SceneSequence() {
    x=205;
    y=22;
    chapterTitle = chapterTitleField.text;
    subheading = subheadingField.text;
    trace(“Scene Sequence Created for ” + chapterTitle + ” – ” + subheading);
    trace(“parent is..?”);
    }

    }
    }

    Did I not import my base class properly? I am using flash cs4 and selected the export for action script and export in frame 1 options, I also used SceneSequence1as my class and com.threedify.im.SceneSequence as my base class. Then I get this error. How can I fix this? Please help.

  8. Melony Malo said,

    October 4, 2011 at 6:51 am

    I solved this error by correcting a filepath that had been previously used and was no longer current. com.threedify.im.TimelineButton became im.TimelineButton and it worked fine. Same for SceneSequence. Mental note, check your file paths before beating your head against the wall….LOL

Leave a Comment