Groups | Blog | Home
all groups > flash actionscript > august 2004 >

flash actionscript : Referencing another movie for button click?



BigDanimal
8/15/2004 11:34:36 PM
Hey guys. This must be pretty simple or no? Can someone insert the code needed
to access another .swf movie when someone has hit the button. The other movie
is currently running and called main.swf. I have a menu bar that is another
flash movie. Thanks!


on (press) {
gotoAndPlay("Main Prices");
}
mandingo
8/15/2004 11:49:34 PM
I take it that the frameLabel - " Main Prices " is on the main.swf and that
that is loaded somewhere on the _root timeline.

on(press){
_root.main.gotoAndPlay("Main Prices");
}

that assumes you have a main swf loaded into a movieClip that has an
instanceName of - " main " on the _root timeline.

I hope that helps,
cheers

BigDanimal
8/15/2004 11:57:54 PM
Im still having trouble with it. The main movie is actually called portfolio so
i subed that for the main that you gave me. Now you mention that "that assumes
you have a main swf loaded into a movieClip that has an instanceName of - "
main " on the _root timeline."

I'm not sure what you mean by that. Originally portfolio.swf is loaded and it
picks up menu.swf for the menu. Now in the menu.swf i want it to load a part of
portfolio.swf. Thanks for your help.

danimal

mandingo
8/16/2004 12:07:16 AM
if you have a movieClip that is playing and called ' portfolio ' and another
movie with that has your navigation then on your button press :

on(press){
_root.portfolio.gotoAndStop("Main Prices");
}

When we talk about an instanceName, that is the name that you set either
dynamically if you are using an attach or load method or by setting that in the
properties inspector at author time.
BigDanimal
8/16/2004 12:13:52 AM
Thanks Mandingo. Could you bare with me and explain the easiest way to add the instancename. The link is still not triggering and ive tried to add the instancename.

Thanks,

mandingo
8/16/2004 12:23:50 AM
can you zip and upload your file?

when you drag an instance of the library item onto the stage, click on it once
and in the properties inspector, on the far left you should see a drop down box
displaying movieClip and then below that a field with the default < Instance
Name >

Click in that field and add the instance name.

if you still have trouble, upload your zipped .fla file.
cheers,
BigDanimal
8/16/2004 12:34:13 AM
we might be on the wrong page.

When you said "when you drag an instance of the library item onto the stage".
What is the item you are talking about? I dont have a movie to add to the
timeline. The reference I made to access the menubar was the first frame in a
blank keyframe so I didnt add any movie. I know how to add an instancename now,
but if i dont have a movie to add to the root timeline then what gives? :)

d
AddThis Social Bookmark Button