Javascript :: Calling With Security Exception?
Mar 14, 2010
I have a swf hosted at domain A, and I have a html at domain B My swf is able to be loaded from accessing the html at domain B. However, the swf gets a SecurityError: Error #2060: Security sandbox violation:
[Code]...
View 1 Replies
Similar Posts:
May 9, 2011
I'm calling remote images with with a Loader and the context has checkPolicyFile=true, images load fine with urls like :url....the only difference being escaped characters, is this a bug or am I doing something wrong?url...
View 1 Replies
May 10, 2010
With all the recent hype about JavaScript and HTML5 replacing Flash, I wanted to know - How would it be possible to protect client-side js code? Of course, it is possible to obfuscate it, but that would only make it a little harder. Also, for games which submit high scores to the server, wouldn't it be incredibly easy to modify those scores before they are sent to the server? I know even Flash files can be decompiled, but they can be obfuscated and flash decompilation is not as easy as modifying data in JS - could be done easily using a plugin such as Firebug. I'd like to know everyone's views on this.
View 2 Replies
Oct 28, 2009
I am trying to emulate (in a limited way) the behavior of JavaScript's XMLHttpRequest object through Flash/ActionScript 3, in order to overcome the same-domain limitation. But I'm discovering that ActionScript has its own limitations in that regard. I admit that I might be mistaken, but from what I understand it is theoretically still possible to do this sort of cross-domain scripting using ActionScript, so long as you get all the permissions right. And that's where I'm running into trouble.
First, I borrowed some open-source code for a class called AjaxRequest, which I have saved as /ajax/AjaxRequest.as. I then created a Flash file called /jsajax.fla which exports to the final SWF file, /jsajax.swf. Now, here's the ActionScript code that comprises the first and only frame of the Flash file:
import ajax.AjaxRequest;
Security.allowDomain("domainone.com");
Security.allowDomain("domaintwo.com");[code]....
This is the only case I could not get working, and this is the case I need to get working. The first two were really just test scenarios to see if the script was working at all. When I try to run my jsAjax function here, I wind up with an error that shows up twice in Firebug:
uncaught exception: Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.].
uncaught exception: Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.].
View 1 Replies
Jun 16, 2010
I am using spring exception translator to wrap java exception into flex exception.
eg
public void testException()throws Exception{
throw new Exception("my exception");
}
But for some reason, I am getting IllegalAccessError. The code sections are entering the testException and the Translator class.
Question: why it trying to get log target level ?
Below is the lines from the log:
[Code].....
View 1 Replies
Feb 29, 2012
let suppose i have a object named "data" which has a callBack function named "closeItem" which does something. So i have flash file which has a close button. on click of that i am calling this function which closes this item. So issue is? If i pass this "closeItemFunction" as global function this works fine. but if a pass this function as a "data.closeItem" this doesn;t work throwing some falsh error. so i just wanna ask that "does flash only call gobal scoped javascript function" ??
View 2 Replies
Jun 18, 2010
I've a developer which has given users the ability to download a zip archive which contains an html document which references a relative javascript file and flash document.The flash document accepts as one of it's parameters a url which is embedded in the html document. I believe that this archive is meant to be used as a means to transfer an advertisement to someone who would use the source to display the ad on their site, however the end user appears to want to view it locally.When one opens the html document the flash document is presented and when the user clicks on the flash document it redirects to this embedded url. However, if one extracts the archive on the desktop and opens the html document in a browser and clicks the flash object, nothing observable happens, they will not be redirected to the external url.
I believe this is a security risk because one is transferring from the local computer zone to an external zone.I'm trying to determine the best way to explain this security risk in the simplest of terms to a very end user. They simply believe it's "broken" when it's not broken, they're being protected from a known vulnerability.The developer attempted to explain how to copy the files to a local iis instance, which I highly doubt is running on the users machine, and I do not consider this to be a viable explanation.
View 2 Replies
Jul 8, 2010
I am refactoring some code. I have a PHP page that contains a MySQL query and stores the result in a PHP variable $my_result. This result is then echoed to a Flash SWF during embedding with SWFObject. I now want to call this PHP page that makes the query from a javascript function like so - one change I have made to the PHP is that instead of storing the result in a variable $my_result I am echoing the result. Javascript function to call the PHP page and make the database query
[Code]....
View 2 Replies
Nov 4, 2010
I mixed a.com and b.com in my original post, I'll try to rephrase stuff correctly:
A HTML page is loaded from a.com
The HTML embeds a Flash client from b.com
HTML contains a Javascript function that makes a connection to a.com, ie the origin of the HTML, not the origin of Flash
The Flash calls that Javascript function
Question: Do I need to have a crossdomain.xml in a.com?
View 2 Replies
Dec 28, 2011
We've just developed a small Facebook puzzle that people win some gifts from our customer. I'd like to ask a few questions since I'm pretty stuck despite tried lots of things. First I'd like to write what we have and then will explain our problems.oot of application (/) checks for signed_request in POST params, extracts information from it to see if we've registered the logged in user into our database. This checks are also used to understand if the request is sent from Facebook or not to prevent requests coming outside of Facebook. (will write why we want this)Once the application is successfully rendered, Facebook JS API takes place, does its checks and sets the fbsr cookie. We use that cookie information while processing ajax requests to check if the request really belongs to the logged in user (e.g.: scores being sent for a user belong to the logged in user).
We implemented CSRF protection and another protection to check if the requests are POST and more specifically AJAX requests and return 40x if not.nd out that some people seem to take advantage of this bug.One way I thought of is to ignore all requests except coming from Facebook. Since the ajax requests are blocked (cross site) we should have been safe. However this leaded to another problem that, once we redirect users to e.g. leaderboard the signed_request data is lost and our index page returns 40x once the user tries to go back since our application thinks that the user tries to visit our application outside of Facebook.
View 1 Replies
Feb 5, 2010
I'm trying to access a swf function from javascript using External Interface given by adobe and I get the following error.
SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller http://media.varheroes.com/flash/flashtest.swf cannot access http://apps.facebook.com/feline-frenzy/flashtest/.
at flash.external::ExternalInterface$/_initJS()
at flash.external::ExternalInterface$/addCallback()
at flashtest_fla::MainTimeline/frame1()
View 2 Replies
Jun 18, 2011
I insert my swf using a relative url to the file, and I want the swf to call a javafunction but i get no response. why the swf is not in the same directory as the html file.
my as:
function checkInput() {
var result:Object = ExternalInterface.call("checkTheInput");
myTxt.text = String(result);
}
[Code]....
View 5 Replies
Sep 12, 2011
I am writing a library in ActionScript 3 which needs to call functions in JavaScript. Since it's a library, there is no AIR, and thus HTMLLoader can't load an HTML containing the JavaScript.
how to call JavaScript which is not in an HTML window?
View 5 Replies
Mar 10, 2012
Just started using wordpress for my site after years of standard HTML and hit a problemwith an old Flash file I've usedfor 10 years.So I have a flash 6 swf file living in my media directory at URL...and the swf file wants to call a JavaScript function on my HTML page living at URL...Now on my old non-wordpress web site I just put the html and swf file in the same directory and this call always worked javascript:top.fSendForm()But now the swf file is in another location I don't know how to reference my JavaScript function.
View 5 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
Feb 1, 2011
I need to create a really basic flash video (actionscript 2) where I click on a bit of text which will call a javascript function. I have created a flash video which has a bit of text I converted to a button symbol. I then opened the "Actions" tab and added:
[Code]...
View 1 Replies
May 14, 2011
So my team's project has an swf embedded in JavaScript, we're actually using java servlet's to create the html/JavaScript. I am attempting to use as3's ExternalInterface to add a callback which would get called in the javascript but everything I have tried will not work.[code]so if there is a missing tag or something that's probably not my problem. NOTE I embed this correctly and get into the swf allowing it to call javascript functions(as3 calls the getStuff fn), using the ExternalInterface, which works but JS->as3 does NOT work ='I cant use the movie object for anything (the return value of getFlashMovie), if I try to use no code after works.The action script code calls the external interface addCallback function correctly(called in a try catch that's how I know)[code]The only things I can think of;
1) The embed code isnt creating the object correctly, since I cant use the movie for anything
2) my swf is being created weird and doesnt allow script access.We are using FlashBuilder to build the swf.
View 1 Replies
Mar 27, 2009
I'm trying to call a function declared with ExternalInterface in a Flash swf, using JavaScript.It worked once, but all of a sudden, it stopped working.I have a debug version of the Flash Player, but no errors occur in Flash.Not even a "Security Sandbox Error" or something. The only error I get is the following error in JavaScript Error: Error in Actionscript. Use a try/catch block to find error.I'm using AS3, exporting for Flash Player 10 and testing on Firefox 3/Safari 4, on a Mac.
View 4 Replies
Nov 29, 2011
I got two AS3 functions. One that toggles fullscreen and one that is called with javascript with ExternalInterface that only logs "Hello World". Both works well in the browser, but if I try to call the fullscreen function with javascript the same way, i get an error like this: Error calling method on NPObject! I googled that problem but that only had something to do with same domain access, and sinced it worked with the other function, it has to be something else.
View 2 Replies
Jun 17, 2009
I'm having some trouble calling a JavaScript function from the HTML file I've embedded my SWF in.
I'm currently using Flash 8.
I'm trying to to simply call a function which will open an alert window, but when I click my button, nothing happens.
Flash Code:
import flash.external.*;
testbutton.onRelease = function() {
ExternalInterface.call("testAlert", "Yay, it finally worked");
}
[Code].....
View 0 Replies
Jan 6, 2010
I have a page that has a JavaScript element that I want to activate with AS3. The page is currently residing at:[URL]l if you click on the right side of the green bar it changes to blue. Now there is a <a class="right"/> that is being applied via JavaScript to the document. What I need to do is activate the class/right from Inside a swf. What I have below is the code that I put together for AS3 that I was using to attempt to call the external link.I have used AS3 before, the main body navigation on www.last7studios.com was created entirely using AS3. This is just my first attempt doing anything like this.
ActionScript Code:
import flash.text.TextField;
import flash.events.TextEvent;
[code]....
View 2 Replies
May 22, 2007
we are currently working with a tv site (flash) in which we have included 3 buttons , mini , standard and fullscreen.Mini will resize the browser window into a smaller size , while standard will resize it to the maximum available width and height.The fullscreen will play the video in fullscreen which is a new flash 9 feature.
The mini and standard buttons actually invokes a javascript function which resides in the flash container html page.The javascript code contains the satement window.Resizeto .The problem we are facing is that the functionality seems to behave inconsistently in IE.In IE 6 ,all the 3 buttons works perfectly.But once we touch the scrollbar , then the mini and standard wont work , it shows a javascript "access denied error".This error does not appear when the wmode in flash object tag is made transparent.But if wmode is made transparent , fullscreen wont work.This is given in adobes website.There is no problem in mozilla firefox .In IE7 we have the same problem as in IE6, apart from this mini and standard does not work at ALL when multiple tabs are open.I would like to know if thr is any way we could overide the javascript error and why does the error not appear when wmode is made is transparent ?
View 4 Replies
Aug 10, 2009
I built a flash website. On one of my buttons, I was planning on loading another webpage with the getUrl script. I'm working with another developer and he wants me to program the button so that when it's clicked it will call a java script function he'll have programed in the webpage.
View 8 Replies
Nov 19, 2008
I'm relatively new to Flash and CS4, which we justpurchased. I want to call a JavaScript function in the page from aflash .swf file. I'm having trouble getting it to work. Can someonep me understand what I'm doing wrong?
Actionscript 3 code behind the Flash button:
import flash.external.ExternalInterface;
on (release) {
[code]....
View 4 Replies
Jun 17, 2009
I'm having some trouble calling a JavaScript function from the HTML file I've embedded my SWF in.I'm currently using Flash 8.I'm trying to to simply call a function which will open an alert window, but when I click my button, nothing happens.
Flash Code:
import flash.external.*;
testbutton.onRelease = function() {
ExternalInterface.call("testAlert", "Yay, it finally worked");
[code]....
View 1 Replies
Oct 30, 2009
I have a flash embedded in html. And I want keyboard shortcuts like F1, F2, F3. If I use:
[Code]...
View 1 Replies
Jan 20, 2010
I'm trying to call a javascript function from within my swf and I'm having a couple of problems which are confussing me somewhat. I'm using this to call the function from flash:
ExternalInterface.call("pgcover"); I know that this is calling the function as I have set it trigger an alert action and this comes up properly. But I don't want the function to trigger an alert, this is just for testing purposes. I instead want it to change the styling on a div. I have set up a test page where I have asigned the function to a button and this works, the div display changes from block to none. When I get the swf to call the function setup to do the same thing, nothing happens.
[Code]...
View 4 Replies
May 5, 2010
I have what I think is an easy question but I am having problems with it... Using AS2 / CS3, I am calling a javascript function from Flash, but i would like the value to be a variable and I cant figure out how to do it. the started code is below and I need direction on how to make "myVar" actually a variable.
var myVar = newValue_txt.text;
btnOne.onRelease = function() { getURL("javascript:testFunction('myVar') ");
}
this is a stripped down version of what i am trying to do, but i think it gets the main point across.
View 3 Replies
Feb 9, 2010
Can I use ExternalInterface to call a namespaced JavaScript function?
//JavaScript
foo.bar = function(baz) {}
// AS3
[Code]....
View 2 Replies
Aug 26, 2010
I have a swf that opens up inside a colorbox window. When the video finishes playing, I make an externalinterface call to a javascript function to close the colorbox.I'm trying to execute the following AS3 code:
ExternalInterface.call('parent.$.fn.colorbox.close()')
I can't seem to get this to work. The colorbox won't close.I also tried this to see if I was just making the wrong function call, but this didn't work either: ExternalInterface.call ('alert("hello world")')However, if I browse to the url of the swf file, so that it doesn't open inside the colorbox, the alert() call works just fine.
View 1 Replies