Loading clip and then target

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”

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:


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

Cheers

SHO

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

Instead of using


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

is the same to use


bPerspec.goToAndPlay("fadeIn");

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.

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

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