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

targeting a nested swf from a button

Status
Not open for further replies.

2cxc

Programmer
Joined
Aug 29, 2003
Messages
245
Location
CA
I'm in a bit of a squeeze, but before i state my problem, this is the foundation to the problem:
I have a page.swf that has a button with simple action:
on (press) {
getURL("stores.html","_self");
}
Now the stores.swf calls other swfs into the html, to comprise the end result, like so:
loadMovieNum("bkgrnd.swf", 0);
loadMovieNum("menu.swf", 1);
loadMovieNum("stores1.swf", 2);

stores1.swf has 7 scenes, and the last frame of scene has the action:
if (aa==2) {
gotoAndStop("Scene 2", 1);
} else if (aa==3) {
gotoAndStop("Scene 3", 1);
} else if (aa==4) {
gotoAndStop("Scene 4", 1);
} else if (aa==5) {
gotoAndStop("Scene 5", 1);
} else if (aa==6) {
gotoAndStop("Scene 6", 1);
} else if (aa==7) {
gotoAndStop("Scene 7", 1);
}
I was wonder if through some crazy string value or some other way I can target a scene in store1.swf to play by sending the aa value of the scene i want to play, and doing this from the button in page.swf that currently has this action:
on (press) {
getURL("stores.html","_self");
}

So... I'm hoping that this can be done... and if not ...please someone let me know!

If I need to explain things better, i will, just let me know ;)
 
Yes I think so by using a _global variable... But let me ask you this?
Is "page.swf" originally loaded on level 0 or is it loaded on another level?
Because when loading "bkgrnd.swf" on level 0, you are actually clearing out page.swf and all it's content. Are you ever going to go back to "page.swf", once in "stores1. swf"?

Regards,

cubalibre2.gif
 
Oh! And one other suggestion. You should get used to target labeled frames (even from a main timeline!), rather than targeting scene names... That could get you in more troubles! Why gamble it?

Regards,

cubalibre2.gif
 
oldnewbie sorry for the delayed response due to the flu.

page.html is a different html, page.swf contains a sitemap_menu.swf on level 3 of page.html. it is a sitemap menu system of the site, and stores.html is a page on the main menu which i get to it from the menu page like so:
on (press) {
getURL("stores.html","_self");
}

Now the sitemap menu page's menu has a submenu of the different scenes, so i'm hoping from the sitemap page.html that a user can rollover to the submenu under the stores.html and select a state the store resides in, click it and stores.html will load and display the correct scene.
 
I think i've found a differnet way to achieve the same result.
I've sent the value over in a string like so:
page.html?aa=2

so how can i use the aa variable in an if statement to go to scene 2 of the movie in level3?

This is what I tried in frame 1 of level3 movie:
aa = _root.aa
if aa==2 .....

but that didn't work... I also tried this:
if (_url ==" {
gotoAndPlay(scene...

but that didn't work either?

Any Thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top