|Finally, we have come to the end of our journey. We have built the intro swf for our ecard and we are ready to load the external ecard swf into our Flash intro swf.|
There are two things to remember when choosing your ecard for this project. First, the Frame Rate in the Document settings should be the same for both this intro swf and the external ecard swf. Second, you will want to put the ecard swf in the same location (folder) on your server as this FlashR intro swf. If you decide to place it in another location, you will need to make adjustments to the code in this tutorial. The URL of the external swf being loaded can be relative or absolute.
At this point we have completed the animation that opens the envelope and enlarges the thumbnail to full size. We have created this intro swf with the same height and width dimensions as the ecard swf that we will be loading into this intro swf. Therefore, it will appear that the thumbnail and the external swf are the same.
It would make sense to put the ActionScript that loads the external ecard swf on the last frame of the intro animation, which is Frame 150. But the external ecard swf will take time to load. Depending on the size of your external ecard swf, there might be a visible delay from the time the thumbnail enlarges to full size and the swf begins to play. Therefore, we need to start loading the external ecard swf a few frames before the end of the intro animation.
Because the ecard swf will be loading onto the stage into a layer above the thumbnail's layer, we should not be able to see the thumbnail once the swf has loaded. This should give us a smooth transition.
In the example, I decided to load the swf on Frame 136. But, you might need to choose a different frame, depending on the size and load time of your external ecard swf. Just experiment a little with a few frames and use the frame that gives you the best results.
There is just one more thing that we need to do in preparation for the ActionScript. We need the HTML page that goes with our intro swf. We can get this simply by publishing the intro fla file. Flash will generate both the swf and HTML files. Open your fla project file into Flash CS4.
From the Menubar, click File – Publish. This will give you both an HTML and swf file in the same folder as your project fla file.
Next →Join us in the Flash forum.