Skip to main content
Known Participant
February 12, 2007
Question

how to name a dynamically loaded swf

  • February 12, 2007
  • 9 replies
  • 459 views
heres my prblem i have a set of button buried inside a mc when they are clicked i need them to call upon a external mc. ive tried some different code but nothing works.

_level0.contholder_mc.contractor_mc.gotoAndPlay() works but only one time. if i click on another button and then go back to the external mc i gives it another instance name. how do i stop it from giving dynamic instances names.

thanks for the help
This topic has been closed for replies.

9 replies

Known Participant
February 15, 2007
i tried it and it worked when i tested the movie but as soon as i export it it doesn't work. i don't know whats going on.
Known Participant
February 15, 2007
thanks alot symtsb. i'll try to do just that.
Inspiring
February 15, 2007
General Flash procedure is to always code you movies separate from one another. If the movie is external, all its methods, actions and symbols should be embedded inside that movie. Basically, get the buttons working in the smaller movie first. Once they are doing what you want them to there, move over to the main movie and test playback from there. Often times, there will be minor changes necessary to an object or button to insure proper playback in the main movie but they are more manageable if they are resident to the loaded clip. So start by getting your buttons working within the loaded movie's fla file then move over. That should help you tremendously.
Known Participant
February 15, 2007
yes i thought that was the only way that it could be done
Inspiring
February 14, 2007
are you trying to target those button mcs from your main movie? Big no no. Update me if this is your intent.
Known Participant
February 14, 2007
well thats kinda what i did except for the fact that the swf im loading also have buttons inside those and thats where my trouble start. See Every swf has a couple mc inside of it. one of the mcs is a set of buttons another is a block of text place on the main timeline of the swf. im kinda lost because i haven't figured out how to make it load and use the same name every time.


Inspiring
February 14, 2007
I didn't realize that the name of an instance could actually change but you learn something new everyday.

What you should do is create the container for each loaded movie on button press or at least call a function to do it. the key thing would be to make sure you always load to the same depth so that each button press replaces the movie before it. then you load the movie into that created clip. this way, the instance name of your loaded clip would be the instance name of the container and therefore, it would not change.
Known Participant
February 14, 2007
the first time i click the 1st button (button_1) that calls on the swf that pertains to that button every thing works fine. then when i click on another button (button_2)that calls a different swf, and then click on button_1 some how the swf comes up with a another instance name. i don't know how to give an external swf an instance name.

thanks
kglad
Community Expert
Community Expert
February 12, 2007
what do you mean by "...i[ t ] gives it another instance name."?