ActionScript 3.0 :: 'Grandchild' Button Activivating Instance On Parent

Nov 3, 2011

Just wondering how I reference A button that I have within a movie clip, within a movieclip to and instance on the parent timeline.At the moment I am using, but not getting the correct result:MovieClip(parent).NavBar.gotoAndPlay("About");

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Positioning - GrandChild In Relation To Parent?

Jul 25, 2010

I have 3 swfs which I load into one another- grandChild loaded into child, and child loaded into mainMovie.I am positioning the child to the center of the mainMovie(parent). I also use resizeHandler to make sure the child stays center when stage resizes.When I load the grandChild, I would like to place into on the stage in relation to the mainMovie i.e 100px from the top of the mainMovie.

I tried to write the code in my mainMovie:

child.content.root.grandChild_mc.y=100;

But this only place the grandChild on the stage in relation to the child and not the mainMovie.

View 1 Replies

ActionScript 3.0 :: Parent - Child - GrandChild - Positioning

Jul 19, 2010

I have three swf, which I load into one another,with the relation parent, child and grandChild. I want, from the child be able to load the grandChild and tell it to always position the grandchild 50px from the top in relation to the parent. (I have created resize handler which works for the child) I tried:

[Code]...

View 3 Replies

ActionScript 3.0 :: Call The Instance Name Of A Button From Child.swf To Parent.swf?

Apr 8, 2010

one of my problem is that how do i call the instance name of a button from my child.swf to my parent.swf

i have four buttons from my child.swf where when i click btn1 it will load superchild.swf but i want to load that superchild.swf to my parent.swf, like instead btn1 calls superchild.swf to load, btn1 will call parent.swf then on parent.swf it will distinguish that btn1 was click from child.swf and it will now load superchild.swf.

View 3 Replies

ActionScript 3.0 :: Retrieve Instance Name Parent Challenge

Jan 16, 2010

An external application sends an instance name to flash over TCP/IP.I have code that parses out the communication and retreives the instance name (not it's absolute path).I then need to retreive the instance name's parent in actionscript. The instance name that gets sent is a child of specific movieClip, there are several movieclips on the stage. I need to know it's specific parent name..the code is placed on the main timeline.

View 3 Replies

ActionScript 3.0 :: Accessing A Parent Instance From A Loaded Swf?

Jul 21, 2010

I have a "MainSWF", that loads and places other SWFs "LoadedSWF". The LoadedSWF has buttons that are supposed to make some layers in the MainSWF visible/invisble. These layers are in a placed navigation bar that is defined as a symbol, was placed on the Main Stage and given the instance name "FlashStageMainNavigation". I have a hard time figuring out how to address the layers in the MainSWF, because it seems I am missing something.

When I use a loop to trace all the child instances on the stage of the MainSWF with:

this.getChildAt(i).name

I get the following info:

instance1 this.name=0
FlashStageMainNavigation this.name=4

When I trace stage.getChildByName(this.name) in MainSWF I get "FSMain", which is the name of my main Class

My assumption was, that I could (from the LoadedSWF) address the Navigationbar in the MainSWF by using something like:

stage.FSMain.FlashStageMainNavigation.visible = false; //or
stage.getChildByName("FSMain").FlashStageMainNavig ation.visible = false; //or
stage.getChildByName("FlashStageMainNavigation").v isible = false;

neither of that worked.

To sum up/rephrase my question: How can I find out, which object instances are placed on the stage and how do I address them from the LoadedSWF?

View 4 Replies

Flash :: Play Movie Clip Instance Inside Of Button Instance?

Apr 16, 2011

I placed a movie clip instance inside a button, and I want this movie clip to play when the button is released. I'm using this code on the frame containing the button:

function playMovie(event:MouseEvent)
{
this.theButton.theMC.gotoAndPlay(3);

[code].....

View 2 Replies

ActionScript 3.0 :: Accessing An Instance Of Parent Movieclip For HitTest?

Dec 13, 2009

I have a stage with instances of bauble_mcs on it that are attached by the document class of the main timeline (can someone tell me what the right term is here? I don't know what I call the main time line in AS3).I then have instances of snow_mc attached by the same class. Inside the snow_mc I want to test to see if it is hitting any bauble_mcs but I don't know how!

inside snow_mc I am trying:

PHP Code:

if(this.hitTestObject(this.parent.bauble_mc)){
}

to which flash says:

1119: Access of possibly undefined property bauble_mc through a reference with static type flash.displayisplayObjectContainer.

View 1 Replies

ActionScript 3.0 :: Child Class Object Instance - What Can It Tell About It's Parent

Sep 15, 2010

If an object, or say... a document class, creates an instance of a class (and stores it as a variable), and it doesn't pass any arguments to the constructor of the class, can that class object, by simply having a function of it called by the parent, tell who sent it that command/request?In other words, can a class object know who called it (such as it's parent) via a (seemingly) anonymous call?

View 1 Replies

ActionScript 3.0 :: Flash Exteneral Swf Instance Name And Parent Communication?

May 24, 2011

In a nutshell, this project is an eLearning course template. It needs to be able to load/unload individual page swf and these page swfs need to communicate back up the chain to some level for this like module / course completion. On the stage I have a pageLoader_mc linked to a PageLoader class. What I need up doing is added my LoaderObject to the display list of my pageLoader_mc MovieClip:

Code:
package {
import flash.display.MovieClip;
import flash.events.*;

[code]....

The Swf of the course loads. When you go to another page after it unloads the SWF I get an error:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::AVM1Movie@37710d61 to flash.display.MovieClip.
at PageLoader/loadComplete()

The Overall question, is how can I instance that loaded SWF so I can listen to custom events? In my loaded swf I guess I can "MovieClip(stage.pageLoader_mc).CallMyFunction "

View 2 Replies

ActionScript 3.0 :: How To Click On "shape" Or Grandchild

May 15, 2010

I have a "Camera Class" (its a Sprite) and the camera has children i want to click on them and move them, but it says the Camera Class does not implement MoveShape(). I know i'm clicking on the shapes wich are children of camera and camera is inside the main MovieClip.

View 6 Replies

ActionScript 3.0 :: Positioning Parent MC In Order To Center Child MC On Parent's Parent MC

Feb 5, 2010

[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]

View 2 Replies

ActionScript 3.0 :: Remove Parent.parent.parent Child?

Jan 3, 2010

I got a "preloader" that creates an movieclip and loads an SWF. Now in the loaded SWF i want a close button to go back to the "preloader". The preloader isn't an actuall preloader but some sort of mainclip.Now i tried this:removeChild(MovieClip(e.currentTarget).parent.pare nt.parent)But i get error:ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display::DisplayObjectContainer/removeChild()at MethodInfo-6()

View 1 Replies

ActionScript 2.0 :: Objects - XML - Creating A New Instance Of An Object That Uses An Identical Name To An Older Instance Delete The Previous Instance?

Mar 20, 2009

Does creating a new instance of an Object that uses an identical name to an older instance, delete the previous instance? Or should the original instance be deleted first? The code uses a ridiculous amount of XML vars. Isn't it less memory intensive to parse the XML and save the properties to an Object, and then delete the XML Object, rather than keep the XML Object around and reference it's child nodes directly? Is it better form to break up a huge XML file (>600lines/3200vars) into smaller chunks?

View 1 Replies

ActionScript 3.0 :: Referencing Stage - Add Bullets To The Stage Rather Than Using Parent.parent.parent.addChild?

Jul 10, 2009

I'm currently making a platform game and when the player shoots i want to add the bullets to the stage. The players gun class is in charge of adding bullets. The "players gun" is a child of "players gun holder" which is a child of "player" which is a child of the stage. is there a better or more dynamic way for the "players gun" to add bullets to the stage rather than using parent.parent.parent.addChild (bullet);

View 2 Replies

Click Button In Exported SWF To Go To Frame In Parent?

Oct 29, 2011

I got these codes on the web, but they're not working. (I'm pretty new to flash).[code]...

View 20 Replies

ActionScript 3.0 :: Nested Button Referencing Parent MC?

Dec 4, 2009

I am working on a tool for use in our office which creates XML. At this point I am working on getting an error message to appear when the user enters incorrect data in one of the textfields. I have a MC which contains my error message as well as a button. The button will move the MC back off of the stage. Everything works up to the point where I click the nested button. I suspect there is a problem in referencing the parent MC from the button.Here is the code for the entire project. I am sure there are more than a few errors since I am relatively new to AS

import fl.controls.RadioButtonGroup;
import flash.display.*;
load_file.addEventListener(MouseEvent.MOUSE_UP, do_load_file);//load file button click.

[code]........

View 0 Replies

ActionScript 3.0 :: One Button For Open New Swf And Closing Parent?

Jun 14, 2010

I want make one flash profile, I made one logo.swf file finalize with exe file and the last end of movie coming one button if i will press this button i want to load main.swf and at a time need close my logo.swf. How can write in action script 3

View 1 Replies

ActionScript 3.0 :: Can't Get Button To Play The Parent Timeline

Aug 30, 2010

I can't get my button to play the parent timeline.. I can get it to alpha out the MC but not play the timeline.. grrr..

ActionScript Code:
import com.greensock.*;
import com.greensock.plugins.*;
TweenPlugin.activate([FramePlugin]);

[code]....

View 0 Replies

ActionScript 2.0 :: Why Nested Button Will Not Move Its Parent

Jan 22, 2007

I have 2 child movieclips nested into one working parent movieclip, then the parent movieclip is animated. The nested working parent movieclip should move to the side once a child movieclip is clicked. Currently, the parent is unaffected by clicking on a child movieclip. What gives?

Below is a layout of the movieclip:
Button List Box
| |
v v
Subparent(groups btn and list box)
|
v
Parent(animated)

I need the parent to animate once the child Button is clicked.

View 4 Replies

ActionScript 2.0 :: Button Goto Frame On Parent MC?

Jun 23, 2008

I have a parent MC with all my content called GUI_MC, and on my timeline I have a Frame labelled "PAGE"

Within the GUI_MC I have a another MC for my navigation (NAV_MC)

In NAV_MC I have a button which I would like to gotoAndPlay the frame "Page" on the GUI_MC

Heres my button code:

on (release){
gotoAndPlay("PAGE");}

What do I need to add to make it goto the parent MC?.

View 1 Replies

ActionScript 3.0 :: Nested Parent Button Functions?

Jan 31, 2009

i have a nested swf that functions just fine.i have a parent swf (that holds the nested swf) that has a button (not related to functions of nested swf) that no longer works when combined.the button is simply a link button to a url... is there a very simple solution to this?

View 2 Replies

ActionScript 2.0 :: Child Mc Button Not Connecting To Parent Mc?

Mar 8, 2009

i've gone over and over this for about a week now, and no luck. here's the deal. on the top level mc called "Scene 1" i've got links to the child pages as so:

Code:
on (release) {
_root.contentHolder.myHeight = 826;
_root.contentHolder.newLoc = 10;
heightAnimation();
}
myHeight adjust the footer to drop down to fit the height of the mc
newLoc is the frame # in the contentHolder mc

these work perfectly.

my issue is i've now got a button in the contentholder mc, not the main mc, that i need to do the same two functions. since the actionscript that these call lives in the main mc i assumed i could just use _parent:

Code:
on (release) {
_parent.contentHolder.myHeight = 826;
_parent.contentHolder.newLoc = 10;
heightAnimation();
}

this does not work.

i've tried several ways to make this happen, and no luck. if the buttons on the main mc all work great and call the new page mcs, then why won't the button in the child mc work?

View 4 Replies

ActionScript 3.0 :: Enabling Parent Button While External Swf Is Loaded?

Jul 25, 2011

how to load an external swf into my main timeline. As far as I understand this main timeline is the "parent". Hence the loaded, external swf should be the "child" (a quiz).Now the child (a quiz) loads into the flash file and is played properly, but I cannot access the button on the parent anymore. Unfortunately, I really need the home button on the parent to exit the quiz and allow for new navigation within the flash document.

my AS3 Code:

import flash.events.MouseEvent;function onClick611 (event:MouseEvent) :void{  gotoAndPlay("home_einf")}home_btn.addEventListener (MouseEvent.CLICK, onClick611);
import flash.net.URLRequest; import flash.display.Loader;import flash.events.Event; import flash.events.ProgressEvent;

[code]....

View 2 Replies

Flash :: Link Button In Tree At End Of Each Parent Node

Apr 18, 2011

I need to have link buttons at end of each parent node as shown below [code]rename, delete and diasble are link buttons. I have tried with label function and other methods also but not able get the exact requrement.

View 1 Replies

Flex :: Link Button In Tree At End Of Each Parent Node

Apr 18, 2011

I need to have link buttons at end of each parent node as shown below:
-->(Parent)IBM Machines (rename | delete | disable)
Child 1 Child 2 Child 3
-->(Parent)Sony ( rename | delete | disable)
Child 1 Child 2 Child 3
Rename ,delete and disable are supposed to be link buttons. I have tried with label function and other methods also but not able get the exact requirement.

View 2 Replies

ActionScript 3.0 :: Nested Mc Button Calling Parent Function?

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

ActionScript 3.0 :: Get A Loaded Swf To Subscribe To Parent Swf's Button States?

Aug 20, 2009

The parent slide show has audio buttons: mute, volume up, volume down, and replayThe loaded swfs will need to play sound based on user interactions, but how do I make it so the loaded swfs play at the appropriate volume set at the parent level? The parent does not exist at compile time, so a parent method call won't work. Somewhere I though I read I could use dispatchEvent to get the child swf to listen to the parent's button changes and make appropriate changes in its own volume levels.In the main class of the parent swf, I instantiate AudioPanel (as audioPanel) which builds the controls, keeps track of the volume and mute state, and dispatches a custom AudioEvent event when the buttons are clicked.The main class of the parent listens to the events dispatched by AudioPanel with this code:

ActionScript Code:
audioPanel.addEventListener(AudioEvent.VOL_CHANGE, volChangeEventHandler);
audioPanel.addEventListener(AudioEvent.REPLAY, replayHandler);

[code].....

View 5 Replies

ActionScript 3.0 :: Button In Parent SWF Calls Function In Child SWF?

Mar 26, 2011

I do not want to use external .as files because I will have about 100 swfs to manage in this project, 100 swf is a lot of file management alone without adding 100 .as files on top of it.This is the code in the parent swf file to call the child swf and place it in the page_mc movieclip (note in my final project "child.swf" is replaced with the loading array variable but we're going to keep it simple):

ActionScript Code:
var pageLoader:Loader = new Loader();
page_mc.addChild(pageLoader);
var loadedpage:URLRequest=new URLRequest("child.swf");
pageLoader.load(loadedpage);

Now just for a simple function to call, we'll say we have a box_mc on the stage in the child swf, and when we click the button in the parent swf I want to call a simple function like this to hide it:

ActionScript Code:
function hideBox(event:Event):void {
box_mc.visible=false;
}

how do I call that function in the child swf from a button in the parent swf?

View 2 Replies

Actionscript 3.0 :: Nested Mc Button Calling Parent Function

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







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