473,396 Members | 1,785 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,396 software developers and data experts.

Flash return to JavaScript

43
So i got a question is it possible to do this
in my flash file is a button and when i press that button i what what flash would return to my javascript code that i pressed what button
so is it possible to do this and if it is how???
Jan 7 '09 #1
8 3450
Fary4u
273 100+
yes just assign javascript function in flash
it's works fine.
Jan 8 '09 #2
tader
43
and hot to do that can you write me a demo or something
Jan 8 '09 #3
Fary4u
273 100+
Expand|Select|Wrap|Line Numbers
  1. on (release, rollOver) 
  2. {
  3. getURL ("javascript:NewWindow.close(); void(0);");
  4.  }
  5.  
advance thing is create the function in html file & just call it on simple way.
Jan 10 '09 #4
chaarmann
785 Expert 512MB
let's say you inserted your flash with:
Expand|Select|Wrap|Line Numbers
  1.    <object id="MY_FLASH" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/s...ersion=5,0,0,0" width="402" height="190">
  2.     <param name='wmode' value='transparent'>
  3.     <param name=movie value="myFlash.swt">
  4.     <param name=quality value=high>
  5.     <embed src="myFlash.swt" quality=high pluginspage="Adobe - Adobe Flash Player" type="application/x-shockwave-flash" width="402" height="190" wmode="transparent" name="flashRedirect" swLiveConnect="true">
  6.     </embed>
  7.    </object>
  8.  
  9.  
into your html-page. Then you need to insert for example:

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT language="Javascript" event=FSCommand(command,args) for=MY_FLASH>
  2.  alert("You pressed" + command);
  3. </SCRIPT>
  4.  
Jan 13 '09 #5
gopan
41
getURL is not a good way to calling javascript function

its better to use ExternalInterface.call( );

Expand|Select|Wrap|Line Numbers
  1. if(ExternalInterface.available){
  2.    ExternalInterface.call("alert","This call is from flash movie!");
  3. }
  4.  
See Adobe Live Docs
Apr 23 '09 #6
NitinSawant
270 100+
@chaarmann

can you pls tell me how to call that FSCommand(command,args) from javascript??
May 18 '09 #7
ExternalInterface.addCallback()

Look up the Adobe documentation on it.
May 20 '09 #8
NitinSawant
270 100+
Thanks @unauthorized

Hello tader,
you can use JavaScript and Flash Integration Kit ( http://weblogs.macromedia.com/flashjavascript/ ),

Expand|Select|Wrap|Line Numbers
  1. http://weblogs.macromedia.com/flashjavascript/
it can call javascript from flash actionscript and vice versa.

regards,
Nitin Sawant
May 20 '09 #9

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

Similar topics

1
by: Eric | last post by:
I have the following code I am calling from a flash file. Everything works fine except that the string it returns for the file location does not include the slashes. It is returning...
6
by: Cliff R. | last post by:
Hi, I use a handy little Javascript Flash detection script on a number of sites (copied below). Usually works great, but I just started trying Firefox and it's not working. A few browsers are...
1
by: Nawed | last post by:
We are experiencing a browser freeze when implementing a large number of javascript calls. It seems that there is a random 'hiccup' which loses some data. This causes a disparity between client-...
1
by: Torunn | last post by:
Using javascript I'd like to run multiple istances of flash in order to watch differents video at same time. Is there anyone that can help me ? Thanks Torunn
4
by: kidalex | last post by:
I'm a programmer but I have never programmed in Action Script or very advanced JavaScript. So, please be gentle :-) I'm looking to develop a simple ( or is it? ) system with 2 parts to it: ...
1
by: teenIce | last post by:
Hi, I don't know in what forum should i post this discussion. I'm trying to communicate between flash and javascript and it works. But the problem now, I have to pass a string that had e.g...
1
by: skeem | last post by:
I am having issues viewing flash that has been inserted via javascript in Internet Explorer. I had to uninstall my flash about a week ago. I've since reinstalled flash and reinstalled flash player...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.