ActionScript 3.0 :: Add Another Child Through A Function?
Dec 14, 2010
I have created a movie clip called 'myTextContainer' and within that is a dynamic text field with the instance 'descr'.
Now I am trying to add this to my 3d gallery of images as a title that appears below the thumbnail but really have no idea how to do this, mainly because the function I am trying to add it to is the one that creates the thumbnail.[code]...
I have a main.swf. I have loaded two child-SWFs into it, child1.swf and child2.swf.... There´s a videoclip inside child1.swf, can I stop that video from child2.swf?
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.
I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. then have a button in the child swf itself that removes the child from over the background so the user can click on another item etc.I found this code in someone's post and I am trying to modify it so that works for multiple swf files...it currently works for a single swf.I wan to pass the name of the button in front of the .swf in the URLRequest to have the same name as the instance name of the referring button. But I can't figure it out. Here is the code I am using on the stage
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?
We're loading a AS2 SWF into a AS3 Container. Then we want the AS2 SWF to run a function in the AS3 container...Is this possible without a local connection?
I have a function in a child that I need to have executed by the parent but I can't get it to work. Does anyone know how to call the function in a child from a parent?
What I'm doing is having the parent load a few buttons and I want to re-use the button swf, but have the parent provide the text for the button.[code]...
I'm sure that I'm doing something daft here - I just need to remove a child that's created in the constructor through an event listener.My code is below but does not work. Can someone point me in the right direction please?
public class Main extends Sprite public function Main() super(); var rectangleIndex:uint = this.getChildIndex(playerBackground)
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 a main.mxml, child.mxml and headermenu.mxml. I click a button on the headermenu that dispatches an event up to the main.mxml which then executes a method in child.mxml. I know this works because I put an AlertDialog in the function I'm calling inside of the child.mxml. The child.mxml contains a drawingArea object that has an erase(). When I call this directly from child.xml it executes, however if I put drawingArea.erase() inside of the function being called by child's parent (main.mxml) nothing happens.[code]...
I have to access a function in child swf from parent swf. This child swf gets loaded into a canvas object in parent.swf. Everything works fine but I'm unable to call any function that was in child.swf. My code is
Code: var swf1:SWFLoader = new SWFLoader(); swf1.source = "CHILD.swf"; can.addchild(swf1);
I read on google and then I tried this in parent.swf's code
Code: var myrequest:URLRequest = new URLRequest("CHILD.swf"); var myloader:Loader = new Loader(); myloader.load(myrequest); canvas.addchild(myloader);
Now this one throws up a runtime error TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@5934b01 to mx.core.IUIComponent.
I also tried this
Code: var myrequest:URLRequest = new URLRequest("CHILD.swf"); var myloader:Loader = new Loader(); myloader.load(myrequest);
[Code]....
But in this case my swf does not show up at all and there are no runtime errors too!
How do I resolve this error and how do I then access the function in child.swf?
I'm doing a website in flash and I'm creating sprtite to put image in it (child) when we clic on a link. But when we clic on another link, the child have to be removed but it doesn't. It doesn't reach theirselves (the child), so it can't be removed.em?This is my code:
Code: function sectIllustrations(event:Event) { contenu_mc.gotoAndStop("illustrations");
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?
A function within a child swf is continuing to go, even after I remove the child swf from the stage... this wouldn't really matter, except that there are sound elements called from within this function, and those sounds continue to play!
I need to get the value inside a handler.. ActionScript Code: public function verifyUser(p:String):String{ var verify:String var variables:URLVariables = new URLVariables(); var varSend:URLRequest = new URLRequest("verify.php"); varSend.method = URLRequestMethod.POST; varSend.data = variables; [Code] ..... It's always returning 'null'. because its not waiting for the completehandler to be completed and just passes the null value of verify..
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
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