externalinterface

User Agent is not accessible in Internet Explorer 8 using ActionScript 3

不羁岁月 提交于 2019-12-13 19:14:28
问题 I am using the code below to find the User Agent using ActionScript 3: var userAgent:String = ExternalInterface.call("navigator.userAgent.toString"); The code is working in Firefox 13, Google Chrome & Opera, but the User Agent value as null in IE8. Is there any code snippet that will work here or any other way to implement this? 回答1: toString is unnecessary, since userAgent is a string property. Use this syntax instead: var userAgent:String = ExternalInterface.call("function(){return

Bluetooth human device interface for reading digital input channels

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 02:34:22
问题 An idea is to make Win Mobile phone become super alarm for car. Now I am searching for devices simalr to Velleman interface board, but I need device which can be connected to mobile device using bluetooth trough compact framework and C#. I need digital inputs for caching real events such as engine started or door opened. Is there a way to interface mobile device with outside world using inputs with voltage. 回答1: First off you need a custom piece of hardware that will hook in to the ECM of the

How to expose the JavaScript interface for an embedded Flash object?

纵饮孤独 提交于 2019-12-12 18:13:46
问题 JavaScript and the Flash Player can exchange data via Flash's ExternalInterface mechanism: you register ActionScript functions that you would like to be able to be called from JavaScript. My question: How can I figure out what ActionScript functions of a Flash object are available for me to call from JavaScript (assuming they are not documented)? Is there a programatic way to do this in JavaScript? Thanks! 回答1: you can't enumerate them directly (they won't be listed in a for..in loop), but

Resize flash object from the browser without flickering

☆樱花仙子☆ 提交于 2019-12-12 04:22:40
问题 I was wondering how to achieve the native scrollbar effect which TheFWA (thefwa.com) has managed to do pretty well (I am not a fan of Flex scrollbars). I found this post (http://stackoverflow.com/questions/318675/how-can-i-create-a-flex-application-with-dynamic-height), and implemented the technique, as I am calling a JS function through ExternalInterface every time, when the flash object changes size. This JS function simply resizes the div which holds the flash object, which creates the

ExternalInterface

随声附和 提交于 2019-12-12 01:56:01
问题 Hey, so I'm having a bunch of trouble getting ExternalInterface to work, which is odd, because I use it somewhat often. I'm hoping it's something I just missed because I've been looking at it too long. The flash_ready function is correctly returning the objectID, and as far as I can tell, everything else is in order. Unfortunately, when I run it, I get an error (varying by browser) telling me that basically document.getElementById( <movename> ).test() is not a valid method. Here's the code:

externalinterface - calling javascript from SWF

点点圈 提交于 2019-12-11 19:36:21
问题 HI, im trying to call a javascript function from my actionscript code but its not working; as3: if (ExternalInterface.available) { try { ExternalInterface.addCallback("changeDocumentTitle",null); } catch(error:Error) js (inside velocity file using swfobject) function changeDocumentTitle() { alert('call from SWF'); } anyone know what could be happenin? 回答1: If you are trying to invoke a JS function from within your Flex app, you want to use ExternalInterface.call(...) and not ExternalInterface

ExternalInterface.addCallback not working in IE8 Flash 10.0 or below

天涯浪子 提交于 2019-12-11 08:58:05
问题 I have a small flash app that I load dynamically upon jQuery document.ready. It works in all browsers except for IE. When the installed version of FlashPlayer is less than 10.1, the callbacks added via addCallBack are not present. I've compiled the app with the mxmlc in flex 3.5 which the target player is 9.0.124 so it should work. I've built other larger flex apps and had no problems with ExternalInterface and IE. The app loads and the ExternalInterface.call method fires and IE responds, but

referencing the html object that made the ExternalInterface.call to the javascript function called

穿精又带淫゛_ 提交于 2019-12-11 06:17:59
问题 i apologize if my terminology is off, my actionscript skills are pretty weak sauce. so, i have some actionscript that makes a ExternalInterface.call('someFunction'); call. is it possible to reference the html object that made the call to someFunction directly using the ExternalInterface.call call? Assume that the object that makes the call also has some Callbacks (via ExternalInterface.addCallback) that are accessible via javascript. Currently: Actionscript source ExternalInterface.call(

How to pass a reference to a JS function as an argument to an ExternalInterface call?

女生的网名这么多〃 提交于 2019-12-10 19:09:11
问题 Summary I want to be able to call a JavaScript function from a Flex app using ExternalInterface and pass a reference to a different JavaScript function as an argument. Base Example Given the following JavaScript: function foo(callback) { // ... do some stuff callback(); } function bar() { // do some stuff that should happen after a call to foo } I want to call foo from my flex app using ExternalInterface and pass a reference to bar as the callback. Why Really, foo is not my function (but,

External interface and Internet Explorer 9 issue

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 18:51:50
问题 Boy-oh-boy do I hate external interface. I have a video player that utilizes external interface to control the flash object and to allow the flash object to pass messages to the same javascript. For a time it worked well in all browsers. Then a few days ago i went to go test it in all browsers before i moved the project out of development, and found that the application broke in internet explorer 9. The following error appeared in the console: SCRIPT16389: Could not complete the operation due