Solved

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

Posted on 2012-03-27
5
1,001 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

762 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