Javascript :: Flex - Flash Callback Method Produces Error UNLESS Alert() First?

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


Similar Posts:


Java :: Flex - Calling A New Method From Mxml Produces "cannot Invoke Method" Error

May 24, 2011

[Code].....

getUser was already in UserService.java. I just created getUser2 and it's identical to getUser. When I try to call getUser2, i get the "Cannot invoke method" error. question: Do I need to specify getUser2 in some other file? like in some configuration file? if so, which one and how do I do it.

View 1 Replies

Actionscript :: Call Flash Callback Method From Javascript?

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

JavaScript :: Using Alert Method When Button Clicked?

Feb 13, 2012

Is it possible to use Javascript in flash. For example, as a simple test I am trying to use Javascript's alert method when a button is clicked. I am using AS3. Is it possible?

View 2 Replies

Javascript :: Will Alert Show This Message In Flex Or Flash Builder?

Apr 1, 2012

I have a colleague who will be using Adobe Flex and adobe flash builder to design the application. The final application will be in that software. I am creating the database features and testing them using online browsers.What I want to know is that some alerts I am getting a 'prevent this message from multiple dialogues' message on the alert but this is because of the browsers. But if the application is on flex and flash builder (I don't know which one is where the app is stored coz I have never used it) then will that message appear on some alerts in that software or is it only on browsers?[code]

View 2 Replies

Javascript :: Error Accessing Class Variables Within An ExternalInterface Callback

Aug 28, 2011

Here's my actionscript (compiled with mxmlc, embedded into html, and the functions are called with js):

[Code]...

View 1 Replies

AS3 :: Calling A Flex Callback From Javascript

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

Javascript :: ShowSettings Callback In Flex?

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

Javascript :: Flex ExternalInterface Callback?

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

JavaScript :: Passing Object To Flex Using Callback Function

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

Flex :: Disable Alert Javascript Function On AIR HTMLLoader?

Apr 3, 2011

In my AIR application in Flex 4, I use mx:HTML, and when I navigate to a location like this ut, some websites have "alert" function in javascript like this :lert('hello world!');nd AIR show the message in a box...I just want to remove, or ignore these messages, but I don't know how...

View 1 Replies

Flash :: Use A Method Of A Class Inside A Callback Function ?

Sep 13, 2011

When you call a method of a class inside a callback function, you can not use this object.To call the method, in javascript, I declare that variable, assign this to that, and use that inside the callback to call the method of this.In actionscript, do I have to do the same way as I do in javascript?The following code is the example to use that to call a method inside callback.Are there more simple way in actionscript?

class C {
private var that:C;

function C() {[code]......

View 6 Replies

Javascript :: Reinstate Jquery Features After Flash Callback?

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

Javascript :: Exactly Are Flash External Callback Methods Triggered?

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

Flex :: Alert Gives PopUpManager Error When Used With SWFLoader

Jul 13, 2011

I am using SWFLoader to load a swf file. The code is below:[code]

View 2 Replies

Javascript :: Embedded Swf And Use A Flash Alert Dialog To Confirm?

Feb 10, 2010

I have an AS2 Flash SWF that is calling another AS2 Flash File using loadMovieNum("flash.swf",2) and a JavaScript file that calls a function on page using a timer. This is what I get in Firefox with Flash 10 (IE8 gives no error message):

uncaught exception: Error calling method on NPObject! [plugin exception:

Error in Actionscript. Use a try/catch block to find error.].

What is going wrong? I can't see a problem. It is suppose to clear the contents of the embedded swf and use a Flash alert dialog to confirm Yes or No.

Flash:
import flash.external.ExternalInterface;
import mx.controls.Alert;[code]......

View 1 Replies

Flex :: Stop ENTER Key From My Alert Being Caught By The Control That Initiated The Alert?

Apr 29, 2010

I am having an issue where I show an AlertBox message when the user hits ENTER and the focus is in a text area. The pop up works fine, but when the user hits enter the Alert closes as expected, but the TextArea listener receives the ENTER event from the Alert and pops the dialog up again. I have tried a number of ways to catch and eat the event but so far I have not been lucky. Is there way to accomplish this?

public function init():void
{
myTextInput.addEventListener(KeyboardEvent.KEY_UP, handleKeyStrokes);[code]....

View 2 Replies

Javascript :: Error Calling Method On NPObject

Sep 23, 2011

Making a flash video streaming web-app using Actionscript 3's external Api. I am at a very rudimentary phase of the project where we're just experimenting with external interface. Right now i just have a flash object and 3 buttons each to play pause and load a video. The only button that is currently set up to do anything is the load button. My swf and my html file sit on the same file system, and my video files sit on another server with traffic being redirected through a media server.When i press the load button, which should just give it the path of the video file on it's server. Instead it throws an error that reads "Error: Error Calling method on NPObject". [code]I've read in a lot of places that this is an issue with security, but both my swf and html are in the same folder on my local machine. Only the files come from outside, and in any case I think i've set the security settings correctly when i declare my flash player in the object tag, but maybe i'm missing something there.if you can't solve my question directly can someone please explain what "error calling method on NPObject" means? I'm sure its specific to flash-js communications because i've never seen it before and that's what i have gathered from my googling.

View 2 Replies

Javascript :: Google Visualization API - Error Calling Method On NPObject?

Apr 18, 2011

I've been playing with the visualization API aka dynamic charts and I've found that the example at [URL] does not really work on localhost. That is, Error calling method on NPObject is thrown when a event is clicked (points A and B in the example aforementioned). I suppose that is a security issue on the server end (Google's flash base).Since that jsFiddle code is hosted on a domain, the note at the very bottom of the documentation should not apply:Because of Flash security settings, this (and all Flash-based visualizations) might not work correctly when accessed from a file location in the browser [URL] rather than from a web server URL [URL] .

View 2 Replies

ActionScript 2.0 :: Use Data From External Text File For JavaScript Alert Message In Flash?

Sep 14, 2010

Can I Use data from external Text file for JavaScript alert message in flash? I wanted to change the alert message dynamically using the external text file.

1. I created the text file with data as: &Enter=Please Enter

2. And the flash action script i used is as below..

var message1;
message1 = trace(Enter);
loadVariables("temp.txt", "");
getURL("javascript:alert('"+message1+"')");

But this is not working properly. It showing me the alert window but the message it showing as 'undefined'

View 5 Replies

ActionScript 3.0 :: Loading External Movie With Scrollbar Component Produces Error

Oct 28, 2010

I have a main movie that contains a series of buttons that load different swf files into a loader component.

Each of the secondary movies contains a series of buttons that when clicked load  a movie clip with information specific to that button.

Nothing earth shattering, right...

When I preview the secondary movie it runs as I would expect.

When I bring it into the main movie via the loader component and click any of the buttons to load the secondary movie's movie clip I receive the following errors[code]...

View 3 Replies

Javascript :: Use Javascript To Call Method Within A Flash (.swf) File?

Dec 19, 2010

I have a flash file that contains a package "game" which has a class "Scores" and a method setValue(). I want to write some lines of Javascript that allow me to call that method. Someone directed me to this tutorial, but I am still a bit confused.

Javascript: alert("start"); var so; so = document.embeds[0];
so.addParam("allowScriptAccess","always"); import flash.external.ExternalInterface;
ExternalInterface.call("setValue[2600]");

displays an alert to tell me that it has indeed began to execute saves the embedded flash file into a variable and sets access imports that class calls the method.I am not sure about how this class thing works? This is just the bits and pieces I was able to come up with from that site, but I don't really understand how it all works (but certainly hope to eventually).This is the site: http:[url]...how-do-i-access-flash-function-using-javascript.When I execute the code with the importation nothing happens, but the alert does come up when I don't have that statement?

View 1 Replies

Actionscript 3 :: Javascript Callback In Chrome

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

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

Php :: Javascript, HP Reload After Alert Without URL

Jan 24, 2012

I have an html form within a flash site. The form is php processed. fix the php file so that after processing the form, the php returns the user to the flash page and reloads the html form. I tried a window.location in the php to send to the page but that did not work. It results in a white rectangle within the html code area (maybe frame but I'm not sure). How can I get just that html form reloaded? I do not want to load the entire page using a URL because that is too slow and I cannot replicate the flash state. BTW, below is a stripped down version of the code to simplify.

[Code].....

View 2 Replies

Javascript :: IE Onbeforeunload Not Firing ExtenralInterface Callback

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

Javascript :: External Interface Callback Not Listening?

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

Actionscript 3.0 :: Make A Public Static Method Call Another Method, But Flash Throws Error 1180?

Feb 19, 2010

I'm tryng to make a public static method call another method, but Flash throws error 1180, sayng that the method called by the static method is undefined.

Code: Select allpackage
{
import flash.display.MovieClip;[code]....

View 2 Replies

ActionScript :: JavaScript - Replace Trace ("something") With Flash Alert Window?

Mar 19, 2012

We can easily alert anything in java script. Is it possible to get this or similar alert in ActionScript? I have below test Class in Action Script. Trace does same as console.log() in java script. Is it possible to display messages in action script ?

[Code]...

Above code alerts the "test" similar to javascript. This is a Flash Window that shows the message. But How to integrate similar code in my Class. i.e. How to do repalce trace ("something") with this Flash Alert window ?

View 4 Replies

ActionScript 3.0 :: Flex Socket Communication With C# Produces

Jul 15, 2010

I use C# to read a string (BinaryReader.ReadString()) from the socket stream. But the problem is that flex doesn't writes the string in suitable format, so C# will be able to read that. C# reads a 7 bit encoded integer which indicates the length of the string, and just then reads the string. But flex doesn't writes a string in this format (I use socket.WriteUTF(), and even socket.WriteUTFBytes() didn't work), so C# can't read the string. Here's a little information of how C# reads/writes a string from a socket stream:
[URL]

View 1 Replies







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