externalinterface

How do I access the global object (window) using webpack?

你。 提交于 2019-12-04 15:57:42
问题 I'm trying to interface ActionScript with JavaScript using ExternalInterface and webpack. ExternalInterface can only provoked ( call ) functions found on the global object ( window ). How can I get a webpack module reference on window (global object)? Allow me to elaborate some, I want to have a namespace for the company ( window.companyName ) with an interface for ExternalInterface : window.companyName = { isReady: function() { ... }, driver1: function() { ... }, driver2: function() { ... }

Accessing an ActionScript function via Javascript

与世无争的帅哥 提交于 2019-12-04 13:43:26
问题 I'm trying to call a function in an action script using the ExternalInterface.addCallback API, but I can't seem to get it to work. Here's what I have: ActionScript: //MyClass.as package { import flash.display.Sprite; import flash.external.ExternalInterface; public class MyClass extends Sprite { public function MyClass() { ExternalInterface.addCallback('getStringJS', getStringAS); } public function getStringAS():String { return "Hello World!"; } } } NOTE: I'm compiling this into an swf using

C# and Flash communication

对着背影说爱祢 提交于 2019-12-04 13:32:47
Is there any way for C# to get a list of the methods the swf exposes through ExternaInterface? Steffen Opel Update: Just realized that I've misread your question as you are looking for methods defined via the Flex ExternalInterface class rather than those of the Shockwave ActiveX control itself; I'm gonna keep my original answer below as it might still be helpful regarding SWF usage via C# in general. Concerning ExternalInterface I don't have an answer right now, but you might look into Fun with C# and the Flash Player 8 External API to get an idea on how to use this API via C# in the first

Actionscript3 to JavaScript communication: best practices

亡梦爱人 提交于 2019-12-04 06:47:19
On a more abstract level then a previous question , in my experience there are 3 ways to call a javascript function on an html page from an embedded .swf using AS3: ExternalInterface, fscommand, and navigateToURL. Let's compare and contrast these methods (and maybe others I haven't listed) and talk about the pros and cons of each - right now, ExternalInterface seems like the way to go in terms of flexibility, but is it right for all situations? Are there concrete benefits in terms of execution speed or anything like that? I'm curious - what do we think? Matt W ExternalInferface was created to

AS3 ExternalInterface call using jquery

血红的双手。 提交于 2019-12-04 05:27:07
I'm calling into a flash app embedded in a html page using the ExternalInterface. The following code works fine (I'm using a button to test): $(document).ready(function(){ $("#button").click(function(){ var app = document.getElementById('ApplicationID') console.debug(app) app.pageUnloading() }) }) So this calls into the flash app fine and prints: <embed id="ApplicationID" width="600" height="400" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" allowscriptaccess="sameDomain" name="FlexMoeders" bgcolor="#cccccc" quality="high" src=

Send array from Flash (AS3) to JavaScript

时间秒杀一切 提交于 2019-12-04 04:22:52
Is it possible to send an array from Flash (AS3) to JavaScript using an ExternalInterface call? I currently am calling a function multiple times from a 'for each' loop inside Flash but it goes too fast for the JavaScript to keep up. My idea is to create an array of the attributes, pass that to the JavaScript function and then to loop through that in the JavaScript. Thanks, Josh Further to the suggestion of using JSON, this should be faster for small arrays and wouldn't require the use of eval or an external library to parse. Join an array in a string like this in flash: item1|item2|item3|item4

Javascript to flash via ExternalInterface

给你一囗甜甜゛ 提交于 2019-12-03 20:48:01
I'm wondering if someone could look over my code. I'm trying to pass a dummy variable from javascript to actionscript 3 with the following code: HTML: <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="music_player" width="500" height="375" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> <param name="movie" value="music_player.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#869ca7" /> <param name="allowScriptAccess" value="always" /> <embed src="music_player.swf" quality="high" bgcolor="#869ca7" width="500" height="375"

How do I access the global object (window) using webpack?

和自甴很熟 提交于 2019-12-03 10:02:53
I'm trying to interface ActionScript with JavaScript using ExternalInterface and webpack. ExternalInterface can only provoked ( call ) functions found on the global object ( window ). How can I get a webpack module reference on window (global object)? Allow me to elaborate some, I want to have a namespace for the company ( window.companyName ) with an interface for ExternalInterface : window.companyName = { isReady: function() { ... }, driver1: function() { ... }, driver2: function() { ... } } The ActionScript will drive my JavaScript. The more fundamental question is, how do I set globals

Flash SWF not initializing until visible - can I force them to initialize?

∥☆過路亽.° 提交于 2019-12-03 08:55:50
I have an application that needs to render about 100 flash graphs (as well as other DOM stuff) in a series of rows that vertically extend many times beyond the current visible window - in other words, the users have to scroll down see see all the different graphs. This application is also dynamic and when a user changes a value in the DOM (anywhere on the page) it will need to propagate that change to all the Flash graphs at the same time. So I setup all the externalInterface callbacks and was careful to not let any JS start going until the ever-so-important "flashIsReady" call and...it worked

Javascript to Flash communication doesn't work

北城以北 提交于 2019-12-02 10:10:10
I'm trying to control a flash player from javascript, i did as i saw on the internet and i get an "not supported" error here what i've wrote: on js: function getFlashMovieObject(movieName) { if (window.document[movieName]) { return window.document[movieName]; } if (navigator.appName.indexOf("Microsoft Internet")==-1) { if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; } else // if (navigator.appName.indexOf("Microsoft Internet")!=-1) { return document.getElementById(movieName); } } function SetNum1() { var x=getFlashMovieObject("flashmovie"); x.Setvariable(