Copy link to clipboard
Copied
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?
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 ![]()
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
ok I got it... I'm publishing for as3. I changed the Void to void... but now my whole presentation is gone... All I see is the stage but I still hear the sound of the presentation.... lol this is crazy. if it's not one thing its the other. There are no compile errors but this error message comes up in the output tab:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Flashfla_fla::MainTimeline/frame1()
Copy link to clipboard
Copied
click file/publish settings/flash and tick "permit debugging". retest. you'll see a line number in the error message. there's an object in that line of code that doesn't exist when the code executes.
if you can't figure out how to solve the problem with that info, paste the problematic line of code.
Copy link to clipboard
Copied
Thanks, you helped me with the missing object part thus far. We figured out that I was publishing As3 code with As2 settings. We also fixed the looping issue by changing the Void to void. I've set those settings to the suggested parameters, however the presentation is still blank when I run the script...yet I can hear my audio. I have included the file in this message... I'm just trying to get these buttons to link for my navigation bar. Heres the code I'm using for the home page link:
stop();
home_btn.addEventListener(MouseEvent.CLICK, gotoURL);
function gotoURL(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.knirv.com"));
}
Once again, the presentation shows a blank so I can;t even tell if the link is working or not at this point.
Copy link to clipboard
Copied
if you're seeing that null object error message and that's the only code in your fla, home_btn doesn't exist. click on the object on-stage that you think is home_btn and in the properties panel, enter home_btn. retest.
Copy link to clipboard
Copied
Thanks ![]()
I already have the button named as home_btn in the properties panel though.
I can hear the presentation, but I only see the blank stage.
Could it be anything else thats making the file run blank like that?
Copy link to clipboard
Copied
yes, there could other problems but you wouldn't see that null-obect message if you were correct: that object doesn't exist when code executes that references that object.
you can click file/publish settings/flash and tick "permit debugging" to see the line number of the null-object. perhaps you have other code you haven't revealed in this forum that's causing the problem.
Copy link to clipboard
Copied
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 ![]()
Copy link to clipboard
Copied
you're welcome.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more