This is an archived tutorial from the kirupa.com legacy collection. It covers software that may no longer be available, but it is kept online because the ideas still hold up.
This tutorial will explain how to build a flash website with external SWF content, transition effect and also preload the external content. The following animation should give you an example of what you will be creating:
[ click the buttons in the above animation
]
The Flash site in this tutorial consists of the following:
Before we begin, you should download the partial source for the animation. Don't worry, the partial source still involves you creating objects, adding actions, and more:
[ set the x and y
coordinates ]
Repeat the same for the buttons named but2 and but3. Give them them the instance name b2 and b3. Also, ensure their coordinates are the following:
but2: x=10 y=80
but3: x=10 y=110
We are done with the buttons. This is how
your stage will look like after completing the above step:
[ how your stage should look ]
Select the mask layer. Open your
library, drag the mask symbol and drop it on stage.
Set its x coordinate to 100 and y to 40.
Select the content layer. Open your
library, drag the content symbol and drop it on
stage. Set its x coordinate to 100 and y to 40. Name this
instance content.
Select the transition layer. Open
your library, drag the transition symbol and drop
it on stage. Set its x coordinate to 240 and y to 114.
Name this instance transition. We are almost done
now...
Now we have to set the mask layer
as a mask for the content and transition
layers because we just want the transition and content to
be visible inside the content area.
Right click the mask layer. Select Mask.
Right click on content layer. Select Properties.
Now check the Masked option. This is how your
layers will look like after this:
[ your layer structure ]
We are done with the interface. Now we have to add all the actions.
[ copy and paste the above
code ]
[ copy and paste the above
code ]
_root.section =
"profile.swf";
loadMovie(_root.section, _root.content);stop();stop();The following sections provide a brief reasoning behind why the code was used and how it works in its used context.
if (_root.section != "profile.swf") {
checks if _root.section is different than "profile.swf"
_root.section = "profile.swf";
_root.transition.gotoAndPlay("closing");
if (!loaded && this._url != _root._url)
{
if (this.getBytesLoaded() ==
this.getBytesTotal()) {
_root.transition.gotoAndPlay("opening");You have just completed the tutorial. If you want to test it, upload it to a server. I have provided the final source for you to examine.
If you have any questions, feel free to post them on the forums by clicking here.
Regards,
|
|
claudio |
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy kirupa's books, became a paid subscriber, watch the videos, and/or interact on the forums.
Your support keeps this site going! 😇
:: Copyright KIRUPA 2026 //--