Javascript :: Calling A Function From A Flash From Xml Config File
Mar 31, 2011
I've got a flash file that reads some links from an xml config file. These links look like:
<url target="_blank" method="GET"><![CDATA[http://www.google.com]]></url>
Instead of a link, I'd like to call a javascript method that opens up a modal dialog with a list of items. I've tried the following based on some things I found, but I can't get it to work.
<url target="_self" method="GET"><![CDATA[javascript:loadAsModal(#modaldiv, ajaxmenu.jsp?gid=3)]]></url>
and
<url target="_self" method="GET"><script type="text/javascript"><![CDATA[loadAsModal(#modaldiv, ajaxmenu.jsp?gid=3)]]></script></url>
loadAsModal() takes in an empty div that i put on the page, and then the menu.jsp which builds the menu given the group id. I made sure to import all of my js libraries on the page.
View 1 Replies
Similar Posts:
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
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
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
May 28, 2009
I'm trying to make it so a button I use in a swf talks to the swf's container and says...
fscommand ("javascript:changeMap('hodson.htm');")
so that in turn
function changeMap(building) {
document.getElementById('buildingINFO').src=buildi ng;
}
But that doesn't work. I also tried getURL in front of the AS instead of fscommand. basically it's an interactive map where I should be able to click a building and have information appear within a div tag to the right side.
View 1 Replies
Nov 14, 2011
I am trying to call a Javascript function in flash. I am able to call the function using the following code:
Code:
ExternalInterface.call("alert");
I have a flash movie and I want the javascript function to be called when the movie finishes but the code above calls the function at the beginning. Would anyone be able to tell me how I would get this to work the way I want it to?
View 3 Replies
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
Nov 14, 2011
I have a swf streaming an flv with the default controls from Flash. Is there a way to call a javascript function when the pause button is clicked? And then another when the play button is clicked?
View 2 Replies
Feb 10, 2012
I have a simple flash socket that I use to connect to IRC servers. It has an open, close, and send method made available to JS through ExternalInterface, for opening connections, closing connections, and sending messages respectively. The socket calls IRC.io.receive in JS whenever it gets a message, which is parsed by JS into something useful.Unfortunately, whenever any of the flash methods are called from JS, they return a "__ is not a function" error.Here's the (watered down) AS, where IRC is the document class:
public class IRC extends MovieClip {
public static function open(url:String, port:int) {/* code */}
public static function close(port:int) {/* code */}
public static function send(port:int, message:String) {/* code */}
[code]....
Any call to any of the functions registered with ExternalInterface throws a "function does not exist" exception.
View 1 Replies
Feb 20, 2009
Basically I'm trying to call a javascript function which fades in the page content at the end of the flash movie. My javascript is all fine, I've even tested it by placing a button on the page from which it works flawlessly. So I know its definitely my Actionscript which is wrong.
So I'm trying to call a javascript function from the actionscript when the swf movie enters a certain frame. I've placed the following code on a frame in my movie, but nothing, nada, niet.
ActionScript Code:
import flash.external.ExternalInterface;
[code]....
View 4 Replies
Dec 28, 2011
I've searched all over the net and have come across a few examples but being new to Actionscript, I'm finding it quite hard to get my head around this (albeit simple) problem. Basically I'm trying to call a javascript function which fades in the page content at the end of the flash movie. My javascript is all fine, I've even tested it by placing a button on the page from which it works flawlessly. So I know its definitely my Actionscript which is wrong. So I'm trying to call a javascript function from the actionscript when the swf movie enters a certain frame. I've placed the following code on a frame in my movie, but nothing, nada, niet.
[Code]....
View 1 Replies
Sep 30, 2003
I can't get this to work. I need to call a Javascript function from a button in flash. The code is as follows:
on (release) {
getURL("javascript:nameOfMyFunction('whatever.html ')");
}
This is working, so I got the call right. But what I really want to do is have that url (html) to be a variable within flash.
on (release) {
Myurl="[URL]";
getURL("javascript:nameOfMyFunction('Myurl')");
}
This doesn't work. How do you use a flash variable as a javascript function parameter?
View 1 Replies
Apr 16, 2009
I'd like to call a javascript function from an embedded .swf file. Specifically, I'd like to call a function in one of my externally linked javascript files from within: function loadTrack(){
[Code]...
which is in an .as file which I assume somehow becomes the swf file. How would I go about this and 're-compile' the .as file?
View 3 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
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
Oct 19, 2010
I need to call javascript function from Flash 4 based web application. When I run it in Debug mode it runs perfectly but when I make release build or run same application on other machine it does not call JavaScript function.
[Code]...
View 2 Replies
Apr 30, 2010
I have a SWF that is used to load other swf to it.
each of the loaded swf files has its own button events that try to access javascript functions. The problem is that they can't access the javascript. It never gets to call the functions.
If i run those swf on their own then it works..
what should i do do have embedded swfs to call javascript methods ?
View 1 Replies
Aug 26, 2008
I know I can do this:
Code:
controller.detachButton.onRelease = function()
{
[code].....
View 1 Replies
Oct 28, 2011
I have a basic mxml app which looks like this
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="800" height="600">
<mx:Script>[code].........
this swf is loaded into another swf using Loader and added with addChild(loader).i then need to call the init function from the parent swf. how can i do this? just calling
loader.content.init();
fails.another question is, what is the exact classname of this mxml file?
View 1 Replies
Jan 18, 2010
I'm trying to get AS to call a javascript function. This is working fine. As a test a changed the js function to trigger an alert.This works and the alert comes up but it forms a loop and I'm not sure you to get it to stop repeating the alert.You can see what I mean at---------------WARNING THIS LINK WILL OPEN AN SWF WHICH WILL CREATE A LOOP WHEN IT CLOSESYOU WILL HAVE TO FORCE QUIT YOUR BROWSER SO MAKE SURE THAT YOU DON'T HAVE ANYTHING IMPORTANT UNSAVED OPEN-
Here is my AS
// Create a movie clip instance.
import flash.external.*;
[code].....
View 10 Replies
Dec 22, 2009
ARCITECHTURE:the way I've set up this Flash doesn't work properly.in my html I load a preloader.swf.this preloader.swf is build with ActionScript in the first frame.this preloader.swf loads a content.swf this content.swf is build with ActionScript in a Document Class...
everything works properly this far.MY PROBLEM:my problem comes when I - using JavaScript - try calling a function in my content.swf the function I try to call is this:
public function playThisMovie(theMovieToPlay:String):void {
var newM:String = theMovieToPlay;
ExternalInterface.call("alert", "the new movie is = "+newM);
}
when calling this function nothing happens, even though I know the function exists..can it be, that I cannot call my function because it is inside my content.swf..and if yes, is there a workaround I can use?
View 6 Replies
Jul 14, 2009
I have a .swf that has to load in a iFrame and needs to call a browser cookie javascript function that lives on the parent page that loads the iFrame.I'm using this:
xternalInterface.call("javascriptFunction");
View 1 Replies
Jul 14, 2011
The flex compiler (mxmlc) allows the use of token substitution in the compiler config xml file, as referenced in the documentation.From the linked documentation it is clear that you can specify your own tokens for substitution on the commandline, but there are also some default/magic tokens available that Adobe has put in place.For example, the snippet below is reduced from an Adobe example on how to fiddle with the framework RSL sourcing:[code]I have highlighted two tokens in use there, namely hosted.rsl.url and build.number. These work "magically" without specifying them on the commandline.
Here is another example that vaguely shows the existence of a ${flexlib} token.Unfortunately, aside from those limited examples I can't find a whisper of documentation on what tokens are available... Is the list of tokens documented somewhere that I can't find? If not, does anyone know what the available tokens are so that this SO question can be the documentation? referenced build.number, I might as well also note that build.number doesn't seem to work quite like Adobe seems to think it does since for me it simply gives me the build number, not the whole string. ie: For flex 4.5.0.20967, ${build.number} just gives me 20967 which is not much help). I had a web link where someone was complaining about the changing implementation of these tokens, but I can't find it anymore.
View 2 Replies
Mar 29, 2011
We can auto-generate flex-confix xml file from flash-builder so to provide users that want to compile project on there own would be capable of doing such thing with out buying FB. So we use something like -dump-config slotConfig.xml as flex compiler argment. This generates a file for us... with lots of detailed comments like this one I generated from that project:
<flex-config>
<!-- benchmark: output performance benchmark-->
<!-- benchmark usage:
[Code]....
View 1 Replies
Feb 28, 2012
I have a main swf file and config.xml located in the same directory. My .swf file uses config.xml to fetch config variable which it does with success.The problem appears when I put those files into Flex directory. I embed .swf file like this.
<mx:Image id="loading" source="@Embed('/blobs/visualLogo/mySwfFile.swf')"
visible="true" horizontalCenter="0"/>
I also place config.xml into /blobs/visualLogo/
This time I get an error in Flex:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mySwfFile_fla::MainTimeline/frame1()
View 1 Replies
May 21, 2011
I have a flex application which contains different feature that includes google maps, twitter, facebook etc.
Currently I have hardcoded api keys in the code it self but I want to use a properties file/config file where I can put such things and use anywhere I want in the application.
Is it possible to achieve this in flex? I am using swiz framework. Is it possible to achieve this using this framework?
View 3 Replies
Dec 17, 2010
I'm calling a function:
public function playCover(){
this.gotoAndStop(2);
trace('1');
[code]......
View 0 Replies