Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Problem with loading an External SWF

Posted on 2001-06-14
Medium Priority
Last Modified: 2008-03-04

I am preparing a website in Flash. The layout is as follows : A base movie, which will load smaller subject SWFs onto the base movie. The smaller swfs are self contained topical units, which will be calling sub-topical swfs later depending upon which button the user clicked.

Base Movie Details:
The base movie contains 5 parallellogram shaped buttons, which are used to load each topical swf onto the base movie. This can be accomplished in two ways: either using Levels, or using Targets.

Topical Movie Details:
The topical movie is a self contained unit, which basically uses a set of circular buttons, a small preview screen and a name display movie, for the sub-topical movie to be loaded. Whenever the user mouses over one of the circular buttons, the picture in the preview screen changes. Again, this will be used to load smaller movies using Levels or Targets.

The Problem:
I have been able to get the Topical movie working fine. Basically, it works like this: a movie clip containing pictures follows a control clip. Whenever the user mouses over a circular button, the control clip's parameters are altered, and it moves off in the x direction. The picture MC is tied to this, and faithfully follows it wherever it goes. A mask is used to show only one pic at a time. The SWF file works fine on its own.

I next tried to get this SWF into the Base Movie, using Load Movie. This is where the problems begin :(!

a. If I used Load Movie with Levels, the SWF works fine. The rollovers happen, pic is shown properly. However, the SWF is loaded at an awkward position on top of the base movie, which I don't want. I tried setting the property but to no avail.

b. I tried using Load Movie with Target. Here, I loaded the SWF into a empty MC called Viewport. I aligned it so that the SWF shows exactly where I want it to. However, the pics are no longer showing at all. I checked the Variables, and I found that the control clip in the SWF has gone to some weird location, and so the pic movie clip has dutifully followed it there. Also, most of the variables in the SWF have now become 'undeclared', and have no value. But they show up for the Topical movie, when I run that independently in Flash!

You can see the movies in action and download the source at this location:

I'd really appreciate it if somebody could help me out with this. It would be perfect if I could use Targets, since that would help me achieve control over the loaded movies. However, if somebody could suggest to me how to modify the properties of a loaded movie on a new level, even that would be fine.

And, as a bonus, if you can modify my source file/s and get them working, I'll definitely jack up the points!

Question by:shekarkr

Accepted Solution

ssdesign earned 450 total points
ID: 6197486
there is a simple solution to this one.

You should make your Base movie size as the movie size for all the .swf files that you are loading.

So alll your smaller .swf files which you want to load in the base movie will have the .fla movie size equal to your Base movie size.

Then in these files place your objects in the location where you want them to appear in your Base movie. (Take reference from Base movie).

Then when you load these movies in your Base movie they will display exaclty where you want them.

This is because when you load a movie, it takes the x and y coordinates of Base movie and places the loaded movie with its x and y coordinates at x and y of the base movie.

This is the solution for you.

I have used this method to load external movies at many places.

One example can be seen at http://www.ssdesigninteractive.com and go to Graphic design section. Here everytime when you drag and drop the target in the right place a movie clip is loaded.

Author Comment

ID: 6201052
Hi Sajid.

Thanks for pointing me in the right direction. Actually, I was under the impression that if I create the submovie the same size as that of the base movie, when I load it, the loaded SWF would go and 'sit' on top of the base navigation menu, thus cutting it off!

Anyway, I have been able to get it working using Levels itself. Pity I couldn't get the target thing to work, since that would have cut down on the size of the submovies to be loaded.

Thanks for the response...

Best Rgds,

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question