Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Flash




Copy Child MovieClip To NEW Parent (for Printing)



I reused this title from another post because I have the same question and it was not ever answered in a way that is useful for me.

The problem is I am printing something that contains a MC that is being displayed. However the print formatting is quite different even though it contains an Identical copy of the object. Please also consider that I can't take a bitmap version of the object as the resolutions are quite different.

Currently, the only way I can think of solving this problem is by having the code insert an exact copy of the object into the printpage MC. Additional problems are that this will be masked as it will not fit onto the printed page other wise. Most of the time this object won't be printed. I am already doing so much with the processor that I am not getting my desired frame rate. I do not want to have to repeat every command to this second, very complex object.

So, with all that, does any one have any magic solutions? I can't believe that this is a unique printing problem, but I have not found any other posts on it.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Copy CHILD Movieclip To NEW Parent
Its really simple actually, and it seems like such a newbie question - which is also driving me a little crrrrrazy. Everytime I think I know what I am doing: *SMACK* Ah well. Thanks for any help in advance!

Here is the nut:
I have a CHILD movieclip attached to a PARENT MC, and I want to copy (or move - dont really care) the CHILD to a NEW PARENT. Everything is build in AS1.


Code:

//I make my first PARENT movie clip
_root.createEmptyMovieClip("OrgParent_mc", 1);

//I give it a CHILD
_root.OrgParent_mc.createEmptyMovieClip("ChildClip_mc", 1);

//I make a second PARENT movie clip
_root.createEmptyMovieClip("FosterParent_mc", 2);

//Now I want to make a copy. BTW This is so simple seeming its confounding!
// ?
//I tried:
_root.FosterParent_mc.attachMovie("_root.OrgParent_mc.ChildClip_mc", "BrotherClip_mc", 1);
//But of course its not a library clip, so no dice. bla.

//I tried:
_root.OrgParent_mc.ChildClip_mc.duplicateMovie("SisterClip_mc", 10);
//But that doesn't give the child a new home.

//And the Moock manual says using duplicateMovieClip() as a global function also sticks the copied MC in the same PARENT stack. SO Annoying! Why can't I choose a new stack?


So I really hope someone can help solve this little puzzle. I've tried searching through the threads, but the detail nuance seems to make searching very difficult.

P.S. the solution to this would be even more exciting when I can store the Child Clip target in a variable and pass it to the copying mechanism, rather than copying it directly. But this isn't really a problem if I can copy the MC.

There must be a way to do this, otherwise components wouldn't be possible.

Thanks Alot!
-AtomicBirdsong

Copy Child MovieClip To NEW Parent
Here is the nut:

Its really simple actually. I have a CHILD movieclip attached to a PARENT MC, and I want to copy (or move - dont really care) the CHILD to a NEW PARENT. Everything is build in AS1.


Code:
//I make my first PARENT movie clip
_root.createEmptyMovieClip("OrgParent_mc", 1);

//I give it a CHILD
_root.OrgParent_mc.createEmptyMovieClip("ChildClip_mc", 1);

//I make a second PARENT movie clip
_root.createEmptyMovieClip("FosterParent_mc", 2);

//Now I want to make a copy. BTW This is so simple seeming its confounding!
// ?
//I tried:
_root.FosterParent_mc.attachMovie("_root.OrgParent_mc.ChildClip_mc", "BrotherClip_mc", 1);
//But of course its not a library clip, so no dice.

//I tried:
_root.OrgParent_mc.ChildClip_mc.duplicateMovie("SisterClip_mc", 10);
//But that doesn't give the child a new home.

//And the Moock manual says using duplicateMovieClip() as a global function also sticks the copied MC in the same PARENT stack. SO Annoying! Why can't I choose a new stack?
So I really hope someone can help solve this little puzzle. I've tried searching through the threads, but the detail nuance seems to make searching very difficult.

P.S. the solution to this would be even more exciting when I can store the Child Clip target in a variable and pass it to the copying mechanism, rather than copying it directly. But this isn't really a problem if I can copy the MC.

There must be a way to do this, otherwise components wouldn't be possible.

Thanks Alot!
-AtomicBirdsong

How To Copy A Movieclip To Another Parent
the MovieClip.duplicateMovieClip method can only duplicate a movieclip in the same parent, right?

now i want to copy a movieclip to anther parent. how i do it now is: copy the bitmap to anther movieclip using attachBitmap() method. but the problem is: hit Area changes, not like the original graphic Area, the second movieclip's hitArea is the rectangle of the bitmap, thoght the bitmap i created is transparent.

what should i do, if i want keep the same hit Area as original graphic Area?

Child Movieclip Staying Within Boundries Of Parent Movieclip
I am trying to create a child movieclip that should only be displayed within the boundaries of the parent movieclip.

Lets say I have a stage of 800x600 pixels. The parent movieclip is 600x400 pixels. When I create a child-movieclip and place it at _x = 650, the movieclip "disapears" as it is outside the boundaries of the parent movieclip.

I'm pretty sure I am doing something wrong in the creation of the child movieclip, but can anyone help me PLEASE!?!

- mortenft

Parent/Child Movieclip Problem
I have my parent MC instance name “legend”- within the MC I have a button “info_btn”

I want the MC “legend” to start with alpha value 10. Then when you rollover the MC legend it fades into 100. Then when I rollover the MC info_btn it makes over_mc appear.

I am a newbie, why doesn't his code work?:


Code:
#include "lmc_tween.as"

legend._alpha = 10;
legend.useHandCursor = false
legend.over_mc._visible = false;


legend.info_btn.onRollOverHandler = function(){
legend.over_mc._visible = true;
}

legend.info_btn.onRollOutHandler = function (){
legend.over_mc._visible = false;

}
// delegate to all children
legend.onRollOver = function(){
onRollOverHandler();
legend.alphaTo(100,1.5);

}

legend.onRollOut = function(){
onRollOutHandler();
legend.alphaTo(10,1.5);

}

MovieClip Parent/child Issue(s)
According to Flash CS3 Help:

parentproperty
parentisplayObjectContainer [read-only]
Language version: ActionScript 3.0
Player version: Flash Player 9
Indicates the DisplayObjectContainer object that contains this display object. Use the parent property to specify a relative path to display objects that are above the current display object in the display list hierarchy.
You can use parent to move up multiple levels in the display list as in the following:
this.parent.parent.alpha = 20;



Okay, I have a movieclip on my stage. Let's call it parentContainer_mc.
Now, let's say I open up this parentContainer_mc (by double clicking on it) and add a movieclip within parentContainer_mc.
Let's call this one childObject_mc.

What I want to do is change the alpha value of childObject_mc thru action script on the MAIN timeline.

If I put:

ActionScript Code:
childObject_mc.alpha = .5;

I get an error basically saying, "what the hell is childObject_mc?"

Okay, I know I need to use the parent/child relationship thingy.

Well, according to Flash CS3's help, I've tried:

ActionScript Code:
childObject_mc.parent.parent.alpha = .5;  // Doesn't work
parentContainer_mc.parent.childObject_mc.alpha = .5;  // Doesn't work
parentContainer_mc.childObject_mc.alpha = .5;  // Doesn't work

// etc.. etc..


What's the correct code I need to use?

Empty Parent Movieclip From Child Swf
I am very new at this stuff.

My parent swf has a movie clip with a png file in it. (E.G. myMCL.loadClip("master2.png", "empty1"); )

When I play another swf overtop, the png shows underneath as my new movie clip loads. Can I "unloadclip" in the master (parent) from my other child swfs before loading a new movie clip so that you will not see the png file? I have tried unsuccesssfully thus far.

Thank you in advance.

Parent/Child Movieclip Problem
I have my parent MC instance name “legend”- within the MC I have a button “info_btn”

I want the MC “legend” to start with alpha value 10. Then when you rollover the MC legend it fades into 100. Then when I rollover the MC info_btn it makes over_mc appear.

I am a newbie, why doesn't his code work?:


Code:
#include "lmc_tween.as"

legend._alpha = 10;
legend.useHandCursor = false
legend.over_mc._visible = false;


legend.info_btn.onRollOverHandler = function(){
legend.over_mc._visible = true;
}

legend.info_btn.onRollOutHandler = function (){
legend.over_mc._visible = false;

}
// delegate to all children
legend.onRollOver = function(){
onRollOverHandler();
legend.alphaTo(100,1.5);

}

legend.onRollOut = function(){
onRollOutHandler();
legend.alphaTo(10,1.5);

}

Child Movieclip's Actionscript Run AFTER Parent's. I Cannot Use Its Variables Atstart
I have a movieclip that on its timeline initializes some properties about it, and the parent movieclip accesses these at startup in order to load it.

However, the loading script in the parent movieclip occurs before the actionscript in the child runs and thus you cannot even access anything in it until after the child runs (which occurs after the parent's loading script).

It's a clash of times

Variables Of A Child Not Visible To A Function In The Child Called From Its Parent ?
sorry, this is a repeat thread, but couldn't change the title on the old one, someone must know the solution to this problem, I just dont think i worded it correctly enough for someone who knew what i was talking about to notice last time.

Ive got a movieclip that creates and adds a child mc then calls a function in the new mc. the function runs, but the local vars for the new mc aren't visible to the function. Is there a special way to call a function so that its scope is in the child, not in the parent ? ( i assume thats where it is, even though a trace of this returns the correct object type )

ie:

[Parent Clip]
--[child clip: movGraph]
--variable ( var thegraph:MovieClip = this; )
--[function loadMe]
--(trace (theGraph); )

calling movGraph.loadMe spits out undefined or null object error, as opposed to
[object movGraph]

obviously i want to do a whole lot more than trace out the object type, and trace(this) in the function returns [object movGraph]. the variable "theGraph" declared in the child isn't available or its null somehow.

Can anyone tell me where I'm going wrong ? - any help would be appreciated. at the moment I'm having to add all the code in the function instead of the "root" of the child. which really defeats the point.

Child Swf Load New Child Swf Inot Parent Swf
ok you're all going to think i'm super dense

but i'm also super stressed and fast approaching a deadline

can someone please tell me the simplest way to load a child swf into a parent swf from another child swf

eg. what code do i apply to the button?

i am loading into a container.mc (blank) in the parent swf

Child Swf Load New Child Swf Inot Parent Swf
ok you're all going to think i'm super dense

but i'm also super stressed and fast approaching a deadline

can someone please tell me the simplest way to load a child swf into a parent swf from another child swf

eg. what code do i apply to the button?

i am loading into a container.mc (blank) in the parent swf

Dynamically REMOVING Children From Parent Containers? MovieClip(this.parent.parent...
EDIT: actually, this isn't really dynamic... it should be really simple!

I can get a nested swf to add a movie to the root timeline, but in order to replace it with a new movie, AS3 first requires that I clear the old one. I can't figure it out!

This does not work, though it is the exact same format I use to add a movie to the root successfully:

Code:
MovieClip(this.parent.parent.parent).removeChild(MovieClip(this.parent.parent.parent).loadMovie)
Any idea why this doesn't work?

Parent And Child Swf
Hi,
Can anyone help please, I basically just want to call my main (parent) swf from the current clip (child) am in.
I just don't know how to write it, having a blank right now, it must be in the code line below, where i need to somehow add the name of the swf to the name of the button:
_root.but._visible = true;

Here is it in a bit more detail if needed:
I have 2 swfs, one is the main one that has buttons in it, when this button is clicked it loads a new semi transparent swf on top of it into an empty clip in my parent swf. When doing that I make the button in the parent swf invisible.
I have one close button which sits in the semi transparent swf on top, when this button is pressed it unloads itself and reveals the parent swf underneath again.
Now I want to add a line into my function that makes the button I previously made invisible, visible again so I can use it again, preferably when pressing the unload button of my semi transparent swf on top.

This is the parent swf clip function:
but.onRelease = function() {
trace(this._name+"._visible = false");
this._visible = false;
empty.loadMovie("top.swf");
};


This is top swf clip:
close_btn.onRelease = function() {
unloadMovie("");
trace(this._name+"._visible = true");
_root.but._visible = true;
};

XML From Child From One Parent
Sorry for the simple question, I'm still learning as3. Let's say I had an XML document and I just wanted to retrieve info from all the children of only one parent how would I do it. Using my XML example, I would like to retrieve all the images for the first person only, but I will want to use a button to switch to the next.

It seems like "var myXmlList:XMLList = myXMLData.person.image;" would do it but, it lists all "image" nodes

<root>

<person>
<image></image>
<image></image>
<image></image>
<person>

<person>
<image></image>
<image></image>
<image></image>
<person>

</root>

URGENT - Parent & Child MCs
Hi All..

Plz help me..i am in very urgent need...My problem is..I got a MC say 'Parent_MC' , which internally has got another Mc called 'Child_MC'. Now the problem is i am dynamically resizing the 'Parent_MC' Movie Clip...accrdinlgy the 'Child_MC' is also changing its Dimenstions...i want to keep the oroginal dimanstions as they are for 'Child_MC' movie clip...how can i do that...any suggestions plz gimme immediately..

Thanks to all in adv,

Using Child To Control Parent, Help
Hello,

I have a menu which resides in the library and is achild which controls the parent. When the buttons are released I'm using this action to navigate from scene to scene

on (release) {
with (_level0.gotoAndPlay(49)) {
}
}

In this instance there is a blank keyframe on frame 49 which has a gotoAndPlay action to another scene. I know this is jury rigged I get a

"Error: A 'with' action failed because the specified object did not exist."

In the output window. But it has been working fine, that is until I added a scene to begining of the movie. Now it just jumps around the scene it's in. Does anyone know the correct script for a child symbol that controls the parent scene?

Cheers

Targeting Parent Swf From Child Swf.
If I want to tell the parent swf to gotoAndPlay at a certain spot from a rollover on the child swf,
what action would I use?

Could I use:

on (rollOver) {
_level0.gotoAndPlay("myFrame");
}

How would I specify my scene?

Loader In Parent Or Child
Hello everyone,
I have a question and i need your help.
I made a movie with buttons that calls other movies with the LoadMovie
action. The question is were i should put the preloaders for those movies???

Child, Parent Transfer
hi Guys
Is there a way to transfer somehow a child movieClip to another parent. if i have for example a MC called "parent" and "parent" has an mc "child".(_root.parent.child)
Can i transfer the "child" MC to "parent2".
(_root.parent2.child)??
is this possible somehow? maybe via duplicating and deleting? plz help
thx

Moving Parent - Still Child
I am a long way into a long movie and need to start moving my parent clip, while keeping some children clips stationary.

I can see I need to subtract parental movements frome childish positions, but I am a bit unclear on where to put the code.
Has anyone tried this or know a of a good tutorial.

I have attached a super simple .fla of a moving parent and child. I just want to keep the child still on screen.

Thanks, Tim.

Child Parent Relationships
I've got a popup window with a flash movie in it which I want to be able to control the main window from (a bit like a remote control).

I was under the impression that the popup window was known as a 'child' page and the page it came from was its 'parent'

If this is or isn't the case, how does this work? I'm using:

on (release) {
getURL("contact.htm", "_parent");
}

which I thought might do it........

Any ideas?

Load Child.swf Into Parent.swf
can someone please get me started, i've gone through all the tut's provided on this site, step by step and the end result never works for me

I simply need to load child.swf into parent.swf

Preloading Child From Parent
okay here is my set up
I have a parent .swf called "demo.swf"
and a child caled jukebox.swf

within "jukebox" I have 4 movie clips
each with it's own instance name
In each movie the first frame is empty with the stop(); action
then in frame two a song starts to stream

within the demo.swf I have 4 buttons
each with this script (instance names change of course)


Code:
on (release) {
stopAllSounds();
_root.jukebox.song1.gotoAndPlay(2);
}
now my issue..
Is it possible for me to preload the jukebox.swf, with a progress bar sitting in the demo.swf?

Cause as it stands when you first open the site, and go to the audio section, only one of the four songs will play.. (ie: not done loading yet)
if you refresh the page they then all play

Load A JPG From Child.SWF And See It In Parent.SWF
Hi everyone..

I'm trying to load a image.JPG into a child.SWF. The parent.SWF contents child.SWF and when I load the child.SWF from parent.SWF everything is perfect, but image.JPG loaded from child.SWF doesn't show up in parent.SWF.

Code for loading image.JPG (in child.SWF):

code:
_root.createEmptyMovieClip("image",301);
image._x = 180;
image._y = 130;
image.loadMovie("image.jpg");

--------------------------------------------
Code for loading child.SWF (in parent.SWF):

code:
_root.createEmptyMovieClip("child_mc",200);
child_mc._x=0;
child_mc._y=0;
child_mc.loadMovie("child.swf");


thank you in advance

Loading A SWF Into Parent SWF From Child SWF
Hi folks!
I have a silly problem I can't figure out.
I want to load a SW from a 'deeper' SWF into a 'upper' SWF.

The details:
I have a 'top SWF'. At this top SWF, there is a empty container named pixcontainer. Into this top SWF there is loading a 'main SWF'. Into that main SWF there will be loading a 'detail SWF' (all loading SWF are loaded with loadMovie() ).
Now, I need to know the correct path so I can trigger a loadMovie from the detail SWF into the empty container of the top SWF.
I tried _root.pixcontainer, _parent.pixcontainer, _root._parent.pixcontainer, nothing worked.
But there has to be a way to fill this empty container in the top SWF.

Any hints and tips for a AS noob?

Communicating Between Parent & Child Swf's
Hi everybody!

I'm using loadMovieNum to load external swf's into my MAIN.swf for the content on my site.

The movies are being loaded on to levels not targets.

So I have loaded SECTION2.swf into MAIN.swf

The problem I have now is that I need SECTION2.swf to send a command to MAIN.swf.

It is only a simple command that I need to send from SECTION2.swf to MAIN.swf:


code: _root.gotoAndPlay("start");

I have also tried:

code: _level0.gotoAndPlay("start");


Is it possible to send actionscript commands between swf's?

And if so, does anybody know how to achieve it?

All help is very much appreciated!

D.

Parent And Child Swf Troubles..
Hi,

flash 7 actionscript 2.

I have a child swf file that gets loaded into a parent swf file. The child swf file then creates a blank movieClip called target in the parent swf file then the child swf loads a swf file into the target movieClip in the parent. The parent can control the child movieClip perfectly fine locally but when it's uploaded to a server it does not work. If i put a text field on the stage and display target.. it shows up as undefined but when i run it locally I get level0.target.


myBook.onClick = function(i, page, isCorner) {
hideHint();
if(isCorner) {
target._visible = false;
target.stop_start.gotoAndStop(1);
target.voiceover.stop();
clearInterval(target.movie_interval);
}
};

the above code works fine locally how do i go about telling my parent swf that the target movieClip is ready for use?

also can you preload a movieclip that already has a preloader on it?

thanks a bunch.

Child Knowing What It's Parent Is
I've been learning some AS3, reading the tutorials but there is something i don't quite understand about DisplayObject


PHP Code:



package {
    import flash.display.*;
    public class MainClass extends MovieClip {
        public function MainClass() {
            var myMovieClip:ExampleClass = new ExampleClass();
            this.addChild(myMovieClip);
            trace(myMovieClip.parent); //outputs: [object MainClass]
            
        }
    }
}





PHP Code:



package {
    import flash.display.*;
    public class ExampleClass extends MovieClip {
        public function ExampleClass() {
            trace(this.parent); //outputs: null - why does this not return MainClass?
            
        }
    }
}




Why can't the child seem to be able to find what it's parent is? Is this possible to do?

Child Parent Interaction
how to make a child recognize its parent

for example:

if i have a parent mc
and I want it to duplicate a child
so that the new child is on top of the parent

how can i do this in a way so that
the code to position the child is in child's class
and for it to be relative instead of absolute

in other words
how to make a child recognize its parent

thnx in advance

[MX]Child And Parent Objects?
Can you Child and Parent objects as in, say, After Effects? Like when you move one object the other object stays in the same position realitive to the first. It moves when the other moves?

Parent Not Consistently Available To Child Swf
OK, I thought I understood that you could access properties and methods of the parent of a loaded SWF by casting appropriately so that the compiler didn't mind, BUT:

I have an SWF that I'm loading into a movieclip container that is on the main timeline of another SWF. It contains this code:


PHP Code:




function fadeInContent()    {    MovieClip(parent.parent).fade(bioBlock_mc, 1, .7);    MovieClip(parent.parent).fade(picBlock_mc, 1, .7);    MovieClip(parent.parent).fade(menu_mc, 1, .7);    }







I call this function from the main SWF by this call:


PHP Code:




contentRef.fadeInContent();







and it works just fine. The function fires and it calls and runs the fade() method back on the main timeline.

But further down from fadeInContent(), I've defined another two methods:


PHP Code:




function imagesLoaded(e:Event)    {    loadCount++;    trace("image complete, loadCount is "+loadCount+"e.target is "+e.target.loader);    switch (e.target.loader)        {        case this.imageLoader0:            image1 = new BitmapData(232,232);            image1.draw(this.imageLoader0.content);            image1bm = new Bitmap(image1);            image1bm.alpha = 0;            image1bm.name = "image1bm";            picBlock_mc.addChild(image1bm);            break;        case this.imageLoader1:            image2 = new BitmapData(232,232);            image2.draw(this.imageLoader1.content);            image2bm = new Bitmap(image2);            image2bm.alpha = 0;            image2bm.name = "image2bm";            picBlock_mc.addChild(image2bm);                        break;                case this.imageLoader2:                    image3 = new BitmapData(232,232);            image3.draw(this.imageLoader2.content);            image3bm = new Bitmap(image3);            image3bm.alpha = 0;            image3bm.name = "image3bm";            picBlock_mc.addChild(image3bm);                break;                }            //imagesComplete = true;    if (loadCount == 3)            {        _complete = true;        loadPage(1);        }    }    function loadPage(pageNum:Number)    {    for (var i:Number = 1; i < 4; i++)        {        if (pageNum == i)            {            trace("MovieClip(this.parent.parent) is "+MovieClip(parent.parent));            //MovieClip(parent.parent).fade(this["image"+i+"bm"], 1, 1);            MovieClip(parent.parent).fade(bioBlock_mc, 0, .5);            }        else            {            trace("MovieClip(this.parent.parent) is "+MovieClip(parent.parent));            //MovieClip(parent.parent).fade(this["image"+i+"bm"], 0, 1);            }        }    }







But when the loaded SWF runs the imagesLoaded event handler the third time and it calls loadPage(), the call to fade() back on the main SWF's timeline does not work. MovieClip(parent.parent) traces null, when it just was used to call fade earlier when the SWF was loaded...????

Can anyone tell me why this would be?

Many thanks.

Child (swf) Getting Variables From Parent (swf)
Hello there ^^

Is it impossible to get a child movie loaded in an external swf to tell the parent swf to do something like gotoAndPlay(2) ?

here's my code:


ActionScript Code:
var variable1:String = "yeah it worked !";
var base:MovieClip = this;
import flash.events.Event;

//request
var request:URLRequest = new URLRequest("clip.swf");
var clip:Loader = new Loader();

function loading_complete(e:Event) {
    var external_swf:MovieClip = MovieClip(clip.content);
    stage.addChild(external_swf);
    swf_externe.gotoAndStop(2); // this works good
}//fin fonction


clip.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, loading_complete);


clip.load(request);

and now, in my file named clip.swf I have a code that says to the swf that called him in the first place to do something really simple:


ActionScript Code:
var variable2:String;

And I do not know how to tell my variable2 to take the value of the variable 1 taken from the parent file of the child clip.swf. Or just something simple like gotoAndPlay(5) from the clip.swf file to tell my first swf to go to image 5 and play... I looked through the net and I didn't find anything about that... please, if someone knows how to do that, that would help me big time

Child Swf Talking To Parent SWF
Hi, I have a SWF file that I call the a parent, it imports a number of SWF(children) which I can switch through. Now my question is, is it possible to have a function in the parent SWF that the child SWF can launch?

The reason I need this is because each child SWF is a sort of small game, so when each game is finished I need some kind of way to let the parent SWF know that the player can continue.

Am I making any sense?

Placing Child Behind Parent
I am making a planetary/solar system with sun as the parent and the planets as the children.
Now, I want the child to go behind the parent during some part of revolution and come in the front during some other part so as to give a 3d effect.

But it seems that the children are, by default, positioned in front of parent. I want to ask whether there's a way in actionscript 3.0 to make the child go behind the parent.

Child Communicating With Parent
Hello, I'm relatively new to as3. I'm having problems getting a swf file that's being loaded into an mc to talk to the swf that loaded it. The loader is named site. When you hit "nurseing services training", I want it to run the ParentFunction() in the loader. I've looked on here and other sites and done what they say to do but to no avail. When I compile the nurseing services training, it gives an error about the parent.parent. Should I be compiling it differently since there's no parent to the nursing main timeline?

Any help would be appreciated!
nursing services training.zip

Child Swf In Parent Swf Problems
Hi, I'm trying to create a parent swf file that grabs multiple child swf files. I've managed to do this, but I have a big problem. I want the parent swf file to act like an application skin (Television-TV.swf), and I want the child swf files to load under the skin (TV movie-Movie.swf).

I can't get this to work correctly. When I test my presentation, my TV movie loads over the TV skin instead of under it.

Here's a little info about my setup in my parent swf file (TV.swf):
Layer 1: TV Skin
Layer 2: TV Movie

Action script attached to the TV Movie frame in the timeline:
loadMovieNum("Movie.swf", 1);

So how in the world do I get my child swf files to load under the skin in my parent swf file? How do I change the location where the child swf files appear? (right now they load in the upper left hand corner of the presentation)

Thanks

Communicating Between Parent & Child Swf's
Hi everybody!

I'm using loadMovieNum to load external swf's into my MAIN.swf for the content on my site.The movies are being loaded on to levels not targets.

So I have loaded SECTION2.swf into MAIN.swf

The problem I have now is that I need SECTION2.swf to send a command to MAIN.swf.

It is only a simple command that I need to send from SECTION2.swf to MAIN.swf:


ActionScript Code:
root.gotoAndPlay("start");

Is it possible to send actionscript commands between swf's?

And if so, does anybody know how to achieve it?

All help is very much appreciated

D.

Getting A Child To Disobey Its Parent
I am having a problem with getting a flv that is loaded into a swf by the flv component to stay at its original dimensions regardless of what resizing is done to the parent swf. The problem occurs because it is in a flash flip book and the swf's are called in as pages, however, depending on the size of the book, the swf pages are scaled to fit. When the flv tries to match the same size, (either upscaled or downscaled) it becomes very pixelated? I've messed with the scale properties with the flv but it still obeys the parent swf?

This is a time sensitive matter and I am even willing to pay for a solution!!! (Of course, I would also accept a "You're an idiot" comment followed by a free solution!) :) Please help.

- BB

Best Way To Communicate Parent - Child
I've got an CS3 Flash swf (parent - AS3) that has 2 sound objects. When the parent loads an external swf file (the child - AS3), what is the best method for the child to obtain properties of the sound objects contained in the parent?
ApplicationDomain seems like overkill... in this case anyway

thanks
Dan
Salem, Oregon

Parent/Child Communication In CS3
Hello -

I have a movie setup that imports another external swf file. I am trying to get the two movieclips to communicate with eachother. I am able to call a function in the child movie from the parent movie, but I cannot get the child movie to call a function in the parent movie.

parent.functionName(); results with an error #1061 call to a possibly undefined method.

I'm really banging my head on my desk with this one, it seems that this should be very simple (it was in AS2 anyway) but I just cannot get it to work. Any help would be greatly appreciated.

thanks
~Dave

Components, Parent And Child
Hi Everyone

I've created a component within a component, however when I'm trying to change the property of the child component I can't. I can only change the parent component.

compOne.compTwo.move(x,y); // Does nothing.
compOne.move(x,y); // Moves the parent component, to x and y.

Have I got the syntax wrong?

Parent / Child Problem Maybe? Not Sure... HELP
Hi, I'm new to this board but I've looked around trying to find the answer to my problem and it sounds like I might actually find the answer. So here's the problem: I have a parent swf that loads 5 child swfs. Everything loads fine but after the xml loads the data there is no functionality on the child swfs other than the listen command to use the left and right keys to switch between images. The scrolling and buttons on the child swf become deactivated.

I've traced the problem to the activateButtons() function. I've tried modifying it with no luck. If I comment out the function then the child swf works and the parent swf doesn't.

I got the code for the parent swf online and I can't even remember where, but here it is (modified):


Code:
makeButtons();
import mx.transitions.Tween;
import mx.transitions.easing.*;
Object.Main = this;
var distanceMove = 545;
onLoad.moveButtons(0);
function galleryChoice(q) {
tArray = new Array();
my_xml = new XML();
for (var j = 0; j<curLength; j++) {
this.th_nav["thmb"+j].removeMovieClip();
}
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
gallery = this.firstChild.childNodes[q];
curLength = gallery.childNodes.length;
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes[i].attributes.movie);
}
}
delay = setInterval(makeButtons, 10);
};
my_xml.load("samples.xml");
}
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = container.thumb.duplicateMovieClip("thmb"+i, 1000+i);
//
//trace(pArray[i]);
thb._x = 165+(i*48);
//container.thmb5.menuTitle
//trace(thb.menuTitle.text = pArray[i]);
thb.txt.text = pArray[i];
}
loadButtons();
}
function loadButtons() {
var tbox = container["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (bt == bl && bt>4) {
nextButton();
delete this.onEnterFrame;
} else {
activateButtons();
}
};
}
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
} else {
activateButtons();
}
}
function activateButtons() {
for (var i = 0; i<tArray.length; i++) {
var but = container["thmb"+i];
but.id = i;
//trace(but.id);
but.onRelease = function() {
moveButtons(this.id);
lastPos=this.id;
};
but.onRollOut = function() {
//moveButtons2(this.id);

};
}
}
function moveButtons(pos) {

//trace(lastPos);
for (var j = 0; j<tArray.length; j++) {
startX = 165+(j*48);

if (j<=pos) {
var myTween:Tween = new Tween(container["thmb"+j], "_x", mx.transitions.easing.Strong.easeOut, container["thmb"+j]._x, startX, 3, true);
} else {
var myTween:Tween = new Tween(container["thmb"+j], "_x", mx.transitions.easing.Strong.easeOut, container["thmb"+j]._x, startX+distanceMove, 3, true);
}
}
}
function moveButtons2() {
for (var j = 0; j<tArray.length; j++) {
startX = 165+(j*65);
var myTween:Tween = new Tween(container["thmb"+j], "_x", mx.transitions.easing.Strong.easeOut, container["thmb"+j]._x, startX, 1, true);
}
}
galleryChoice(0);
Here is the child swf code:


Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("web.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 7;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 7;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
I really appreciate any help I can get, and this is really urgent. THANKS!

-JoshDV

Child Targeting Parent - AS3
Would someone please help me to correctly get a LOADED SWF to target a LOADER SWF?

I have a button in the LOADED SWF that "addChild" to the LOADER SWF.

I have the following action in the LOADED SWF:

stage.root.parent.addChild(button_btn);

It doesn't work and the error message is: "Access of undefined property button_btn"


Any help would be deeply appreciated!!

Child Parent AHHHHHH
Hey there guys,
addChild is handy in a lot of ways but has (for me) made some of the simple things harder.
My problem is loading a movieclip in a container and then replacing it with another.
in as2 you would just attachMovieClip on the container and it replaces the last clip.
If i do it in as3 it just adds it to the stack is there an easy way round this anyone that i am missing? so i can easily load a clip and remove whatever is in the container.


Cheers for your help...:-)

Parent SWF - Child SWFs
i followed the Kirupa tutorial (Creating a Full Flash Site - http://www.kirupa.com/developer/mx/full_site.htm) and i get everything so far.

now, i have a main SWF that has a placeholder for all subsequent child SWFs, but unlike the tutorial stated, each child SWF has its own navigation that needs to load a new SWF into the placeholder on the parent.

so to clarify, the main page just has a placeholder for new SWFs. then when the first child SWF loads, it gives the user two options (English or French). if the user selects English, it should load the English child SWF into the parent placeholder.

how is this done?
in the tutorial, kirupa has embedded the navigation into the main parent and so loading new SWFs into the placeholder is no issue.

please help...thank you.

Child SWF Talking To Parent SWF
Hi, I have a SWF file that I call the a parent, it imports a number of SWF(children) which I can switch through. Now my question is, is it possible to have a function in the parent SWF that the child SWF can launch?

The reason I need this is because each child SWF is a sort of small game, so when each game is finished I need some kind of way to let the parent SWF know that the player can continue.

Can anyone help me with this?

Using Path Of Child Swf Instead Of Parent Swf
I am loading a swf (child) into another swf (parent). They are located in different folders.

The child swf loads an image and displays it on the stage. The URL of the image is specified as a relative path. I am realizing that the relative path is taken with respect to the main container (parent swf). Is there anyway to resolve this (something similar to lockroot for example) ?

Thanks. Hopefully a simple question.

Parent/child Communication
I've replicated my problem in the attached files.

Index.fla executes a loadMovieNum, loading the movie bbb.fla. bbb.fla tries to change the alpha of an object in the parent movie, Index.fla, but it does not work.

so say i have a button in bbb.fla, which goes:

on(release){
_root.box._alpha = 10;
}

but this does not change the alpha of instance box in the file index.fla. i've tried to change _root to _parent, and even tried a _root.MovieClipInstance.box... etc.

Please help

Copyright © 2005-08 www.BigResource.com, All rights reserved