Actionscript 3.0 :: Call Function In Child External Swf
Feb 7, 2010
how can i call a function in a child swf that has been loaded in externally? basically ive got a holder and then i loop through a list and add that many slides to the holder each slide has an external swf loaded in and one of them i need to be able to call a function from the parent
here is a parent swf loads a child swf file and there is a button/movieclip in child swf e.g childBtn_mc, now whener i click this childbtn_mc in parent swf (as child swf is loaded in its parent swf) i want to through a function in parent swf.
for ex.
child swf AS: childBtn_mc.onRelease = childBtnClicked; function childBtnClicked(){ trace("calling from child");
how do I call a function defined in a child ... in AS2 (flash 8.0)
I have this situation: Movieclip "Washformulas" (not in root but works 'standalone' from itsself) having a couple of instances of "Bullet"-movieclips, named "Bullet1", Bullet2,...
For simplicity "Bullet" is 1 frame, and has this code :
ActionScript Code: function testf() { trace("test"); }
I have a function (let's call it testFunction for right now ) on the actions layer in the main timeline There is a movie clip with 15 frames long in the library
i want to add a child of the movie clip on the stage, and call testFunction when it finishes playing
how can i do? i tried to call it in the child but nothing works
Or, is there any way to show child on the stage for only a period of time like 1 second and then remove it automaticly?
I'm trying to call a function in one child class (Circle.as) from another child class (Wedge.as). Circle.as is instantiated by the document class (Tree.as), and Wedge.as is instantiated by Circle.as. How do I do this? This is my code:
Tree.as package com.treediagram { public class Tree extends MovieClip {
[code]....
How to call a function in a Class from another Class?but it was a bit hard to follow as it relates to my problem. One of the solutions worked, but was commented as being bad form, and another did not work, so I want to make sure I structure my code properly.
Is it possible to call a child function from within the parent? I know to go child > parent, you can do parentApplication.functionName(parameters);, but what about going the other way... that is parent > child?
I have one problem I am not able to solve at the moment and probably someone will have quick answer. I have a .fla file with with several layers let choose one line...
Main Scene - Scene1 Fisrt Layer - PageGalerieVeci (instanceName PageGalerieVeci_layout) in PageGalerieVeci layer are two other layers
I have a main MovieClip that creates a new instance of an imported class which is a page in the application. This class tries to call a function on the main MovieClip and it's not finding it. I've done this in the past without any problems with separate swf files and loaders, and with movieclips in a library. I'm at a loss on how to resolve this. Here's what I'm doing (simplified for posting):
I have two child classes ClassA and ClassB both inherit the same base class.
I also have a function that has a parameter which could be an instance of either child classes.
function Test(instance):void //instance is either a ClassA or ClassB instance { instance.DoSomething(); }
However, when I run the test, it's always the BaseClass.DoSomething() get called. How can I use the same function (DoSomething()), but call child class function instead of the base class one?
I am using in AS3 "External Interface ". When I call the JS function that is on the same page as swf everything works fine.
I added a link in the html page to an external JS file, when I move the JS function to the external JS file the website crushes.
I would prefer to have all my JS functions on an external file so I can use them in the future in other project and it also makes it easier for me to update the site.
how to call a JS function that is on an external file from AS3?
I have an ActionScript program that I want to access some external JavaScript functions. By external, I mean that the ActionScript/swf aren't going to be loaded via the HTML/JavaScript. Everything I see recommends ExternalInterface, but that seems to imply that your JS loads your swf. Is there a way to call a JavaScript function by URL?
I have an external swf(s) loaded in a main swf container. I am trying to create templates for non-coders. The main swf loads "pages" based on the currentFrame number. i.e. if on frame 12 load "m1_012.swf"I need the function call to the main swf to be dynamic.The variable function call doesn't work in the following code. The last function call does work. How can I "eval" the variable function call?
var parentObj:Object = this.parent.parent.parent; var tempFrame:Number = parentObj.currentFrame; var funcName:String = parentObj+"moreInfo_"+tempFrame;
I have a bunch of SWF files that have x amount of frames on them..When it reaches the end, I want to call a function. The problem is I dont have access to the FLA files. I have the total number of frames by doing slideHolder._totalframes which gives me all the frames...The only thing I can think of is doing an interval that checks _currentframe against _totalframes, but I want to know is their another way to do it?
i want to call an external function inside a class. thats the code;
in checkConnectionStatus function,
this[_funcNameForSucceededCon].apply(); doesnt work because "this" is the class, not the Application. How can i reach Application at this time or what can i do?
For some reason I cant figure this out,I have a function thats in a method in a class..I have a second method in the same class, trying to call the function from the second methodeg:
I have 2 buttons in my main movieclip, one called "projects by client" and the other "projects by category".I have an external projects.swf which has 2 functions CLIENTS_CLICK and CATEGORIES_CLICK. The code is in the first frame of the projects.fla actions layer and not in a class.
Lets say I have a Main Document Class called Main. I also have a child class called childClass that call a function from the Main class and is also imported in the Main class. How should I call the function? I tried this , but when calling the function, it's getting me error.
I'm loading from my main page an external js file, with a function.
I have a flash file in the main page invoking the javascript function.
Everything worked very well until when the javascript code was in the main file, but when I moved javascript to an external file the function seems not called anymore.
So... there is no way to move the javascript code to an external file ? Or any other solution ?
I need to call a function in JS that's expecting a JSON object. Can I do this from External Interface? The company's example (after the include file url) in HTML looks like this:
//there's an js include URL earlier// Shopwithme.Initialize({ "id":"prod1234",
[code]...
But, I need to dictate these vars through Flash. How do I call this function using External Interface?This is my EI code, but I'm obviously off base, since it's not working:
I'm trying to edit some flash to make an external javascript function call, but with no success. Here's my actionscript 2.0 code:
[Code]....
I've seen lots of examples and I'm mainly confused about the use of ExternalInterface.addCallback. I don't need the javascript to return anything to flash, so is this necessary? For whatever reason, I never see the alert. Does anyone see any problems in my code? Is there some ExternalInterface library I don't have? Also, what's the BEST way to use ExternalInterface (ie; error checking, etc.)
I have small issue in as3. I am load "mainmenu.swf" file into "main.swf". through loader class. so now "main.swf" is parent "mainmenu.swf" file children how can call "main.swf " variable & function from "mainmenu.swf" .