Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem targeting movie clip

Status
Not open for further replies.

cpettit

Programmer
Jul 30, 2002
4
US
I created a movie in FlashMX using a 'toolbar' movieclip to target a 'slideshow' movieclip. The 'toolbar' movieclip holds the navigation buttons to either play the slideshow from beginning to end, or view each individual photo one-by-one at the user's own pace. Everything was working until I added a 'preloader' scene.

Now, the preloader scene works, and jumps me to the scene with the orginal working movieclips, but now none of the buttons work. Do I need to reference which Scene I'm in to target the movieclip 'slideshow' from the movieclip 'toolbar'? If so, what's the proper syntax?

Here's my code for various parts of the movie:

Scenes Used:
'preloader' -- contains script below
'elements' -- holds frames containing large media elements to be loaded before starting main interactive content
'main' -- the actual interactive content of the movie


Preloader scritp is as follows (and is working):

total = 6;
loaded = getProperty(this, _framesloaded);
a = total/loaded;
percent_loaded = 100/a;
if (percent_loaded>=100) {
gotoAndPlay("main", 1);
}
endif;


Button action script (within Scene titled 'main' -- was working until added the 'preloader' and 'elements' Scenes):

on (release) {
_root.slideshow.gotoAndStop(39);
}

Please let me know if you have any suggestions/fixes.

Thanks!
 
If I understand this correctly (would be better to see the .fla!)... I believe your goto is working but not leading you to the right frame. Is that it?
Are you targeting frame 39 of the main movie (_root) or frame 39 within what seems to be a mc, slideshow?

One other thing you can try, is to add a trace action - trace(this); - on the first frame of your slideshow mc. This will output in the Output window, the correct path you should be using in your button script. If it's not the same as you're now using, than correct it to match the actual path. Regards,

new.gif
 
I did what you said, and trace(this) appears as an endless loop.

In the 'preloader' Scene, there are 2 frames. Frame one has the script above. Frame 2 loops back to frame 1 (if the variable 'percent_loaded' is not >= to 100, the loop will continue until the condition is met). When the condition is met, it jumps to the Scene 'main', Frame 1. At that point it should just wait for the user to click a button. The buttons are in the movieclip 'toolbar' trying to target specifice frames within another movieclip 'slideshow' -- both movieclips are placed on the stage in Frame 1 of Scene 'main'. However, the buttons don't do anything.

From doing the trace(this) as you suggested, the output window continues to output this..this..this...etc without stopping. So, I'm thinking that the preloader loop isn't stopping -- it's continuing to loop and continuing to hit Scene 'main', Frame 1. But, because it's fully loaded, it isn't showing me the preloader again, it just keeps showing Scene 'main', Frame 1. Does that make sense?

From my code above, do you see where I've missed something telling the loop to stop? I thought that once it jumped to the Scene 'main', it would stop. (This is my first time useing FlashMX, so I'm still learning my way around).

Thanks so much!
 
Well if you don't have a stop action on that frame of your main movie, obviously it will keep looping back through the preloader. Do you have a stop action?
If you don't want to post a link to your .fla here, can you at least e-mail the link to me at oldnewbie@hotmail.com? Regards,

new.gif
 
Thanks! I had a stop action in the movieclips within the first frame of the scene, but not on the actual frame. Now my buttons magically work! I guess the continuous loop wouldn't let the buttons initialize.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top