Javascript :: ExternalInterface Callback Not Working
Oct 26, 2011
I'm trying to call a function in my ActionScript from my JavaScript, I've managed to successfully do this with another flash file but in the current one it's failing for some reason. I'm using jQuery SWFEmbed, this is my JS code:[code]The ExternalInterface.call work, and the trace outputs true, I have no idea what's going on.If you could also tell me how I can pass parameters to a ExternalInterface callback.
View 1 Replies
Similar Posts:
Dec 5, 2011
Flex:
public function callFromJavaScript():String
{
test.label='dfdsfsdf';
return "1";
}
public function init():void {
[Code]...
I have no clue wich one are crossbrowser compatible (cant install IE to test out)I have tried multiple but i cant get them to work(in any browser), im probably using the wrong id, ive been trial & erroring for a couple of hours but i don't have anything working.(i heard there was a problem with ExternalInterface.addCallback on a local file system?, should i upload the swf? < is the flex code right& problem = javascript/html side?)
View 1 Replies
Aug 28, 2011
Here's my actionscript (compiled with mxmlc, embedded into html, and the functions are called with js):
[Code]...
View 1 Replies
Feb 6, 2012
I am having problems with External interface and IE9. The swf objects play fine but none of the information input is transferred to the cookies that should be set. I have seen that there are other questions similar to this but have not been able to solve my problem using them. THis is the html we are using
<div id="flashcentre">
<object type="application/x-shockwave-flash"data="http://workingflashlink" width="600" height="450">
[Code].....
View 1 Replies
Nov 4, 2009
This is my AC3 code
private function uploadet( dosya:String ):void {
var uploader:URLRequest = new URLRequest(dosya);
localFile.upload(uploader);
[code].....
View 4 Replies
Apr 12, 2011
I want to call a function inside a Flash movie from javascript, using the ExternalInterface class. The problem is that to get it to work with Firefox I need to use the embed element and with the rest I have to get the object element. To solve it, I gave different ids to that two elements and depending on the user agent I select one or the other:
function getMovie(movieName) {
alert(navigator.userAgent);
if (navigator.userAgent.indexOf("Firefox") != -1) {
[Code].....
This works, but it is not very elegant and it may not work with other browsers..
View 1 Replies
Jul 20, 2011
I am calling an Actionscript function from JavaScript and it works in all browsers except for IE9. I narrowed it down to the js function that retrieves the movie object:
<script type="text/javascript">
var swf;
...
[Code]....
View 2 Replies
May 26, 2011
I have a bizarre situation in IE where JS can't call up into flash using ExternalInterface after I hit "refresh". I know the movie is getting loaded and the code that does the ExternalInterface.addCallback() appears to be completing without any error Here's a rundown of the steps to reproduce:
Open IE and load up the movie for the first time, the ExternalInterface callback methods are available to JavaScript. If I hit refresh, the callback methods aren't available and I get the error Object doesn't support this property or method.If I clear my cache and refresh the page, they are available again.If I then hit refresh again without clearing my cache, they're unavailable.If I close the browser and reopen, they're available again.
I've run into this situation before and I'm pretty sure that the extra delay required to download and instantiate the swf is what's allowing ExternalInterface to get set up properly. The way I worked around this before was to add a random number to the end of the swf's url, so that it's never used from cache, but that's not a real solution.
[Code]...
View 2 Replies
Aug 2, 2011
I have avoided adobe products like the plague from when I was developing myself since it costs a fortune to buy and of their products, but big employers love it and pay for it so here I am. Our "Flash" guy just left the team and I inherited this issue. If you read my other post you know what is going on so I will move on. I want to make a simple call from actionscript to my javascript taht is referenced in my other post. I specifically want to call the CheckboxCollection function from inside of actionscript. I don't need to pass it any args or anything of the such from inside of actionscript.
All I need it to do is run that function once the flash is done loading. The javascript function will take care of everything I need, I just HAVE TO HAVE IT called from actionscript to make everything work in harmony. I am in the middle of teaching myself all things adobe and actionscript(much to my dismay), but I really have no clue where top go from here to make this work. I have reviewed adobe documentation, but until I have a better grasp of the language as a whole I am still lost. I copied most of my actionscript on to here, but I did leave out everything that had to deal with mouseover events, since my issue is not about a mouseover and they all work like a charm.
UPDATE: I had to stop working on this to get some other things done, but I am back to step one. NO matter what I do I am having no luck making this work. I have tried all suggestions on here, and tried everything I KNOW how to do, but I am having no luck. If anyone could take a look at this post and the one that I link to (It is the companion javascript for this) and see if they can come up with anything. I have tried so many different iterations of my code there is no use putting all of my trials up for example of what doesn't work,
/*
JavaScript External Calls
*/
function RegisterExternalCalls():void
{
if(ExternalInterface.available)
[code]....
View 2 Replies
Jan 14, 2012
As you can tell by the title, I am having some trouble with AS3 ExternalInterface and jQuery / swfobject.
[Code]...
It's giving the first alert ('init') but then not doing the last one. I'm completely baffled and hope someone can point out my mistakes! (there's bound to be a massively obvious one somewhere)
View 1 Replies
Dec 4, 2010
Basically, I have some functions in my as file. Some of them play with a mc instance. The instance is not available when calling the function that uses it as callback.
AS
function B(){
ExternalInterface.call('console.log','ok')//OK!!!
} //italy is a MovieClip on the Main timeline
function A(){ B();
ExternalInterface.call('console.log',italy)//Error!
} ExternalInterface.addCallback('test',A);
JS
$('flash').test();//flash is my html swf object
The error I get trying to reference italy from A (only) whem called from javascript:
Uncaught exception: Error in Actionscript.
Basically, the italy movieclip is available through the AS functions. But it isn't available if I call an AS function from javascript. As you can see though, I see B from A. It's only Italy that I can't see. why?
View 1 Replies
Sep 28, 2009
I have a Javascript API, which should be usable with GWT and Flex. Using the FABridge it is really easy to call Javascript methods from AS3 and vice versa. But when I try to register a callback to an AS3 method in my Javascript API I get stuck. Here is a short code sample:
[Code]...
View 2 Replies
Mar 24, 2010
I am pretty new to flex, so forgive me if this is an obvious question.Is there a way to open the Security.showSettings (flash.system.Security) with a callback? or at least to detect if it is currently open or not? My flex application is used for streaming audio, and is normally controlled by javascript, so I keep it hidden for normal use (via absolute positioning it off the page).
When I need microphone access I need to make the flash settings dialog visible, which works fine, I move it into view and open the dialog. When the user closes it, I need to move it back off the screen so they don't see an empty flex app sitting there after they change their settings.
View 2 Replies
Jun 18, 2011
I'm making a callback from javascript to a method on my swf. It works in Firefox with no problems, but in chrome the second parameter that's passed is always received as null? I've debugged my javascript and found that everything is working fine and the two values that are passed to the swf are correct at the point where the callback to the swf is made. At first i thought this might be a cross domain issue, but have ruled that out as if it were the case then the method on swf would just not be called at all. The second value is a binary string representation of an image and the length of the string that is passed is 101601, so i'm wondering whether there's possibly a limitation on the amount of data that can be passed? The first parameter is a much smaller string representing the file type and this always gets received successfully.
[CODE]...
View 2 Replies
Feb 12, 2010
I have a Flash movie embeded with swfobject in a html container. Through ExternalInterface I have registered a javascript function to fire callback to my flash app.
ExternalInterface.addCallback("notifyClose", notifyOnClose );
The javascript function is added as an event listerner to fire onbeforeunload.
<script language="JavaScript">
function getSWF(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1){
[Code].....
I have tested in FF and IE. Firefox works as expected but not in IE. In IE I get notified in Flash with the onload message, but not onbeforeunload.
View 1 Replies
Jul 14, 2011
I'm trying to get javascript to talk to flash, but I haven't been able to get it to work.I've gotten flash to talk to javascript, but not the other way around. It seems as thought flash isn't listening to the javascript, or I'm doing something wrongPart of the AS3 to initially call the js:
ExternalInterface.call("showGal", slastSelectedNumber);
The js i'm trying to use is:
function showGal(dPicture) {
document.getElementById('fullsizegallery').style.display = 'block';
document.getElementById("flashGalleryContent").someFunctionName(dPicture);
[code].....
View 1 Replies
Dec 20, 2009
I have a page that uses the jQuery.swfobject plugin to embed 5 flash items into a page and each flash item has a callback using externalInterface. The callbacks work when I have the js function outside of $(document).ready(function() but the jQuery animations do not fire - the ajax load however does. Does anyone know how to get the animations working too, code below:
function pageLoader(galID) {
$('#menu').hide();
$('#holder_gallery').load("feeds.php", {gallery: galID}, function(){
[code]......
View 1 Replies
Jun 6, 2010
I have a flash application using callbacks to javascript functions (eg. when it receives some data over a socket, it'll call a js script which would change the content of a div according to that given data).
Afaik, there is no actual mutual exclusion in javascript so I'm not sure if I can/need to simulate something like :
[code]...
So, the question is, when are those callbacks called ? Are they simply queued to be executed right after the browser finishes its task or are they triggered randomly ?
View 1 Replies
Jul 11, 2011
My web application pass a javascript object to flex application using addCallback function.
when the flex application is in modal dialog in safari browser, the object in the flex application is null and when I open the flex application just in a new window, the object is passed correctly. But, I need the showmodaldialog to show the flex application.
The flex code:
ExternalInterface.addCallback( "handleEvent", handleEvent );
override public function handleEvent( event:Object ):Object {
Alert.show(String(event)); .....
View 1 Replies
Oct 5, 2011
I tried to call a flash callback method from JavaScript. But it seems not working. The flash action script example code is like below [Simplified]:
import flash.events.ActivityEvent;
import flash.events.StatusEvent;
import flash.external.ExternalInterface;
var test_var = ExternalInterface.addCallback("js_method_to_call", flash_method
[Code]...
It is always display the error in fire bug console "flashFile.js_method_to_call is not a function".
View 5 Replies
Apr 5, 2012
I'm currently working with soundmanager2 in an IE/flash context (not html5). The issue is that audio playback of mp3 content does not occur for the following case where the 'onload' callback function is defined as null OR as a function that does almost nothing.
[Code]...
View 1 Replies
Jan 11, 2010
I have a flex app and I am adding a callback method like this:
private function init():void
{
ExternalInterface.addCallback( "playVideo", playVideo );
}
[code].....
However if I uncomment and run the alert first. I get no error and it works perfectly.My first thought was that the alert was buying time until the script could execute, so i tried to run the script inside a setTimeout() but did not work.
View 1 Replies
Jun 12, 2011
I have been at it for two days now and have not been able to resolve this issue. I am trying to call an AS3 function from JavaScript via ExternalInterface API which is simply not working at all. If I to call a JavaScript function form html loaded swf, it works beautifully.[code]
View 1 Replies
Aug 12, 2009
import caurina.transitions.Tweener;
class Scanner extends MovieClip
{
public var Scanner00_mc:MovieClip;
public var Scanner01_mc:MovieClip;
[Code].....
Makes sense as for the sequence, what doesn't make sense is why Tweener fail to loop back to the "fade" function ? They are suppose to be calling each other in an astable/blinking manner.
I suspect it's a scope problem but I don't know how to fix this, it seems AS2 Class doesn't know that there is a fade function within itself after the second Tweener call.
View 1 Replies
Nov 5, 2010
I am trying to use the ExternalInterface.call function in my ActionScript(2.0) to get a javascript var value set in the wrapping document. The following seems to work in FireFox and in Chrome but, naturally, it does not work in IE(8). getting the value stored at this variable?
var linkPath = ExternalInterface.call("function(){return window.customLinkLocation;}", null);
[Code].....
View 5 Replies
Aug 4, 2010
AdobeTV showed a way to allow Flash to "talk" to an HTML page via javascript using the ExternalInterface method. There seems to be a catch. You need to use the ID of the swf in the parameters to have it all fit together and you can only put the ID="swf" into the IE section of the Dreamweaver generated javascript or into the non-IE section. Putting it in both didn't work and the author mentioned only putting in one of them specifically.Is there a way to do this that would work in both sets of generated Javascript?
View 3 Replies
Dec 6, 2009
I'm looking to call a flash method from a method in javascript and recieve a result:Example:Flash -
ExternalInterface.addCallback("getProgress", getProgress) // Javascript to flash
public function getProgress():void {
ExternalInterface.call("getProgress", progress); // Send progress back to javascript from
[code].....
View 1 Replies
Jan 20, 2010
I have a simple html doc with a flex app and an iframe side-by-side (using a 1x2 table).There is a button in the flex app that, when clicked, sets the "src" property of the iframe to a URL by using the ExnternalInterface.call method to call a javascript function "doNavClick(url)".Or that's the idea.When I comment out the iframe object declaration in the html, the call to doNavClick works (I pop up an alert to test)....yet when the iframe declaration is present, it doesn't even receive the call. It's as if the iframe has somehow broken the call dispatching mechanism.Is there a workaraound for this?The problematic code is as follows:
--- Main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
[code].....
View 1 Replies
Jun 10, 2010
I have an issue with my ExternalInterface. The way it is currently set up is, on the page load up, a boolean is set to true in JavaScript and then checked by ActionScript constructors (using a timer) until it is true. This marks that JavaScript is ready to get calls from AS3.
At this point, AS3 will add the callback and do some internal stuff, and at the end of the constructor I call JavaScript. So far so good. JavaScript will at this point call a function in AS3 (that was defined in the callback described above), and this is where it all messes up.
On IE this works perfectly fine. On FireFox though, it does not. When I debug it, I see that the javascript function is called but when it tries to call AS3, nothing happens. I also tried to add a timer, but for some reason the function STILL executes straight away (in IE).
[Code]...
View 1 Replies
Jun 15, 2010
I'm trying to use ExternalInterface.addCallback to allow js to call an as3 method. My code is as follows:
AS:
ExternalInterface.addCallback("sendToActionscript", callFromJavaScript);
function callFromJavaScript():void{
circle_mc.gotoAndStop("finish"); [code]....
It's not working. What am I doing wrong?
View 3 Replies