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!

access an MC from swf 1

Status
Not open for further replies.

2cxc

Programmer
Joined
Aug 29, 2003
Messages
245
Location
CA
I was wondering if this was possible:
I have swf1 that has a button to getUrl as _self for swf2, in swf2 i have 4 buttons, each calls swf3,4,5 (respectivly) into the same blank movie clip, on the level. SO...i press a button in swf1 to goto swf2 and press one of the 3 buttons in swf2 to load a swf into a new level, and each button in swf2 loads a new swf into the same level, replaceing the previous swf. MY question:
I am creating a tree menu of the site/ pages....How would it be possible to access, from new_swf5, swf2 with an automatic calling of either swf3,4,5. Therefore from new_swf5 i can press a button and it would lead me to swf2 with either swf3,4, or 5 already called.
 
possible and best to pass the info as a query string (so this will only work on the web and cant be tested in authoring)

so in new_swf5 to call swf2 and autoload swf3

my_btn.onRelease = function(){
getURL("swf2.swf?"&var1&"="3}

in swf2 frame 1

this.onEnterFrame = function(){
if(var1!==undefined){
loadMovie("swf" + var1 + ".swf", emptyclip)
delete this.onEnterFrame;
}
}
 
If I understand you correctly, swf2 ends up being your main movie when loaded with _self. You could have 3 extra frames in swf2, labeled with frame labels (each loading one of the other movies...) and from any one of those movies use something like...

on (release){
_level0.gotoAndStop("frame_label");
}

Regards,

cubalibre2.gif
 
oldnewbie, won't loading each one of the other movies info a labeled balnk fram make my swf2 lag cause the 3 other movies are large.

billwatson before i attempt the code i thought i'd try to understand it first:

So basically i'm passing a value to swf2, the value being based on what the button script val is set to. Then when swf2 loads the first frame will determine what value if any is passed and if there is a value then associate it with the emply MC to load the swf.

Is that correct?
 
yip you understand it well enough

all you are passing is a variable to tell flash which movie to load into an empty clip. this can be anything you want. i just used 3 as an example.
 
LoadMovie actions (and that would be what would be on those frames) are not taken into account when loading (or preloading a main movie... It would'nt lag more that it already does due to it's other content.

Regards,

cubalibre2.gif
 
LoadMovie actions (and that would be what would be on those frames) are not taken into account when loading (or preloading) a main movie... It would'nt lag more that it already does due to it's other content.

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top