PDA

View Full Version : Tell Target Not Working



skeerolls
January 28th, 2004, 09:44 PM
Here is what i am trying to do. i have a movie clip in frame one of my main timeline. In this movie clip i have a nav bar with buttons. With an on release, i set a variable and i play an animation in that movie clip, starting at frame 61. At the end of that animation, i jump to frame two of my main time line. In that frame i have a series of if statments that asks for the varible set with the on release, and it will load a new movie depending on what that varible is. Now, the code works, but the problem is it only works once. After you hit one button and it does all the actions, it will not go to frame 61 to play the animation in the new loaded movie. To get a visual, here is what i am working on:
http://www.insomniadesigns.com/newinsom/insom.html
when the page loads, hit the web design button and the animation works and at the end, it loads a new movie. Once the new movie is loaded, try to hit the Home button... nothing happens. I used to have a tell target script to play the animation on frame 61 and i was getting an error saying it couldn't find _root.home. i am copying and pasting my code below.
Button Action:
on (release) {
_root.Home.play(61);// this is what seems to not work
//when the new movie is loaded
_root.myvar = "1";
}

If statement Action in frame 2 of main timeline
if (_root.myvar == "1") {
_root.createEmptyMovieClip("container", 1);
loadMovie("home.swf", "container");
container._x = 0;
container._y = 0;
}
Any help is appreciated....

markhegz
January 28th, 2004, 09:51 PM
the problem is that you dodnt have a movieclip named home. it should be _root.container.gotoAndPlay(61);

but i would recommend using frame labels instead of frames

skeerolls
February 2nd, 2004, 10:10 PM
Ok, that worked, now I am having another problem. Once again, visit www.insomniadesigns.com/newinsom/insom.html to view my problem. The initial movie loads and plays. Click on Home, it will play the closing animation and then load home.swf. Once that is loaded, hit the web design button... it plays the closing animation (frame 61 in the movie clip in frame 1) and then when it gets to the last frame in that movie clip, i want it to go to the main time line and play frame 2 (i have the frame labeled "Frame2") Here is my actionscript for the last frame in the movie clip in frame 1:
_level0.gotoAndPlay("Frame2")
For some reason, you webdesign once... it plays the animation but wont go to "Frame2" so then if you click it again, all of the sudden it works. Why does it work the second time, but not the first?

markhegz
February 2nd, 2004, 10:21 PM
_root.gotoAndPlay("frame2");
loadMovie("webdesign.swf", "container");

skeerolls
February 5th, 2004, 11:03 AM
Yeah, that doesnt work either. I am getting the feeling that it has something to do with the level the movie is playing on. The new movie clip "container" loads on level 1, would that have something to do with it? PLEASE HELP ME! Thanks guys!