ActionScript 2.0 :: [CS3] Parent And Child Communicate?

Feb 14, 2011

I've made a big pretty website. So big and so pretty that it takes more than two minutes to load. I figured I could make it smaller by breaking it up into separate swfs and loading them into a holder as required, but I have no idea how to make them talk to eachother. I'll give a basic example.So, i've loaded up my movie into the holder movie with:loadMovie("page1.swf","page1MC");and in page1.swf there is a button called "page1_buttonA". In the old giant overweight site, onRelease it did a gotoAndPlay, but now I would like it to load the next part excitingly named page2.swf. For my own sanity's sake I'd like to keep the most of the code controlling all the to-ing and fro-ing in the holder movie. So, what's the format (syntax?) for getting the holder movie to notice what happens in the child movie and getting it to react accordingly?

//button that loads page 2
page1MC.page1_buttonA.onRelease = function() {
_root.createEmptyMovieClip("page2MC",2);

[code]....

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Parent.removeChild(child) Doesn't Update Parent Width / Height When Child Was Rotated

Jul 29, 2011

I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.[code]Sprite2 is a rectangle. When I rotate it, of course, the height of its parent, SpriteP, GROWS. But I would expect that height to go back to what it should be when I'm removing Sprite2!And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200.

View 10 Replies

ActionScript 3.0 :: Child-parent Relationship \ Adding Them All As Children Of The Stage And Creating A Parent-child Hierarchy Between Them?

Jun 6, 2011

i am slightly confused about the parent and child relationship. lets assume we have several different instances, what would be difference of adding them all as children of the stage and creating a parent-child hierarchy between them(other than the access path).

View 5 Replies

ActionScript 3.0 :: Parent.removeChild(child) Doesn't Update Parent Width/height When Child Was Rotated

Jul 29, 2011

I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.

When Sprite2 is NOT rotated:

Code:
trace(SpriteP.width + ' ' + SpriteP.height); //100 250.
SpriteP.removeChild(Sprite2)
trace(SpriteP.width + ' ' + SpriteP.height); //100 200. -> works, 200 is good.
When Sprite2 is rotated at 90:

[Code].....

And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200. But if I rotate Sprite2, the Parent won't update its bounds.

View 1 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 2.0 :: Get Mc To Communicate With Parent?

Nov 6, 2004

How do I get a targeted mc to communicate with the parent timeline? I'm not using levels but targeted mc.

I need the playback head to go from the targeted movie clip (this is called nested, correct?) to the parent timeline and stop at a particular movie instance or frame label. I have been unsucessfully using this:

gotoAndPlay(_parent.instancename);

View 5 Replies

Communicate Between Loaded And Parent Swf?

Mar 8, 2009

I started learning the basics of as3.0 a year ago by doing a lot of experiments.. I never read a book or took lessons or something.. I guess i'm still missing important logics when i'm programming. I'm creating my personal flash imagegallery but I can't figure out how to communicate between a loaded swf and its parent swf.

I have a main.swf file with document class main.as which loads external swf files into a movie container. I am also loading a background sound like[code]...

The only work around I was thinking about would be to keep showing the stop/start sound button from the main.swf when a slideshow instance is called.. but then I'll screw up my design I want a second button inside the slideshow that can also stop the main bg sound.

View 1 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 3.0 :: Loader() Swf Communicate To Parent Swf?

Aug 2, 2008

i got communication working going to the Loader() swf, but how do i have the swf thats loaded in via the Loader object talk to the parent swf?

View 9 Replies

ActionScript 3.0 :: Can't Get Movie Clip To Communicate With Its Parent?

Aug 29, 2009

Within ninja.swf, there are six scenes, and in the later 5 scenes, there is an movie clip (consule2)with has a halfdozen buttons (of which one is home_btn) that serve as the navigation across the site. So, in the consule2, I set up an Actions layer, and for Home_btn, have created this piece of code:

//Home Buttonfunction gotodsHome(event:MouseEvent):void{  MovieClip(root).gotoAndPlay("FullLoaded","01_Landing_Page");}Home_btn.addEventListener(MouseEvent.CLICK, gotodsHome);

[code]......

View 5 Replies

ActionScript 2.0 :: Get A Targeted Mc To Communicate With The Parent Timeline?

Nov 6, 2004

How do I get a targeted mc to communicate with the parent timeline? I'm not using levels but targeted mc.

I need the playback head to go from the targeted movie clip (this is called nested, correct?) to the parent timeline and stop at a particular movie instance or frame label. I have been unsucessfully using this:

gotoAndPlay(_parent.instancename);

View 5 Replies

ActionScript 3.0 :: Add A Clip To The Stage As A Child And Remove The Parent And Set The Parent Equal To Null?

Sep 11, 2010

if I add a clip to the stage as a child and remove the parent and set the parent equal to null, does the child get collected and removed from memory? What if the child has an image loaded into it as its child? 

In my application I'm loading a series of png images as overlays that can be tinted for customizing in this app. When I trace my memory, the basic app idles at 64,000 k. The exact second I load those overlay images it goes up to 205,000k. If I remove those clips and "clear" the stage I should go back down to 64,000 k if everything is removed and collected correctly, right? It's not, it's hanging at 215,000 k. Are my images being cached and that is the reason for the memory staying up? If so, how do I prevent that. Or upon removing the parent of the image how can I un-cache the image.

If a user switches between models and loads several different items then the application actually crashes the Flash environment because of too much memory usage. It also does the same to browsers.

View 29 Replies

ActionScript 3.0 :: Tab Indexing Loop Through Parent, External Child Swf, Back To Parent?

Nov 11, 2009

I have a parent swf which loads many child swfs (though only one is displayed at a time). My intention was to use the loaded SWFs document class to retrieve an array of objects to be assigned a tab index, combine this with the parent's own array of objects and apply sequential tab indices to them all. But what happens is actually that the parent's objects are assigned an index, but the external swf is unaffected. In fact, the external swf retains its automatic tab indexing, when I would expect that having set a value for InteractiveObject.tabIndex, automatic tab indexing would be disabled.

I've seen similar tales elsewhere. Most posts I've read are wanting to load an external swf, give it focus and loop through those objects, then close the swf and return to looping through the parent. However I would like loop through all objects as one. including manipulating the focus manager(s), and basically fiddling with every tab-related property I know.

View 2 Replies

IDE :: Get Child Swf To Communicate With Main Swf?

Feb 2, 2009

how do I get my child swf to communicate with my main swf?

(this is main1.swf)
var homeRequest:URLRequest = new URLRequest("window1.swf");
var homeLoader:Loader = new Loader();

[Code]....

Obviously, MovieClip(root) is not getting to the main.swf's root timeline. What code do I need to do this?

View 1 Replies

ActionScript 3.0 :: SetChildIndex And SwapChildren - On Mouse Over Set The Parent Of The Moused Over Text Field To The Highest Depth Child Of Its Parent

Sep 29, 2011

trying to on mouse over set the parent of the moused over text field to the highest depth child of its parent i tried both of these: [code] private function

[Code]...

View 3 Replies

Actionscript 3 :: Assign A Parent's Variable From The Parent's Child?

Nov 7, 2011

i want to pass the variable from parent to child .How Can i pass the Variable.Here i paste my code.

My Parent Class

public class PlayerStrobe_domaincheck extends Sprite
{
private var myService:NetConnection = new NetConnection();
private var _loader:Loader;

[Code]....

View 3 Replies

ActionScript 3.0 :: Communicate To A Child In Different Frames?

Jul 8, 2010

I have no clue on how to reference to different childs in a movieclip on different frames. Let me explain the situation:

I have a movieclip containing different views of a car distributed on frames. On these frames there are targets that must respond when clicked (the position of the targets vary from a frame to another) I can only reference to targets on the first frame.

ex: Movieclip.target1.addEventListener(MouseEvent.CLIC K, showPart)

how can I communicate to the targets on the other frames of my Movieclip ?

View 4 Replies

Actionscript 3 :: How Can A Loaded Child Swf 1 Communicate To Next Child Swf, Child Swf 2, Which Is Currently Not Loaded

Oct 14, 2011

I have a parent swf with three buttons: next button, back button, ticker on/off button.I have three child swfs, each with a ticker mc. When I click on ticker button on parent swfit dispatches a custom event which brings ticker MC on stage and thus ticker becomes visible (ticker off button displaces it out of stage by changing the value of ticker_mc.y).

the problem I am facing is when ticker is on and I click next or back button to load next or previous child swf, the ticker goes off. How can I make sure that ticker is on all the time and closes only when I close it. How can a loaded child swf 1 communicate to next child swf, child swf 2, which is currently not loaded, that since the ticker is on on swf 1 so you please keep the ticker on on swf 2 as well?!

I think I know the problem. I have put a default value of ticker_mc = 160 (makes ticker inactive) on every child swf. So, the ticker becomes inactive everytime I load a new child swf. If someone could guide how can I do this, my problem will be solved: When first child swf is loaded, the default value of ticker_mc.y should be 160. I want to hold this value in a variable. When I click ticker active btn, position of ticker_mc changes to 194 so the value of variable should change to 194. When I click next btn, the variable value (160 or 194) should be sent to next child swf and ticker_mc.y should be equal to variable value.

This is the code so far

"Next button"
go_mc.next_btn.addEventListener(MouseEvent.CLICK, playNext);
function playNext(e:MouseEvent):void {
if (swf_no < (clips.length-1)) {

[code]....

View 1 Replies

ActionScript 3.0 :: DropTarget Parent Child - Removechild Won't Remove A Child

Aug 21, 2010

I have an issue where removechild won't infact remove a child. I think its something to do with my dropTarget.parent issues. The concept of the code is that you drag a source onto a destination. When you drop the source onto the destination you will get a text field that says "Hello" or "Goodbye". The objective i want to achive is that once i drop a source onto the destination, removechild will remove any previouse textfields added. This is proving difficult.

[Code].....

View 3 Replies

Actionscript 3 :: Flash - Child Within Parent Within Parent?

Aug 24, 2010

I am trying to make a calculator where a user can select from a list of items. If a user clicks say "ITEM1", it should add the item to a "CONTAINER_MC". The problem i have is all my data is set inside an array containing names and prices like the code below.

[Code]...

View 1 Replies

Flash - Drag Child Mc Out Of Parent Mc And Add To New Parent Mc?

Oct 6, 2010

Here is a working script to drag drop a ball from the stage into another target mc:

ball.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void{ [code]...

It works well but I'm new to AS3 and I am having difficulty amending this script to drag the ball out of a parent mc (instead of the stage) and onto another mc (the target mc). To explain: imagine a ball, a box, a tri, + more shapes all within a scrolling mc (initial parent), the user scrolls to select a shape, then drag-drops onto a target mc on the stage.The scrolling is no problem, but how would you amend the script above so that the ball can start inside a parent mc rather than on the stage itself?

View 2 Replies

ActionScript 3.0 :: Parent SWF To A Child SWF?

Feb 4, 2011

Parent SWF to a Child SWF

View 6 Replies

ActionScript 2.0 :: Child Mc Looking At Parent?

Aug 16, 2011

I have 9 child mc's as buttons in the parent. How could the child discover what name the parent has given it? Can the child examine a parent variable?

View 2 Replies

ActionScript 3.0 :: Set Child Of A Parent To Null?

Jul 29, 2009

[code]...

and I dont mean this: (which removes the parent)

View 9 Replies

ActionScript 3.0 :: Allow Child To Float Outside Of Parent?

Nov 11, 2009

i have added an movieclip as a background and added another movieclip to it. Now i want it to be placed a bit outside the bg. movieClip.x = -50; movieClip.y= -40; But if i do this, then it just gets cutoff, is there a way to make overflow visible?

View 1 Replies

ActionScript 3.0 :: Moving A Child To A New Parent?

Sep 3, 2011

Some forums suggested to simple add the child to the new parent and it would automatically be removed from the old parent. However, these were Actionscript 2.0 forums and the suggestion didn't work - it removed the child but never added it back.MovieClip(root).bmc.addChildAt(currentLetter, 0);Is it possible to take a child from one parent and add it to another in AS3?

View 3 Replies

AS3 :: Child Moves Parent Using StartDrag?

Nov 8, 2009

I have a MovieClip instance which can be moved around the stage using startDrag() and stopDrag(). The instance also has some child MovieClips using addChild(). The parent moves the children when dragging, which is fine. The children have there own startDrag() and stopDrag() which should apply only to the child object, however it also moves the parent and other children. When clicking a child the MouseEvent of the child is being called but so is the parent.

public class Component extends MovieClip {
private var nodes_array:Array = new Array();
public function Component() {
x = 60;

[Code]....

View 1 Replies

Actionscript 3 :: Child Object Outside Parent?

Apr 14, 2010

Im using the following code to place an object inside a container:

testParent = new MovieClip();
testParent.graphics..beginFill(0x0000FF);
testParent.graphics.drawRect(50, 50, 300, 300);

[Code].....

this gives the testParent object a margin of 50 from top and left. The testChild object should have have the same margin relative to stage. But doesnt.. The child object is at 0,0 relative to stage. Whats causing this?...

View 3 Replies

Flex :: Get The Value From An Mxml To Another (child To Parent)?

Aug 15, 2011

how do I get a value from another mxml.I have a vaule in the child mxml that i would like to parse to the parent mxml.Then use the vaule to create a search method.

View 1 Replies

Flash :: AS2 Parent - Child Swf Communication

Feb 29, 2012

How do I do this? Inside the parent swf myVar value is set by query string value loaded in by swfobject var myVar = _level0.part; // i have the value 123 here ..all good so far

[Code]...

Always childLog.text is undefined :( - so how to access the value of myvar from the child?

View 1 Replies







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