Javascript :: Allowing Flash Movie To Communicate To Containing Window Without Exposing Full ExternalInterface?

Oct 14, 2011

I'm working on a site that allows administrators to upload arbitrary SWFs and embed them on the page. Administrators are in theory trusted, but I still want to protect against potentially malicious administrators or misguided administrators from harming the site.

A part of the functionality of the site is that the SWFs can communicate to the containing browser page when it's finished and for the page to react.

Now, I can think of two ways to do this:

Use ExternalInterface.addCallback to create a global callback named something like isComplete that does logic and returns true or false depending on whether the Flash app is in a completed state. Then, just do something like setTimeout to just call that function repeatedly. I don't think this would require me to open up allowscriptaccess to the movie. Embed the movie with allowscriptaccess and have the movie call something like ExternalInterface.call('done') when it's finished. This option seems like it requires me to open up allowscriptaccess, which is a potential threat since I can't control the SWFs that would be embedded with this directive.

View 1 Replies


Similar Posts:


Javascript :: AS3 ExternalInterface: Control A Movie From Another Window?

Dec 10, 2010

How can I control a flash movie in a window from a child (pop-up) window invoked via ExternalInterface's call method?

The name of the movie is myMovie. Using javascript in the popup, I try to access a function in the movie using document['myMovie'].flashFunction(). However, since the javascript is in the popup window and the flash is in another, the browser complains that the function is undefined.

This would have worked if the javascript and the movie were in the same window.

I use Firefox.

View 1 Replies

ActionScript 2.0 :: Alternative To ExternalInterface.addCallback() To Communicate With The Javascript

Feb 21, 2009

Any alternative to ExternalInterface.addCallback() to communicate with the javascript

View 2 Replies

Javascript :: Have A Flash Movie Communicate With Shadowbox Jquery Overlay?

May 17, 2010

I want to have my overlay adjust in size depending on how much content is being shown in the flash movie. Also, I want it to resize in real time when the user adjusts the content.

View 2 Replies

Javascript :: Open Browser Window Using ExternalInterface Then Write HTML In It

Nov 6, 2010

I can open a new window using window.open() in ExternalInterface.call() but then I want to be able to write contents to the new window. Since, I cannot get the reference of the window back from window.open() call, I am not able to do anything to the window once it is opened.

I do not have any control over the HTML in which my swf is displayed.

Has anyone been in this situation before?

Update: After a few hours of trial and error I found you can get out of this situation by storing your window reference globally and referring to the same global reference whenever you need to access the new window.

View 2 Replies

Javascript :: Flash - Automatically Maximize Browser Window And Switch To Full Screen Mode?

Jan 23, 2010

I am working on a Flash app that is 900x700 pixels. When viewed in misc. browsers at 1024x768, the browser chrome causes robs too much of the vertical space and the app appears in a window with a vertical scrollbar. Unacceptable.

The flash app will be launched via a link emailed to the viewers.

I'd like to avoid resizing the flash app and am wondering if there's a way to do the following via javascript, with no clicks involved:maximize the current browser window remove current window address bar and tabs / switch browser to full screen view (equivalent to pressing F11).

An alternative would be to resize the flash app vertically to match the browser canvas height to avoid scrolling. This may cause the app to become unreadable, so not the best approach in my case.

UPDATE: Seems that browser resizing and autoswitch to full screen won't work and neither will the flash app auto resize. What is the best approach then? And, some users may have browsers with toolbars or open a small browser window.

The only idea I have is to use javascript and display a message to users with small browser windows to pres F11 manually. The audience is executes and some may not even know what an F11 means...

View 5 Replies

ActionScript 2.0 :: Open A New Window If Have Thumbnail Pics In The Flash Movie But Want The Full Pic To Open Up In A New Window?

Mar 6, 2004

1) how do you open a new window if you have thumbnail pics in the flash movie but want the full pic to open up in a new window? Is this Javascript inside flash?

2) How do they do the menu bar here at this site:[URL]

View 1 Replies

Javascript :: Determine Which Movie An ExternalInterface.call Came From?

Sep 15, 2011

On my page, I'm going to embed multiple Flash files that use ExternalInterface to communicate back to the page. When the page receives the ExternalInterface calls, is there any built-in way to determine which swf the call came from?

I don't mind giving each movie a guid FlashVar and attaching that to each ExternalInterface call, but I don't want to duplicate more tested functionality.

View 1 Replies

ActionScript 3.0 :: Use ExternalInterface.Call To Call A JavaScript Function To Launch A Lightbox Window?

Jun 22, 2009

I'm trying to use ExternalInterface.Call to call a JavaScript function to launch a lightbox window. So far I have this:

AS3:
flash.external.ExternalInterface.call("launchLB", "" + aUrl + "");
JavaScript:
function launchLB(url) {
alert(url);

[Code]....

I get the alert but I can't get the lightbox window to display. When my as code makes the ExternalInterface call I get what looks like a page refresh and a blank browser window.

View 1 Replies

Workaround Flash Not Allowing Fullscreen From Javascript

Jun 2, 2011

I have video player chrome buttons designed with HTML/CSS. The full screen button needs to tell Flash to go full screen, but Adobe forbids this Javascript-to-Actionscript interaction.I'm making a web based video player that supports many plugins - Flash, VLC, HTML5, iPhone's Quicktime etc... I would like all these players to share the same chrome buttons - play, pause, mute, volume slider, resolution picker, and full screen. These buttons are layed out with HTML/CSS.[code]This has caused me a lot of pain and agony. Whenever I need to make a change, I update the HTML and JS. This change is reflected across the VLC, HTML5, and whatnot players. But since Flash does not share the same HTML chrome buttons, I have to duplicate the changes in Flash/AS. So I'm looking for a better solution that reduces the amount of duplicate code. It doesn't have to be stylistically clean. I just want easy maintainability.

View 3 Replies

ActionScript 3.0 :: Java ExternalInterface Doesn't Communicate With Swf In Firefox & Safari?

Aug 5, 2010

I have two swf files: swf_sender and swf_receiver. The swf_sender controls the swf_receiver via java script.Everything works fine in IE however, the swf_receiver doesn't receive communication from java script if openned by Safari or Firefox.The first part of communication: swf_sender - Java works ok (I tested it with alert() in Java) in all browsers.Here is my Java interface code:

Code:
<script type="text/javascript">
function getFlashMovie(movieName) {

[code].....

View 2 Replies

Javascript :: Facebook Flash App Cannot Communicate

Nov 27, 2010

My index.php file loads the Facebook JavaScript SDK and the FBJS bridge:[code]When I run this file on my server, I can communicate with Facebooks JavaScript SDK either indirectly through ExternalInterface calls, launching various Facebook UI dialogs etc. And I can also use the facebook-actionscript-api to launch the same dialogs directly from ActionScript.When I however use this index file as my Facebook canvas url and load the swf in a Facebook iFrame, the communication crashes the application. I'm not sure how to debug this but I think it might have to do with crossdomain security. Any ideas on debugging and/or solutions are welcome.

View 3 Replies

Javascript :: Let Flash App Communicate With Server?

Jun 2, 2011

What's an easy and secure way to let my Flash app communicate with my back-end server?

The Flash app, which is a video player, should retrieve the person's username and send back an ID. How would I do this?

Note: Back-end is written in Javascript.

View 2 Replies

Javascript :: Unable To Communicate With Javascript From Flex After Dymanically Loading A Swf?

Aug 1, 2009

for some reason, whenever I dynamically load a swf on a $(document).ready() by writing to a div, I am unable to make javascript calls to the browser. Specifically, all calls to the browser return "null". This does not occur when embedding the swf normally on the page load, but I would like to prevent loading of the swf until a specified point in time.

What the heck is going on here? Is there something special about dynamically embedding a swf that prevents the swf from talking to the browser? The methods ARE called (I've proven such by showing alerts), but all return values to any function, regardless of type returned, shows as null when it gets to flash.

View 3 Replies

Javascript :: Flash - Get A VAR With ExternalInterface?

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

Javascript :: Linking Flash To OOP Using ExternalInterface?

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

Javascript :: Calling A Flash ExternalInterface ?

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

ActionScript 3.0 :: Pass A Value To Javascript From Flash Using Externalinterface

Jun 1, 2009

i'm currently trying to call a javascript function and pass values to it. but i'm not really familiar in using the addcallback since i only tested on calling a function from flash without passing anything to the function.
 
Basically, i'm going to retrieve the values of a node from xml. and then i will assign those values to a variable in flash. now what i'm going to do next is pass this value to a javascript parameter..is it done using externalinterface?

I just need to throw the value to the javascript function parameter and no return values to the actionscript. The event is that whenever an image is click, the corresponding value for each image is passed to the javascript function.

[Code]....

View 1 Replies

Flash :: AS2.0 And JavaScript / JQuery (ExternalInterface) Communication

Jan 7, 2010

Im trying to use JS to send data to my Flash AS2.0 music player with ExternalInterface, except there are no good tutorials or guides on ExternalInterface that I can find. I want to be able to change the current song in the player by clicking a JavaScript link, and on page / window load without clicking, play a default song.

I dont need a super complicated answer on loading sounds in flash, etc., I am just having a lot of difficulties getting JS to send anything to Flash, and when I get that to work - would I need to put some if / else into the flash to determine if the link has been clicked or not?

[Code]....

View 2 Replies

Flash :: Getting Javascript To Work With SWF File Using ExternalInterface

Oct 16, 2010

I have a SWF file emedded withing a HTML page. Trying to do a simple operation - go to and play certain frame in SWF using javascript. I'm using ExternalInterface to do this but for the life of me can't get the two to communicate. I add all the code but when clicking on the link which calls javascript, it says my flash object is undefined?

[Code]...

View 2 Replies

Flash :: Use ExternalInterface.available To Check If JavaScript Is Enabled?

Nov 27, 2010

Flash has the ExternalInterface class which can communicate to JavaScript running in the browser Can you use the ExternalInterface.available property to check if JavaScript is enabled?

View 2 Replies

Javascript :: ExternalInterface Call From Flash To Function In OOP?

Dec 7, 2010

I can't call a javascript function from flash, when the flash object is added within an OOP structure in javascript. In short the code:

In flash:

if (ExternalInterface.available) {
ExternalInterface.call("flashMessages", "ready");
}

[Code]....

Flash gets loaded, but the call to the javascript function isn't received.

View 1 Replies

Javascript :: Flash - ExternalInterface Not Working In Harmony?

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

Javascript :: Flash - Functions Registered With ExternalInterface.addCallback Not Available?

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

Flash :: Javascript - Can't Use ExternalInterface In Action Script 3.0 On Localhost

Jul 23, 2010

I have a flash file which captures an image from a webcam and sends it to the server. This file works fine under ActionScript 2.0 but under 3.0 I get an Unspecified Error and the debugger crashes on the return eval in :

[Code]...

I've tried adding localhost to the list of trusted sites in the flash security manager
[URL] I've also tried playing with the allowScriptAccess and allowNetworking settings in the object tag.

View 2 Replies

ActionScript 3.0 :: Calling A Function In Flash From JavaScript Using ExternalInterface

Apr 27, 2011

I can't get this to work even after making sure to set "allowScriptAccess" to always. I successfully put the flash movie in the browser and call ReceiveDataFromFlashMovie() and print "Got here" but it seems like GetFlashMovieObject() only returns NULL according to an error message in Internet Explorer. Am I missing something? Head of the HTML file:

[Code]....

View 3 Replies

Flash :: Javascript :: ExternalInterface Works With Embed Tag But Not With Object Tag

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

JavaScript :: IE Fail To See Flash ExternalInterface Method In ASPX?

Sep 19, 2011

I'm using Javascript to call a method on a Flash movie embedded in an ASPX page using SWFObject. It works fine in Firefox, but Internet Explorer 7 and 8 (so far) claim the object returned by swfobject.getObjectById() "doesn't support this property or method". I've found similar posts on this site and others, but nothing I've tried has fixed this in IE.

ActionScript 3.0 class:
public class Player extends MovieClip {
public function Player() {
Security.allowDomain("http://localhost");
ExternalInterface.addCallback("test", test);
[Code] .....

Internet Explorer complains about the last line in that function, "Object doesn't support this property or method".

View 3 Replies

ActionScript 2.0 :: ExternalInterface & Swfobject - All A Flash Function From Javascript?

Oct 4, 2009

I'm having trouble to call a flash function from javascript.Here's my code:My Flash (AS2) Movie:

Code:
import flash.external.*;
stop();[code]....

View 7 Replies

ActionScript 2.0 :: Allowing Only One Flash Movie To Load At Once

Jan 20, 2008

is there a way to make it so that on any one computer.. only 1 instance of my flash movie will run?Like if they go to a site.. with my flash movie on it.. and they open up another tab.. of the same page.. only one of those flash movies will run..

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved