Javascript :: ExternalInterface. Addcallback Works Locally, But Not On Server?
Nov 9, 2010
Mainly because I have it ALWAYS working locally, when I test in a browser, but the moment I deploy to a server it stops working.
I've added trace commands and confirmed that ExternalInterface is in fact available before adding the callback, and an alert command in the javascript method correctly identifies the flash object. I also checked and allowscriptaccess is set to 'always'.
Could it have something to do with the flash being served on a remote server?
View 1 Replies
Similar Posts:
Jan 15, 2011
In my Flex app, I need a Javascript control to call one of my Actionscript methods. Simple enough, according to the Flex/Actionscript documentation, I wrote this in my Actionscript code:
if (ExternalInterface.available)
ExternalInterface.addCallback("setName", setNameInActiveWindow);
In the Javascript control I wrote:
document.getElementById('FlexAppId').setName(name);
Works great. Exactly as expected, so I went to production. But it doesn't work in production :(. Same exact code... I can't figure it out. The above Javascript code is run, but the callback is not executed in the Actionscript code.
[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
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
Apr 15, 2010
I'm trying to call a method inside a flash movie from js, every time the mouse leaves the "div". It works on Internet Explorer, but not in firefox. Here is the html script:
<script type="text/javascript">
window.onload = function(e){
init();
}function init(){
document.getElementById('div').onmouseout = function(e) {
[Code] .....
Here is example of the problem, there is an alert for the js and the flash should be able to remove the swf (see a gray background? it works! see a image, flash didn't receive the call): [URL]. This should work with internet explorer / safari / chrome (pc/mac) only firefox seams to reject this.
View 2 Replies
Mar 17, 2011
I want to call AS function from JS.
I have the following ActionScript 3 code:
package {
import flash.display.*;
import flash.events.*;
[Code]....
But obj has no method PlaySound() (obj is not null).
View 2 Replies
Jun 1, 2011
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;[code]....
The Error I'm getting is: Uncaught TypeError: Object #<HTMLObjectElement> has no method 'getStringJS'
I also tried adding in a timeout in case the swf file wasn't loading, but I didn't have any success with that method either.
View 2 Replies
Jun 22, 2009
I'm trying to add an ExternalInterface.addCallback, to get a string back from a javascript function so that I can set the "visible" property of movie clip "title" to "true." Can someone tell me what I'm doing wrong?Here's my AS code:
[Code]...
View 3 Replies
Apr 14, 2010
I'm working on a Flash game that needs to call some Javascript on the page and get data back from it. Calling Javascript from Flash works. Calling the Flash functions from Javascript (often) doesn't. I'm using the Gaia framework.The swf is loaded in with SWFObjectThere's a button in the Flash file. On click, it uses ExternalInterface.call() to call a Javascript function. This works.The Javascript function calls a Flash function that was exposed with ExternalInterface.addCallback().Sometimes, the Javascript produces the following error: TypeError: myFlash.testCallback is not a function.
When the error happens, it affects all functions registered with addCallback(). Gaia and some of its included libraries use addCallback(), and calling those functions from Javascript also produces the TypeError.Waiting a long time before pressing the button in Flash doesn't solve the error.Having Flash re-try addCallback() periodically doesn't solve the errorWhen the error occurs, ExternalInterface.available = true and ExternalInterface.objectID contains the correct name for the Flash embed object.When the error occurs, document.getElementById('myflashcontent') correctly returns the Flash embed object.Edited to add:This issue shows up in Firefox 3.6, but not Chrome or IE8. I haven't tried older browsers.
I'm running the Debug version of the Flash player.My calls toExternalInterface.addCallback() are wrapped in a try...catch block. When the JS error occurs, the catch block is not triggered. It's a silent failure.The error occurs when testing on a webhost, with the swf loaded from the same server as the page it's on.
I set allowScriptAccess = always.Setting flash.system.Security.allowDomain("mydomain") doesn't fix the error.From my Page class:
public class MyPage extends AbstractPage
{
// declarations of stage instances and class variables
[code]....
View 8 Replies
Sep 10, 2011
I am trying to use javascript to run AS3 functions. When I attempt to compile I'm getting an "Access of undefined property" error message. I've read a few things online about this but I'm still not understanding it. I want to have the flash file always listening for javascript.
[Code]...
View 2 Replies
Feb 21, 2009
Any alternative to ExternalInterface.addCallback() to communicate with the javascript
View 2 Replies
Mar 26, 2009
I'm trying to control a Flash video player with external Javascript commands using 'ExternalInterface.addCallback' but I'm not having any success. Here is the HTML code:
[Code]...
View 1 Replies
Sep 19, 2011
The "modern" updated way to embed a flash object, according to Adobe:
[Code]...
Then it works on Firefox and Chrome (the AS function is called and works properly) - (it doesn't work in IE though). How come it doesn't work with an object tag? How "safe" it is to use the embed tag instead of the object tag? Is it not obsolete? Note, that it is definitely not a timing issue - If I call the AS function from JS from an onclick function - then the results are the same.
View 2 Replies
Aug 7, 2010
I know there have been other questions on getting JavaScript / Flex ExternalInterface to play nicely, but I've what I think is a weird one. It works perfectly in every browser except Safari (on a Mac). Chrome, IE, Firefox - all ok, but Safari, nope it just wont fire.I've copied my code below, can anyone see why it doesn't work in Safari pls ?(the 'are you sure' dialog window appears in Safari but the method in the Flex app just doesn't get called)
Flex code :
if(ExternalInterface.available){
ExternalInterface.addCallback("flexShutdownHandler",flexShutdownHandler);
[code].....
View 1 Replies
Jan 19, 2011
I've got a project that loads a couple of external flv videos. It works great locally but when I upload it to a web server I just get a blank screen.
Googling reveals two possible issues... server mime types, and flv path issues.
Everything is in the same folder so I'm doubting it's a path issue.
If it's the mime type issue, how do I go about fixing it? My host is dreamhost.
*update, I tried adding the following two lines to my .htaccess file but it didn't change anything:
AddType application/andrew-inset ez
AddType video/x-flv flv
Here is the html: [URL]
And here is the whole project in a zip if anyone has time to take a look:
[URL]
View 1 Replies
Mar 7, 2009
I'm working on a website ([URL] - don't think the flash file can be seen in FF yet) and I want to load an swf-file with some illustrations and such. As this could get a little big, I have made another swf-file which shows a preloader and loads the first swf-file. The preloader works perfectly when tested in Flash CS3, but when uploaded to and tried on my webhost's server, the preloader doesn't load anything. Instead it of the load-percentage it just writes "NaN". You can find the as3-code down below. The preloader-swf and the swf to be loaded are located in the same folder. Both are as3.
This is the code from my as-class file:
package classes{
// Imports necessary classes
import flash.display.MovieClip;
import flash.text.TextField;
import flash.events.Event;
[Code] .....
View 2 Replies
Jan 19, 2011
I've got a project that loads a couple of external flv videos. It works great locally but when I upload it to a web server I just get a blank screen.
View 2 Replies
Aug 1, 2006
So I have an html file with a swf in the center which loads pictures and text via XML. It works fine on my own computer but on the actual site it doesn't load the pictures or text it, in any browser.
View 1 Replies
Jul 30, 2009
There is a number of posts but no solution to this issue. I am using alducente web service class to make SOAP calls to a WS from flash and it works perfect in the Flash IDE. When I publish to my server it just hangs.
I have a crossdomain file allowing all headers and domains etc. no luck.
View 0 Replies
Jul 7, 2010
i inherited an old as2 mp3 player. i'm trying to read id3.artist from the mp3 playing. it gets it and displays fine locally but as soon as i put it on a server it always returns 'undefined'. do i need some kind of a security file or something to read the id3 info?
View 1 Replies
Feb 5, 2010
There was always a flash movie on the homepage and it worked fine. A couple days ago I replaced the movie with a new one and added a .swf to the portfolio page as well. On the portfolio page, the movie is layered behind a series of transparent .pngs that link to their corresponding lightbox designations. The movie just plays, there isn't any interaction this way, atleast not in flash.
The problem: Everything works perfectly fine locally on all browsers and not at all on the server across all browsers. I have seen this problem before and read alot of posts about it.I know I have the proper scripts files. I've re-saved flash movies, changed their location within the site, published them with the appropriate settings, nothing seems to do the trick. Whats worse is that the lightbox doesn't even work online and it runs fine locally. Infact you cant even click on the .pngs and they aren't positioned the same with the css as they are viewed locally. I've overwritten the css with the up-to-date stylesheet many times as well
View 5 Replies
Mar 30, 2010
I'm using BulkLoader to load a single XML, parsing this, extracting out a list of images on another server (amazon), adding them to BulkLoader and loading them in.
this all works great running in the Flash IDE but as soon as it's uploaded the xml loads, parses BulkLoaders starts but non of the images load.
I assume it's a security issue but linking to these images from the local or from a html page works fine just not from Flash from a server.
View 4 Replies
Jul 26, 2011
I created the movie in a new folder, so I owuld have all the files... fss.html, fss.swf and MinimaFlatCustomColorPlayBackSeekCounterVolMute.swf I uploaded all these to the server.....
[Code]....
View 5 Replies
Dec 22, 2008
I have made a XMLloader with URLrequest, and it works locally by calling the file directly by its name ie. "myFile.swf". var presLoader:Loader = new Loader(); presLoader.load(new URLRequest("myFile.swf")); addChild(presLoader);
But when I uploaded the loader to the server, I have no file, only "URL not found"-error. So I found out that I should change to URL to "/Files/Images/subloader/myFile.swf" then it will load. But thats a real problem, because I have several loaders.
View 1 Replies
Apr 6, 2012
I have tried numerous attempts at converting flash files to HTML5 with Swiffy -- and they all work great in a browser running locally, but when I put the HTML file that is exported on a server (I tried two separate ones, just in-case it was some server configuration) they do not run, it gives a blank white screen.
I tried saving the file down to Flash 5 export, and changed settings and they work locally but not when placed on a server. I tried converting several flash files all with different animations, and I get the same results -- it works locally but not on a server.
View 1 Replies
Jul 26, 2010
Anytime this .swf is ran from my computer during test runs it works flawlessly. As soon as It is embedded in an HTML page the sound doesn't play.
View 3 Replies
May 17, 2010
I have one .swf that loads a second one on level 2.level 2 then in turn loads variables from a text file .The problem is that it works locally, but refuses to work on the server. The urls are all local. This is such a simple procedure, I can't figure out what is wrong..... are there limitations doing this via server vs. locally? I never get any "file open" errors locally. I've spent 2 hours on this.... I'm just using a simple LoadVars similar to this example:
Code:
loadText = new LoadVars();
loadText.load("text3.txt");
[code].....
View 5 Replies
Feb 9, 2009
I'm new to AS & Flash, but not programming in general. I've got a project where I'm needing to use embedded fonts. To save the size of my main .swf, I've been using the Loader class to import .swf files with the fonts embedded at runtime. The "font library" .swf files contain just the embedded font, and in frame 1 have
[Code]...
View 1 Replies
Feb 11, 2009
I have been trying to get this working for a while now and am at the end of any ideas or samples.In 2.0 it was setVariables and was not problem.But now I'm trying to get ExternalInterface.addCallback to work and just can't seem to get it to work.Just want to send a variable from javascript to actionscript class.Ok, here is the javascript:
Code:
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];[code]....
I have been trying to get this to work but with no luck.It's in a .Net aspx page. Even stripped the page of everything but this with no luck. And no master page either or ajax.
View 3 Replies
Jan 8, 2007
i have a flv movie and i need to be able to stop it through javascript. so i found out that i need to use ExternalInterface.addCallback
View 3 Replies