473,395 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How can I call Flash function using JavaScript?

forsiam
I've seen the example in
http://www.thescripts.com/forum/thread694359.html

but I still have problem about javascript. (I use SWFObject)

My Action Script
Expand|Select|Wrap|Line Numbers
  1. import flash.external.ExternalInterface;
  2.  
  3.  
  4. var success:Boolean = ExternalInterface.addCallback("thisMethod",this, test);
  5.  
  6. function test(){
  7.     displayTxt.text = "OK";
  8. }
  9.  

My Javascript & HTML
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="swfobject.js"></script>
  2. <SCRIPT LANGUAGE="JavaScript">
  3. <!--
  4. function pause()
  5. {
  6.     var flash = document.getElementById("mymovie");
  7.     flash.thisMethod();
  8. }
  9.  
  10. //-->
  11. </SCRIPT>
  12.  
  13. <div id="flashcontent">This text is replaced by the Flash movie.</div>
  14.  
  15. <script type="text/javascript">
  16.    var so = new SWFObject("test.swf", "mymovie", "200", "80", "8");
  17.    so.addParam("flashvars", "filename=music.mp3");
  18.    so.addParam("allowScriptAccess", "always");
  19.    so.write("flashcontent");
  20. </script>
  21.  
  22. <INPUT TYPE="button" value="Pause" onclick="pause()">
  23.  
have anything wrong? thank you
Jan 4 '08 #1
0 8503

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: kevin | last post by:
hi there, can you alter or give advice to the following code . I Basically want to detect for flash player 6 onClicking a button and if flash player is not correct write to screene bla bla bla you...
3
by: btopenworld | last post by:
I have a Flash movie with parameter 'autoplay' set to false. The movie is started using a Macromedia javascript function via onload. This is OK in IE but Netscape 6 doesn't run the movie - it...
1
by: Terry Haufler | last post by:
I am trying to swap/rotate random flash banners using the following Javascript code. I have 3 flash headers/banners. I can get it to open a page with a random header using...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
2
by: Anees | last post by:
Hi, i need to invoke a javascript function while clicking a button that is in a flash movie. i hav used geturl() to redirect the page to some other page. but is it possible to call a javascript...
13
by: mudgen | last post by:
I have a webpage that has two flash animations running. I also have a javascript script running that rotates 3 images and fades them in and out. To do the fading and rotating in javascript I am...
4
by: dupdupdup | last post by:
Hello there, im needed to develop a gallery for this website. im using hotspots to go to my frames in my flash Each hotspot goes to each frame. The flash is loaded properly. When i right click...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.