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

flash actionscript : Link between SWFs


Junk Mail 1
3/11/2004 9:44:05 PM
I am having a difficult time doing something that would be very easy in html
- creating a link between sections of a website.

Let me explain...
I have a base SWF that I called "intro.swf". This SWF has three scenes, a
Preloader, Intro and Base. In this "Base" scene of this SWF is a movieclip
placeholder and several labels for each section of the site - basically
navigation. The mcPlaceholder is available in all section labels.

The navigation buttons load an external SWF into the mcPlaceholder.

In one of these external SWF's (Portfolio), I would like to place a link
that would load a different SWF (News) into the "Base" scene of the main
"intro.swf".

The button in Portfolio.swf is nested three symbol levels deep. I have used
the following actionscript to try and achieve my goal...

on (release) {
with (_level0) {
gotoAndPlay("base", "news");
loadMovie("news.swf", "placeholder");
}
}

Now, this has some degree of success - the News.swf does play. However, the
other elements in Intro.swf (navigation buttons, background, etc.) are all
gone. It's as if the News.swf "replaces" the Intro.swf in the browser
window. OR, the News.swf is covering up the Intro.swf underneath?

If anyone could provide any insight or assistance, I would greatly
appreciate it. Thanks.
--
Aj
johnlittlepeap NO[at]SPAM hotmail.com
3/12/2004 2:19:30 AM
[quoted text, click to view]

Your code looks good, but if its replacing the other content then what
is probably happening is that its replacing level0 with the news swf.
This could have something to do with the "with(_level0)" statement.
I'd change it to:

on (release) {
_root.gotoAndPlay("base", "news");
loadMovie("news.swf", "_root.placeholder");
}

Cool?

Junk Mail 1
3/13/2004 9:58:57 AM
[quoted text, click to view]

Thanks a lot John! I will give that a try. I thought I had made enough notes
about navigating between timelines, but it seems there is always something
that I've left out. :-)

Thanks again.
--
Aj
AddThis Social Bookmark Button