Skip to main content
gizmorattler
Participating Frequently
November 30, 2009
Answered

The class or interface could not be loaded...?

  • November 30, 2009
  • 2 replies
  • 9961 views

I'm doing a simple link code. I've tried many diferrent ways to do this but this error keeps comming up saying The class or interface could not be loaded...

home_btn.addEventListener(MouseEvent.CLICK, gotoURL);

function gotoURL(event:MouseEvent):Void

{
navigateToURL(new URLRequest("my site"));
}

This is the most recent method I've tried in doing this. I've tried changing the publishing settings of the document to and from Action Script 3.0- using an import command. But thats too complicated. I know this is simple... but can anyone please help?

This topic has been closed for replies.
Correct answer kglad

1.  that is as3 so, you must publish for as3.

2.  "my site"  should be replaced by "http://www.adobe.com" or something more appropriate to your needs.

3.  upload your html and swf (and possibly js) files to your server and test.

2 replies

gizmorattler
Participating Frequently
December 10, 2009

OMG! I just figured it out!

I was trying to create an id name for the objects I wanted to be linked onstage by using the text input box in the properties panel in flash.

When I tried clicking the swap button and creating a duplicate file from each object I wanted to link and then nameed the copies as the id names I scripted in As3... It just worked!

Thanks for all of your help, I really learned how to troubleshoot more effectively

kglad
Adobe Expert
December 10, 2009

you're welcome.

kglad
kgladCorrect answer
Adobe Expert
November 30, 2009

1.  that is as3 so, you must publish for as3.

2.  "my site"  should be replaced by "http://www.adobe.com" or something more appropriate to your needs.

3.  upload your html and swf (and possibly js) files to your server and test.

gizmorattler
Participating Frequently
December 1, 2009

Thanks, but whenever I change the publish settings back to As3 the flash tween gets caught in a loop and it doesn't end, it just re-runs the swf over and over again. I'm not sure how to fix this problem now.

I even tried to add a stop(); at the beginning of the new script.

stop();
home_btn.addEventListener(MouseEvent.CLICK, gotoURL);

function gotoURL(event:MouseEvent):Void

{
navigateToURL(new URLRequest("http://www.knirv.com"));
}

I'm still getting an error message saying "1046: Type was not found or was not a compile-time constant: Void."...However, I'm sure your advice to upload to my server will solve this. Much thanks for the expertise

kglad
Adobe Expert
December 1, 2009

Void should be void.

and you need to publish for as3 if you want that code to work.

if you want to publish for as2, you need to use as2 code.