ActionScript 3.0 :: A Swf In An IFrame Calling Javascript Function On Parent Page?
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
Similar Posts:
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
Mar 1, 2008
For over a week now, I've bee struggling with this problem for my current project, which involves many more challenges besides this one, and is soon to reach the deadline. Needless to sayHere, is a simple HTML page with an iFrame and a button that changes the source URL of that iFrame. The following is the page source, which can also be viewed from browser - simple as that.
HTML Code:
<head>
<script type="text/javascript">
[code]....
View 1 Replies
Apr 12, 2011
On a page I have a an iFrame and a swf, I've been trying to use ExternalInterface to pass values from the swf to the iFrame, anyone ever tried this and had any luck? I won't be able to post any code until tomorrow, will update then if needed.Here is a visualization of what I need to accomplish, perhaps if it can't be done the way I said someone will have a suggestion of another way to accomplish this.
View 2 Replies
Jun 19, 2011
I have an iframe to a page where a Flash swf file is running; does anybody have an idea how to make it transparent so that my drop-down menu should be shown perfectly? Kindly be informed I can't edit the source page (add param = wmode, value = transparent to the Flash object), only if there is any chance to make it possible in iframe or some JavaScript on my page, I have already tried allowtransparency="true" and background-color="transparent".
View 4 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
May 11, 2009
new to actionScript and trying to finish my final project, and i'm banging my head on a brick wall now, my question may be easy for some pros, basically i've loaded an external swf from a button at main.swf
[Code]...
this works fine. then i'm trying to disable the button function while the swf is loaded. I add another eventListener to the same button. function disableMenu( e:MouseEvent ):void { button1.mouseEnabled = false;}
that works too. ok now comes the problem. I have a close button on my child swf("content1.swf) to close itself and returen to main swf. but I want the button on main.swf to work again. so at the close button I add another eventListener hope to enable the menu. (note this is on the child swf!)
[Code]...
View 13 Replies
Aug 5, 2009
I have two movies... main.swf and content.swf, and I'm trying to call a function in my main.swf from my content.swf. Here is the code..
//function in main.swf
function appear (event:MouseEvent):void{
TweenLite.to(title1, 1, {autoAlpha:1, overwrite:false});
[Code].....
I got an error message as soon as i click on close_btn. It says appear() is not a property or method.
View 0 Replies
Apr 13, 2010
So, my problem, I have a Parent swf file that loads a bunch of smaller swf files. When I click on a button in one of these loaded swf files, I want to be able to call a function from the parent swf. Once called, the function manipulates things MC's within the parent swf.
View 2 Replies
May 12, 2009
new to actionScript and trying to finish my final project, and i'm banging my head on a brick wall now, my question may be easy for some pros,[code]this child swf is loaded from xml. and the close button is created by using AS file. The "button1" is just on the stage of the main swf. Maybe these make some difference so i can't just point it back using (root)?Any idea how do I resolve this? Or am I not supposedd to do it this way at all?
View 2 Replies
Jan 29, 2010
i have a swf that loads a swf that loads one swf into that one. i need the final swf (child, child) to be able to call a function on the first swf (parent)
i have tried this:
if(MovieClip(parent.parent.parent)!=null){MovieCli p(parent.parent.parent).parentFunctionCall();}
[Code]....
View 2 Replies
May 23, 2011
May i know how to call child function(layer 2) in parent(layer 1)?
Layer 1 (Parent)
function changeAction():void{
changeColor();
}
This method will give me the error -> Call to a possibly undefined method changeColor.
Layer 2 (Child)
function changeColor():void{
trace("success");
}
View 4 Replies
Jul 27, 2009
I have container swf which includes navigation that loads child swfs. Each child swf is loaded then visibility is set to false. Once a child ( an image gallery actually) is loaded it is possible to jump from image to image. What Id would like to be able to do is call a "clean up" function that returns the child to its initial state when anothor nav link ( a different gallery) in the parent is clicked. But I do not know how the syntax is supposed to be written or if its even possible.
Ideally it would look something like this in the parent container swf:
ActionScript Code:
function swapSectionIdentity(e:MouseEvent):void {
setChildIndex(background_home, 0);
getChildByName("identity_mc").visible = true;
[Code]...
the behavior I am attempting to avoid is when a child swf is loaded ( an image gallery) and then the child is invoked to display a particular image in it, afterwhich a main navigation link is clicked the current gallery is set to visible = false and a new gallery is set to visible = true. But when you return to the previous gallery the last image viewed is still showing. I want to be able to reutrn to galleries inital state as it is hidden. make sense?
View 3 Replies
Jan 21, 2009
syntax for calling a function (and sending arguments) located in an external SWF from a parent SWF?
View 2 Replies
Mar 17, 2009
I want to call a function in my parent movie from my external swf wich is loaded through a loader. Can anyone give me a nudge
View 4 Replies
Mar 17, 2009
I have setup a simple video interface. The video player lives in the parent swf. The video list chooser is loaded as a child swf. In this child swf, I have some video buttons nested within two movieclips in order to facilitate the scrolling feature. I am trying to get the movie buttons to load flvs into the component flv player in the parent swf. I have declared the functions in the parent and I am trying to call them in the child:Code in the Parent:
function vid1(event:MouseEvent): void{
pubPlayer.source = 'vid1.flv';
}
[code].....
View 9 Replies
Apr 14, 2010
I am adding a child .swf from the parent with a simple button. If this button is then clicked multiple times, the child is added multiple times. So I added the ".visible = false" to the button when clicked so the button cannot be clicked while the child is open.
Now, there is "Close" button on the child .swf that uses "this.parent.parent.removeChild(this.parent);" and would now need to set the parent button back to ".visible = true".
I have tried MovieClip.parent.parent.resetButton(); and parent as MovieClip.resetButton(); and many variations of the code. I get no errors but the code doesn't work either.
View 2 Replies
Jul 9, 2009
I have setup a video interface with a stock video player in the parent mc. In the same swf next to the player, I have a mc which is a video thumbnail chooser. The thumbnail buttons are located two levels down within this mc (nested within two mc) in order to facilitate the scrolling independent of the player. In the parent, where the video player lives, I placed a function:
function vid1(event:MouseEvent): void{
pubPlayer.source = 'Steve480.flv';
}
In the child mc where the thumbnail buttons are, I want to call the parent function like this:
vid1_btn.addEventListener(MouseEvent.CLICK, vid1);
None of my clips are externally loaded, just nested in the same swf. How can I talk up or down the movieclip ladder?
View 0 Replies
Aug 7, 2009
Basically i am trying to call a function which is present in one.mxml from a pop-up in two.mxml with a parameter.
one.mxml :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
<mx:Script>
<![CDATA[
[Code].....
How to i call parent's method when i don't know who the caller is?
View 0 Replies
Jul 9, 2009
I have setup a video interface with a stock video player in the parent mc. In the same swf next to the player, I have a mc which is a video thumbnail chooser. The thumbnail buttons are located two levels down within this mc (nested within two mc) in order to facilitate the scrolling independent of the player. In the parent, where the video player lives, I placed a function:
function vid1(event:MouseEvent): void{
pubPlayer.source = 'Steve480.flv';
}
In the child mc where the thumbnail buttons are, I want to call the parent function like this:
vid1_btn.addEventListener(MouseEvent.CLICK, vid1);
None of my clips are externally loaded, just nested in the same swf. How can I talk up or down the movieclip ladder?
View 2 Replies
Jul 18, 2010
I'm switching from as2 to as3 and everything was going swimmingly with my new site until i tried to use a _root call to a function on the main timeline by a loaded movieClip that is loaded nested into 2 other movieclips. the movieClip needs to tell the _root when it's done playing so the root knows to load the next one in line through a php call. Everything works except for the _root call. In as3 there's no such thing as root anymore so I figured no big deal, i'll just find out what the new thing is and holy crap wtf! I can't figure this out!! I've read from doing stuff like custom eventLisnters (which i am trying now) and casting the root as a movieClip and then I read this whole crazy tutorial on building an event structure and the proper MVC way of coding and blah blah blah ALL I WANT TO DO is tell the _root that the loaded MC has reached the end of its timeline. Basically if it were as2 i could just go _root.loadNext(); and it would work.how to make a loaded MC talk to the _root timeline and call a funciton from there?
View 19 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
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
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