externalinterface

How do I pass information between Flash's ExternalInterface and JavaScript?

牧云@^-^@ 提交于 2019-12-06 14:39:06
How do i pass three arguments using external interface in flash to a java script function and get back output and display it in flash? import flash.external.ExternalInterface; var para:Array = new Array(); send_btn.addEventListener(MouseEvent.CLICK, clickListener); function clickListener(eventObj:Object ):void { para.push(mean.text); para.push(std.text); para.push(points.text); trace("click > " + para); var output =ExternalInterface.call("calc",int(para[0]),int(para[1]),int(para[2]) ); out.text = output; } this is the code i am using to call a function calc which takes three arguments in java

ExternalInterface not working in IE

不羁岁月 提交于 2019-12-06 13:39:01
问题 I am trying to call an action in a flash object from the javascript: as: function testExternalConnection(str:String):Void { _root.debug.htmlText = "testExternalConnection ok"; } ExternalInterface.addCallback("testExternalConnection", this, testExternalConnection); js: var movie = getFlashMovie("ap1_mod_hidden") movie.testExternalConnection(); with function getFlashMovie(movieName) { var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? window[movieName] : document[movieName

ExternalInterface in Chrome

匆匆过客 提交于 2019-12-06 12:30:34
I would like to call js function via ExternalInterface from as3 code LOCALLY, not on remote server. All browsers work great but not Chrome. Note that in flash-debug player version (C:\Windows\system32\Macromed\Flash\NPSWF32_11_9_900_170.dll, version 11,9,900,170) I have installed in Chrome it works. But in default flash player version (C:\Program Files\Google\Chrome\Application\33.0.1750.117\PepperFlash\pepflashplayer.dll, version 12.0.0.70) it doesn't work. PS: I've also tried to open my old project (with ExternalInterface) I've developed 2 years ago -> same issue. IDE I have used ->

How can I call an Actionscript function when the .swf is referenced by jQuery?

百般思念 提交于 2019-12-06 09:51:48
I have an .swf that I am embedding into HTML using the jQuery SWF Object plugin ( http://jquery.thewikies.com/swfobject ). I have a number of functions within the .swf that I need to call from within javascript functions. I've made these actionscript functions accessible to javascript by calling flash.external.ExternalInterface.addCallback(). Yet nothing happens when I make the call. I've had this happen before and it seems to be that when you reference the .swf from jQuery, you can't call flash functions. Is there anyway around this (aside from not using jQuery)? Thanks. I had the same

Is it possible to debug ExternalInterface through file:// from Flash Builder?

左心房为你撑大大i 提交于 2019-12-06 09:20:53
I have a project written in ActionScript 3 using Adobe Flash Builder 4.5. It registers several functions in an ExternalInterface , so that they may be called from JavaScript. If I access the Flash document on a server, for example http://localhost/ , I am able to call the defined functions successfully. If I just open the file in my browser directly (through the file:/// protocol) it will fail with an error like this: *** Security Sandbox Violation *** SecurityDomain 'null' tried to access incompatible context 'file:///Users/foo/src/bar/baz/bin-debug/app.swf' A reasonable security restriction,

Is there a way to call a Javascript class method from ExternalInterface?

点点圈 提交于 2019-12-06 07:35:40
I can call JS functions with ExternalInterface.call('func_name',.args) . OK But what if I would like to call a js class instance method instead? ExternalInterface.call('obj.method_name',.args) //this seems not to work Is there any way of doing it? Luca It was only a matter of scope. You must instantiated the swf object outside the js class. Then I can reference it in ExternalInterface.call() . window.addEvent('domready',function(){ swf = new Swiff('../files/swf/italy.swf',{ id:'italy', container:'italy-flash', width:280, height:323, params:{ bgcolor:'#ffffff', wmode:'opaque', allowScriptAccess

How do I communicate between JS and AS3 in an AIR Android Application?

笑着哭i 提交于 2019-12-05 17:53:56
I am using ExternalInterface but I have never worked with it before so I don't know what really to do. I don't even know if ExternalInterface works with AIR Android . I am trying to implement the JS Google Maps API . At this point I am able to load the webpage with StageWebView. I can access the longitudes and latitudes values in JS but I need to access those values from AS3 when the selects a location on the map. Here is HTML: <!DOCTYPE html> <html> <head> <style type="text/css"> html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; } </style> </head> <body> <div id="map">

how to read a global javascript variable from actionscript

这一生的挚爱 提交于 2019-12-05 16:10:23
Given that there is a global javascript variable on my web page named myVar, how can I access the value of the variable myVar from within my flash movie using javascript? I see plenty of examples of using external interface in order to execute javascript from actionscript, but I am unable to find examples of returning values back into the flash movie using actionscript. Thanks in advance. I hope my question is clear enough. ExternalInterface works by allowing JavaScript to invoke an ActionScript function in the movie, and vice-versa. You can optionally receive a return value back from the

ExternalInterface not working in IE

自闭症网瘾萝莉.ら 提交于 2019-12-04 19:47:10
I am trying to call an action in a flash object from the javascript: as: function testExternalConnection(str:String):Void { _root.debug.htmlText = "testExternalConnection ok"; } ExternalInterface.addCallback("testExternalConnection", this, testExternalConnection); js: var movie = getFlashMovie("ap1_mod_hidden") movie.testExternalConnection(); with function getFlashMovie(movieName) { var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? window[movieName] : document[movieName]; } I'm including my flash using swfobject: <span id="ap1_mod_hidden"></span> <script type="text

Why does ExternalInterface breaks when I pass parameter with JSON like string?

99封情书 提交于 2019-12-04 16:53:57
问题 I have a very odd problem with Flash 10 and ExternalInterface. I am currently using a homemade bridge to use RTMFP with Javascript and whenever I try to pass data that contains JSON, I get a wierd Javascript error that comes from Flash : missing ) after argument list try { __flash__toXML(Flash.Utilities.A..."")) ; } catch (e) { "<undefined/>"; } It's impossible to get more information since this come from Flash and it's not bound to any Javascript file. To reproduce this problem you can use