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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you load a movie on a level and send it to a instance? 1

Status
Not open for further replies.

Kirderf

Technical User
Oct 4, 2000
183
US
I am creating a site map for a web site that loads separate movies onto level_1. the Site map has buttons that work with the following example code:

on (release) {
loadMovieNum ("retail.swf", 1);
}

What would I have to tell the button to do to go to an instance called "Sales" in the timeline of my retail.swf?

I'd gladly pay you on Thursday
for a hamburger today!
 
sorry...I wish to send it to a Label, not an instance...silly big mistake I'd gladly pay you on Thursday
for a hamburger today!
 
I believe this is right... I am at work and I just started hand coding a short while back.

Code:
on (release) {
    loadMovieNum ("retail.swf", 1);
    level1.gotoandPlay("sales");
}
Ya' Gotta Love It!
sleepyangelsBW.jpg
 
only change gotoandPlay to gotoAndPlay...
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Problem...Well, I tried it and it didn't work. It sends me back to the first frame each time. This seems odd.
I am using:
on (release) {
loadMovieNum ("retail.swf", 1);
level1.gotoAndPlay("Sales");
}
I wonder if it loads the movie and does not get to the second part of the command? Hmmm. I was afraid this would be larger than me. I'd gladly pay you on Thursday
for a hamburger today!
 
try gotoAndStop instead of gotoAndPlay

so you'd have

Code:
on (release) {
    loadMovieNum ("retail.swf", 1);
    level1.gotoAndStop("Sales");
}
Ya' Gotta Love It!
sleepyangelsBW.jpg
 
It did'nt work? I tried gotoAndStop. I wonder why it isn't working? What do you think is wrong?

The button is in an imported movie on level1. I attach this code to the button:
on (release) {
loadMovieNum ("retail.swf", 1);
level1.gotoAndStop("Sales");
}
The new movie replaces the page containing my button with "retail.swf" I wonder if it is not seeing the rest of the code once the movie is replaced? I will try to figure it out, but if you have any suggestions I would be grateful! I'd gladly pay you on Thursday
for a hamburger today!
 
You're absolutely right in assuming that the second part of your script is not executed, for the simple reason, that the movie hasn't yet been loaded, so the "Sales" label doesn't really exits yet either, when you issue the loadMovie command.

Not knowing how your retail.swf is built - does it have a preloader, a stop action on it's first frame, how many different scenes it holds, etc... - it's hard to suggest a solution. One could be to have your main movie playing for a few frames, so that you can set the level1.gotoAndStop("Sales");, a few frames later than the loadMovie action itself.
You could also, depending..., add a _root.gotoAndStop("Sales"); action in the first frame of the retail.swf itself.

Regards,
new.gif
 
Here is a shot at explaining it.
Forgive if it is wordy...

Retail.swf loads into level1 on top of a main navigation page.(level0)

No pre-loader, it just loads the elements within 10 frames before hitting a stop action at frame 11.

There are three labeles on the timeline with stop actions at each label position, and yes, just one scene.

recap: (10 frames which load the scene which stops at 3 buttons where you can navigate to 3 other places on the timeline.)

most people viewing the site will click on it from the main navigation button and just wade in; however, the sitemap(where I am having my trouble) should have direct links to each lable within retail.swf.

My only guess now is to create separate .swf files for each label. Instead of haveing one .swf file for this page there would be 4. Hmmmm very bulky, but it would work. There are 3 other pages that are similar to this one. That would be a lot of .swf files.

Any better ideas?
Thanks I'd gladly pay you on Thursday
for a hamburger today!
 
After typing a long and, I believe, helpful answer, Tek-Tips went down and I lost my post.
Here's a hopefully clear summary...

If I understand you correctly - I felt some impatience in your "wordy explanation", and can give up trying to help you out if you so desire! - you're looking to target some labeled frames in a movie that might not be even loaded yet, if I as a user, is not going through your navigation movie, which is in fact loading your retail.swf.

Rather than creating seperate movies (one for each link of your sitemap), you could possibly get away with only embedding your retail.swf (if it can stand on it's own, without the navigation movie on level0) and target specific labeled frames of that movie using a little java and a Flash method as TGotoFrame or TGotoLabel as documented in this Macromedia technote:

Regards,
new.gif
 
I checked out the link OldNewBie. Thanks for all your advice. I am slow at taking all the programming in, so it will take a while to understand my options. I think you helped me earlier on loading the pages for this site. The main navigation is on level0 and the other pages load in level1. here is the site:click on the sitemap link to see the buttons i've been talking about.
I'd gladly pay you on Thursday
for a hamburger today!
 
Maybe just one look Oldnewbie, I was not able to figure out what you wanted me to look at in the macromedia page., and Yep, ChrisT, I tried using_level instead of level1, but the problem is the level which I load the pages in.


thanks for any help here. I'm a little slow on this one. I'd gladly pay you on Thursday
for a hamburger today!
 
Still some confusion here...
You seem to be giving us a link to your "normal" entrance, and everything, as far as I can see, seems to be working fine.
Can you give us a link to one of these other pages you mentioned, and which is not going through your main navigation movie?

Or am I completely misunderstanding you?

Regards,
new.gif
 
Ok! Think I just figured out what you're saying!
If I'm on the Site Map, and I hit Merchandising, you want me to end up on the Merchandising screen right away rather than ending up on the Retail Sales and having to click on Merchandising again to get to it... Is that it?

Regards,
new.gif
 
You could possibly try the following:

Set a variable when a button is pressed on the Site Map.
On the Sales button, something like:

on (release) {
_level0.selection = "sales";
loadMovieNum ("retail.swf", 1);
}

On the Merchandising button...

on (release) {
_level0.selection = "merchandising";
loadMovieNum ("retail.swf", 1);
}

Etc... For each button.

Then, in your retail.swf add some conditional statements on it's first "ideally" blank frame:

if (_level0.selection == "sales"){
_root.gotoAndStop("sales");
// _root refers here to the main timeline...
// Of retail.swf...
}
if (_level0.selection == "merchandising"){
_root.gotoAndStop("merchandising");
}

Etc...

Suggest your try this out on copies of your original .flas.

Regards,
new.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top