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]...

View 0 Replies


Similar Posts:


ActionScript 3.0 :: Calling Function From Child To Child?

Dec 9, 2010

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?

View 2 Replies

Actionscript 3 :: Flash Call Function In One Child Class From Another Child Class?

Dec 1, 2011

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.

View 3 Replies

ActionScript 3.0 :: Multiple Buttons To Open Child Swfs Then Be Able To Close The Child From Within The Child?

Mar 25, 2009

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

View 2 Replies

ActionScript 3.0 :: Remove The Child Function?

May 5, 2009

I have the following function to add movie clips to the stage...I assume it is the correct way to add movieclips to the stage becuase it works.
 
function attachMovieClips(){for (var i=0; i<list_array.length; i++){var mySelectFile:selectFile = new selectFile();mySelectFile.name = "mySelectFile"+i;mySelectFile.y = (mySelectFile.height + 10)*i;addChild(mySelectFile);}}
attachMovieClips();
 
i need a function to remove all the attached movie clips...I assume i need to use removeChild however everything i've tried hasn't worked...

View 4 Replies

ActionScript 1/2 :: Call A Function From Child Swf?

Dec 7, 2011

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");

[Code]....

View 4 Replies

ActionScript 3.0 :: Calling A Function From A Child?

Feb 18, 2009

I'm trying to call a public function that is in the document class from a child of a child...

ActionScript Code:
private function handlerClick(event:Event):void {
var sendID:String = event.currentTarget._id;
var sendType:String = event.currentTarget._type;
var sendPath:String = event.currentTarget._path;
var sendIndex:String = event.currentTarget._index;
this.parent.parent.navClicked(sendType, sendID, sendPath, sendIndex);
}

When I do this I get an error "Call to a possibly undefined method ' navClicked' "

I was working around trying to create a custom event by using the click in the child and calling the 'do something' function from within the class.

View 5 Replies

ActionScript 2.0 :: Call Function In A Child?

May 13, 2010

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");
}

How do I call that function from "Washformulas"?

Bullet1.testf();

View 3 Replies

ActionScript 3.0 :: Calling Function From Child Swf?

Jul 19, 2010

How do you call a function within a child.swf from a parent.swf?There seems to be a load of advice for the revers

View 3 Replies

ActionScript 3.0 :: Calling A Function From Child SWF?

Jul 25, 2010

The fololowing code works:

Code:
function btnHandler(evt:MouseEvent):void
{

[code].......

View 1 Replies

ActionScript 2.0 :: Running A Function From A Child MC?

Jun 13, 2006

I have a function called menuchange sitting on frame 1 of _root.pt_menu.ptmenumc.menufinal.menuchange

To run this function I would use _root.pt_menu.ptmenumc.menufinal.menuchange();

View 1 Replies

AS 3 :: Child Call A Function In Its Parent?

Mar 7, 2009

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?

View 1 Replies

ActionScript 3.0 :: Run Function From Child SWF Without Local Connection?

Sep 20, 2010

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?

View 2 Replies

ActionScript 3.0 :: Get Parent To Execute Function In Child?

Jun 22, 2009

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]...

View 20 Replies

ActionScript 3.0 :: Pass A Child From The Constructor To Another Function?

Sep 6, 2010

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)

[code]......

View 5 Replies

ActionScript 3.0 :: Parent Calling Child Function?

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

Actionscript 3 :: Accessing Function On Stage From A Child?

Jul 22, 2010

I have a function in stage and need to call it from a child I do I do it...

// In main stage
var child_mc:mcChild = new mcChild();
addChild(child_mc);

[code].....

View 2 Replies

Flash :: Call Parents Function From Child?

Jan 18, 2011

My parent ActionScript3 file has functions like these:

package
{
*lots of import.*
public class Tabu extends MovieClip
{

[Code]...

View 1 Replies

Flex :: Call Child Function From Within Parent?

Jun 1, 2011

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?

View 2 Replies

Flex :: Parent Not Executing Child's Function

Jun 7, 2011

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]...

View 1 Replies

ActionScript 3.0 :: Access Child.swf Function From Parent.swf?

Dec 22, 2008

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?

View 9 Replies

ActionScript 3.0 :: Remove A Child That Has Been Created Into A Function?

Feb 9, 2009

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");

[code].....

View 0 Replies

ActionScript 3.0 :: Calling Function In Child Swf From Parent

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

ActionScript 3.0 :: Access A Function Inside Child?

Jan 11, 2011

I have difficulty accessing a function inside a child object from parent.I've created an object named "dot" which has the following code in it:

ActionScript Code:
import com.greensock.*;
import com.greensock.easing.*;

[code].....

View 9 Replies

ActionScript 3.0 :: Function On Child Swf Continues After Its Removed

Mar 2, 2011

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!

[Code]....

View 2 Replies

ActionScript 3.0 :: Returning Value To Parent Function From Child

Aug 29, 2011

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..

View 4 Replies

ActionScript 3.0 :: Call Function In Child Layer?

Mar 14, 2012

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

[code]......

View 1 Replies

Actionscript 3.0 :: Call A Parent's Function From Child Swf?

Jan 2, 2009

this is the code i found out on the web to call a function in the parent swf from the loaded child swf.

in the child swf:
Code: Select allpanel.next_mc.addEventListener(MouseEvent.CLICK, onClick);

function onClick(e:MouseEvent):void{
MovieClip(this.parent.parent).parentFunction();
}

[Code].....

View 6 Replies

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

View 1 Replies

Actionscript 3.0 :: Calling Function In Child MovieClip?

Sep 11, 2010

Here is the simple example

//main is MovieClip on main timeline
//VideoPanel is MovieClip in the library
var theVideo:VideoPanel=new VideoPanel();
main.addChild(theVideo);

[Code].....

View 3 Replies







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