Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-14-2002, 08:09 PM   #1
chibacity
Registered User
 
Join Date: Jan 2002
Location: London
Posts: 17
Question How do I call an ActionScript function from JavaScript?

Does anybody know how to call an ActionScript function from JavaScript code?

I would like to be able to call ActionScript functions from JavaScript code so that I can dynamically alter aspects of the loaded flash movie at runtime. Using ActionScript function calls would enable me to make an "API" for my flash movie/component.

Any help would be well apreciated.

Thanks in advance, Tim.

http://www.aterminal.freeserve.co.uk/binary.gif
chibacity is offline   Reply With Quote
Old 01-15-2002, 04:15 AM   #2
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

See the FS_Command Library tutorial.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 01-15-2002, 09:32 AM   #3
chibacity
Registered User
 
Join Date: Jan 2002
Location: London
Posts: 17
Default

The FS command tutorial is all well and good, but FS Command doesn't do what I explained in my mail.

I want to call an ActionScript function from JavaScript, not a JavaScript function from ActionScript - not a very subtle difference. I'm already using FS Command and getURL - as far as I can see, they can't do what I want.

I need to be able to target an ActionScript function from JavaScript and pass arguments to it.

If anyone knows how to do this, with some sample code if possible, I'd be eternally grateful.

Thanks, Tim.
chibacity is offline   Reply With Quote
Old 01-16-2002, 01:47 PM   #4
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

Ah, I'm sorry. I thought FS Command could in fact controll interaction both ways but I've been unable to find any info on it after searching.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 01-16-2002, 06:30 PM   #5
chibacity
Registered User
 
Join Date: Jan 2002
Location: London
Posts: 17
Default

FYI - there seems to be no "direct" way of calling an ActionScipt function from JavaScript code, however, the following is a link to a zip file which contains a sample project which achieves the same thing in a round-about way:

http://www.the-stickman.com/tutorial...fsfunction.zip

Chiba.
chibacity is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Javascript call a Flash function and pass parameters??? gloveny Other Flash General Questions 4 11-26-2004 07:20 AM
Can Actionscript call and run exe file located on the user's computer? janice_2k ActionScript 1.0 (and below) 19 07-09-2004 05:37 PM
I can't resart my streaming sounds after they've been paused! athomas ActionScript 1.0 (and below) 2 07-01-2004 04:18 PM
Call Javascript silently JScott ActionScript 2.0 1 05-25-2004 08:44 PM
enterframe and load and objects, oh my! dice ActionScript 1.0 (and below) 13 07-18-2003 12:07 PM


All times are GMT. The time now is 02:21 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.