Working in Flash5 - I have an swf file that’s like a movie screen the I want movies (external swf) to load into-but I want these movies to fit within a particular area centered on the screen.
To test this out I have created 3 animations photo1.swf thru photo3.swf and the screen photogaller.swf.
The photogaller.swf starts at a blank screen and has a forward and back button. In the forward button I have this code modified appropriately for each frame:
//this is in frame 2
on (release) {
unloadMovie (“photo1.swf”);
loadMovie (“photo2.swf”, “frame”);
gotoAndStop (3);
}
In the back I have:
//this is in frame 3
on (release) {
unloadMovie (“photo2.swf”);
loadMovie (“photo1.swf”, “frame”);
gotoAndStop (2);
}
//”frame” is a movie clip in photogaller.swf
MAIN PROBLEM: Movies load actual size from top corner/centerpoint of “frame”
Is there code to fix and modify size and alignment of loaded swf so I don’t have to change the size of the original (i.e. photo1.swf)?
SILLY PROBLEM: When I use the back buttons to unload the swf and I get to the back button before the blank screen frame I have this code:
on (release) {
unloadMovie (“photo1.swf”);
gotoAndStop (1);
}
It’s pretty simple. Make a new document and call it whatever you want. Save it.
In the main timeline, create a new movie clip symbol and call it loader. Inside the clip this is where your border or what have you goes.
Line up the upper left edge of your box to the cross hair. Exit out of the loader clip to the root scene. Select the loader clip and go to the instance box and type in loader as the clips name.
Position your clip where ever want on the root timeline. Make a new layer above this one and call it “actions”. In the first frame put the action “loadMovie”.
Make sure that the this movie and the other swf files are in the same directory.
In the URL field put:
yourmovie.swf
Insted of levels select target, then put your cursor on the field. Once it is blinking in the field, type in _root.loader. This targets the movie clip on your root timeline to load your movie.swf in to. Since you put the cross hairs in the upper left section, it will load in the middle of your clip(which is called loader)
Save and test your movie.
You can apply the code to a button if you like, this is just an example
If you get an error, this probably means your movies are not in the same directory.
Ok,
I got that far the only problem is that the swf files load top left corner from where ever I put the cross hair. But I have a variety of swf boarders(landscape, portriat, square) and instead of being centered when they appear they are justified left----if that makes since. I am hoping for code that will take the size of the loaded swf and center it to a certain point. Also, resizing it to keep within a certain boundry.
This could be a square peg in a round hole issue:)
There are too many swf files that I want to load to make creating individual mc for each.
Creating engaging and entertaining content for designers and developers since 1998.