Solved

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

Posted on 2012-03-27
5
989 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML 5 or Flash 7 480
To integrate SSRS reports in flex 4.6 6 518
Google Chrome pepflashplayer.dll 8 125
Trying to contour a nose in a face portrait in After Effects 5 98
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. …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

867 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now