Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-03-27
5
Medium Priority
?
1,032 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
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…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

721 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