Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

760 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

17 Experts available now in Live!

Get 1:1 Help Now