Skip to main content
Inspiring
June 8, 2006
Answered

external swfs within swf

hello,
i have figured out how to load 4 swf's into a master swf. each swf loads some jpgs at runtime which are treated as buttons (they have rollover effect, and i can make a trace statement happen onRelease).
now i have an empty movie clip placed in the master swf, which is supposed to hold the image of the jpg clicked in one of the 4 external swf's.
im sure it has to do withthis line of code: picHolder.loadMovie(sPicPath+nPicNames[this.i]+".jpg");
(this code is in the "child" .swf.)
do i add _parent, or the name of the master swf to the path?
i have had NO luck... can anyone offer advice?
thanks.
This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
June 10, 2006
use _root.whatever to reference a movieclip with instance name whatever on screentemplates main timeline.

11 replies

kglad
Community Expert
Community Expert
June 12, 2006
you're welcome.
Translate
kglad
Community Expert
Community Expert
June 10, 2006
post a link to your fla.
Translate
Inspiring
June 10, 2006
links:

http://helix2.com/flash/screenTemplate009Help.swf

http://helix2.com/flash/screenTemplate009Help.fla
http://helix2.com/flash/OSHAp_np008Help.fla

this is my first experience with "real" actionscript, variables, etc... the scroller code is modified from someone else's slide show... i should explain that the idea is that when you click on one of the thumbnails, regardless of which of the 4 windows it is in, it will show up on the left side, in the blue band... successive clicks should replace the image on the left, so that only one will be visible at a time, and a variable created/filled (can a function be made for that?). as it is now, each of the 4 "child" swf's behaves the same, which is wrong.
clicking the "create custom sign" button sends the user to the 2nd screen where a whole other set of challenges awaits...

are there any glaring problems with the overall structure/strategy that you can see?

thank you for looking at this. i hope i haven't asked too many questions...


Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 10, 2006
use _root.whatever to reference a movieclip with instance name whatever on screentemplates main timeline.
Translate
kglad
Community Expert
Community Expert
June 9, 2006
that's impossible: if openPic() is on your _level0 timeline, then trace(this) in openPic() will not yield _level0.thumbs_mc.mc9.

and if openPic() were on _level0.thumbs_mc.mc9's timeline, trace(picHolder) on the timeline containing openPic() would not yield _level0.picHolder.

so, retry both of those trace statements from the same timeline (preferrably from within openPic()) and let me know what you see in the output panel.
Translate
Inspiring
June 9, 2006
ok,
all traced from within openPic().

1. trace([this.i]);
yields: 5 (array #)
2. trace(this);
yields: _level0.thumbs_mc.mc5
3. trace(picHolder);
yields: _level0.picHolder

perhaps i have done something "funny" to acheive this result?

thank you.
Translate
kglad
Community Expert
Community Expert
June 8, 2006
ok, so is this.i defined? ie, use trace(this.i) if you're not sure.

if so, is picHolder defined on the timeline that contains that code? ie, use trace(picHolder) if you're not sure.
Translate
Inspiring
June 8, 2006
kglad,
yes! (i think)
trace(this.i); yields the array number, which seems to me to be good.
trace(picHolder), yields "_level0.picHolder", so yes, i think it is defined on the same timeline (that is, within the "child" SWF) as the other code.
can i somehow call it from the "master" SWF?
again, thank you.
~
p.s. damn! i sent this a while ago when you were online but it didnt go through...

Translate
kglad
Community Expert
Community Expert
June 8, 2006
use trace(this) in openPic() to see what "this" if referencing.
Translate
Inspiring
June 8, 2006

trace(this); gives me:
_level0.thumbs_mc.mc9

(where thumbs_mc is dynamically created empty movieClip to hold the thumbnails that are loaded into the movie, and mc9 is the instance name of one of the loaded thumbnails.)

so, can i call this mc9 ( or whichever is clicked) from the master swf?

thank you.
Translate