# Loading clip and then target

**URL:** <https://forum.kirupa.com/t/loading-clip-and-then-target/8476>\
**Category:** Uncategorized\
**Created:** [November 21, 2002, 11:31pm UTC](https://forum.kirupa.com/t/loading-clip-and-then-target/8476 "2002-11-21T23:31:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pithcell](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@pithcell](https://forum.kirupa.com/u/pithcell)\
**Post date:** [November 21, 2002, 11:31pm UTC](https://forum.kirupa.com/t/loading-clip-and-then-target/8476/1 "2002-11-21T23:31:58Z")

</div>

hey all  
my problem:

1. a user clicks on a button
2. the proper movie loads as level 0 (works so far)
3. triggers a certain target and its corresponding frame label to play

I tried doing this:  
on (release) {  
loadMovieNum(“homepage.swf”, 0);  
tellTarget (“bPerspec”) {  
goToAndPlay(“fadeIn”);  
}  
}  
but it says error, can’t find target…

is there a “then” function, that is: “homepage.swf” loads then the computer locates the target “bPerspec” and plays “fadeIn”

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 22, 2002, 12:29pm UTC](https://forum.kirupa.com/t/loading-clip-and-then-target/8476/2 "2002-11-22T12:29:32Z")

</div>

Hi,

I don’t know if I got you right but it looks to me that you are trying to target a MC that doesn’t exist yet.  
If you load a movie its MCs don’t exist until loaded, so in this case your button, that loads the new movie, doesn’t know ‘bPerspec’ exists.  
Load the movie as you do and then you should use something like this **in your homepage file** :

```auto

bPerspec.onEnterFrame = function() {
	if (!goneAlready) {
		this.gotoAndPlay("fadeIn");
		goneAlready = 1;
	}
};

```

Cheers

SHO

Ps.: ‘tell target’ is not used anymore.

Instead of using

```auto

tellTarget ("bPerspec") {
goToAndPlay("fadeIn");
}

```

is the same to use

```auto

bPerspec.goToAndPlay("fadeIn");

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 22, 2002, 1:25pm UTC](https://forum.kirupa.com/t/loading-clip-and-then-target/8476/3 "2002-11-22T13:25:16Z")

</div>

Yeah, the problem here is that the code runs faster than the loading movie. You’ve told it to load up the new movie, which it starts doing, but before it’s finished loading the code has moved on to the targetting line, which doesn’t exist yet as the movie hasn’t finished loading.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 22, 2002, 11:27pm UTC](https://forum.kirupa.com/t/loading-clip-and-then-target/8476/4 "2002-11-22T23:27:49Z")

</div>

Kitiara and eki  
yo kitiara, thanks for the explanation, its gonna help out big time in the future when i’m timing stuff out  
and eki, yo thanks for the code dog, you are AWESOME, it totally works man

get after it  
P

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 23, 2002, 12:04am UTC](https://forum.kirupa.com/t/loading-clip-and-then-target/8476/5 "2002-11-23T00:04:56Z")

</div>

so i just noticed a problem!!!

the order of my pages is thus:  
i have an initial flash page, when you click on that icon you get to the homepage. BUT clicking on that icon intializes the movie clip that should not be intialized at that point because of the code i placed on that page.

This is what should happen:  
on flash page click icon  
homepage comes up with only first movie clip (lets call it background) (second movie clip not playing)  
click on first navigation bar button the second movie clip plays (lets call this movie clip bPerspec)  
lets say the user doesn’t click on the first navigation button but clicks on another navigation button  
the movie from that navigation button loads  
then the user desides to see what that first navigation bar button does and clicks on the first navigation bar button  
The homepage loads with the BACKGROUND AND THE BPERSPEC movie clips!!!

There is another button that just loads the background, without the bPerspec

how can i code it so initially background plays but bPerspec doesn’t play but when a person clicks on the first navigation bar button from a different page both the movies (background and bPerspec) play???
