Loading Internal Swfs

This may be a stupid question, but I made a website www.adenosinemusic.com that loads external swfs when hovered over a button that shows what the button is. It is different than just a hover caption. The problem is that since it loads the external files, it can lag a little bit even though they are small files. I’ve looked on this forum and others, but couldn’t really find anything. Also, do you have any other advice regarding the site? Thanks,

  • Ian

ismith5602@yahoo.com

If I’m understanding this correctly and rolling over the right buttons, I gotta ask “why are you bothering making such small captions their own .swf file??” I would think that making the captions their own movie clip in the main file and using attachmovie() or better yet just using createTextField() would be an easier and more efficient solution and isn’t going to take up any file size.

I used a lot from the creating a full site tutorial, and that’s where I got the idea for loading the external swfs on hovering and for the main content from the links. I just hadn’t ever heard of the attachmovie method, and didn’t know how load swfs from the main library from clicking a button, or how to look it up. I had also seen a couple other people with similar questions on other forums, but they didn’t get answers. I appreciate your help, and if you have any suggestions on stuff I should look up to make the site better, I’d appreciate it.

Thanks,

  • Ian

Ok, here is my suggestions in further detail.

for attachMovie();

We’ll use your first button ‘news’ as an example:

create a textbox, type news in it, convert that to a Movie Clip, well call it, how about ‘News’. in the convert to symbol box hit Advanced>Export for ActionScript. Hit OK.Now take it off the stage, and well call it from the Library. on you button put this;

on (rollOver) {
attachMovie(“News”, “newsclip”, 1);
newsclip._x = 50;
newsclip._y = 50;
}

on (rollOut) {
newsclip.unloadMovie()
}

newsclip is the instance name we’re giving it when we attach it to the stage.

You might have to changes path names and whatnot to fit your movies, but this code kinda gives you the jist of it. Hope this helps you out.

thanks a lot… I’ll try it out later tonight or tomorrow and let you know what happens.

Okay, I got it to work, but the x y coordinates are relative to the button. Is there any way to set those relative to the stage instead? Also, I found a cool tutorial that I havent’ looked all the way through for AttachMovie if anyone wants to check it out at http://actionscript-toolbox.com/sampleattachmovie.php