Solved

The definition of base class EventDispatcher was not found. but it's imported, right?

Posted on 2012-03-27
5
995 Views
Last Modified: 2012-04-02
I have code that looks something like this

import flash.events.*;

//Blah blah, some code here

class StyleEventDispatcher extends EventDispatcher
{
  //etc etc

And I am getting the error: The definition of base class EventDispatcher was not found.

Since the EventDispatcher is supposed to be in flash.events, why is it telling me this? This is my first flex project so do I need to do something to tell it where the flash package is? Shouldn't it be there by default?

Thanks.
0
Comment
Question by:TommySzalapski
  • 2
  • 2
5 Comments
 

Expert Comment

by:minisharma17
ID: 37775058
Hi I have tried this and it is working fine. I don't know what you have written. If you send me the code then i will check.



import flash.events.*;
      
      public class Test1 extends EventDispatcher
      {
            public function Test1()
            {
                  //xyz();
            }
             
            public function xyz():void
            {
                  this.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true));
            }
      }
0
 
LVL 29

Expert Comment

by:dgofman
ID: 37777102
Make sure you are using ActionScript 3 not 2 in your settings
0
 
LVL 37

Author Comment

by:TommySzalapski
ID: 37777961
I went through all the settings in Project->Properties and don't see that one.

I went through and added explicit references to everything (i.e. changed EventDispatcher to flash.events.EventDispatcher) and it cleared up those errors but I still don't see why it would do that in the first place.
It does other odd things that make me thing some setting is off because it also complains about Date().getTime(). It keeps saying that getTime is an undefined property of Date(). So it's acting like it's using the wrong date class.

The whole code is very large and interconnected so I don't know if I can get an example up. Also even though it's so easy to decompile, they don't want me posting the code. I'll use obfuscation tactics when I get it working to help them with the proprietary nature of their code.
0
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 37791283
Save your project as FLA for CS4 and attach to here. I think your are using old Flash Player in your settings be sure is 9 or 10
0
 
LVL 37

Author Comment

by:TommySzalapski
ID: 37795768
Yes. I had been compiling it in compatibility mode for an older version of Flash since that was what the original was built in. Switching everything to the newest version of Flash seems to have fixed those errors.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question