homepage Welcome to WebmasterWorld Guest from 23.20.77.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Calling external javascript functions from within flash?
I need help calling a javascript function on a page from a flash movie
adamtaylor




msg:3374407
 8:42 am on Jun 21, 2007 (gmt 0)

Hi,

I have a small flash movie that loops through a few images and has an on (release) which opens a URL.

We also have javascript on the page, which checks to see if the link/URL a user browses to are part of the site and if they're not it popups a questionaire.

With the flash link this doesn't work, and it popups the questionaire even though it is an interal link.

I have written a small javascript function in the page to force the javascript to think the link is internal, however, I'm struggling to call this function from within the flash movie.

I've tried:

var externalFunction='javascript:set_internal_link';
getURL(externalFunction);

and

ExternalInterface.call("set_internal_link");

From with in the same on release () that opens the URL.

I added an alert() to my javascript function but it's not calling the function correctly.

Any ideas/help would be much appreciated.

Thanks,
Adam

 

the_kraken




msg:3374600
 12:58 pm on Jun 21, 2007 (gmt 0)

I haven't done that in a while, and I would have to check syntax, but have you tried storing your javascript in a .js file and calling that with getURL?

mattclayb




msg:3378637
 9:00 pm on Jun 25, 2007 (gmt 0)

can you not write the function in actionscript?
Post your full javascript function that you want to call.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved