Export for Actionscript?

“AttachMovie from a library… takes a symbol from the library and attaches it to the movie on the Stage specified by MovieClip”.

Am I right to think that the use of this library-attachMovie linking is that with it you can automatically load external SWF’s into a main SWF (in holder MCs) without that it needs a preloader in the sense that they are already automatically loaded in frame0 (so together with the whole movie)???

And if so, what are the other disadvantages of it (apart from that it loads the library at frame 0, so if you put your preloader at frame1, you first don’t see anything for a while till the library is loaded)

I know it has something to do with libraries and attachMovies… but what is it exactly and why should you use it… or not?
(had to do something in frame1 if I am not mistaken?)

Well, for as much I know it is mostly used to use imported movies and mp3s with actionscript. (eg [AS]sound.attachSound(“linkageID”);[/AS])

To do that, you must export it for ActionScript in the library and give it an ID. When you do that, there’s a checkbox for “Export in first frame”. This means that it will be exported at the first frame, and that mostly screws up preloaders. So it is best to leave this checkbox off.

but what happens (or doesn’t happen) when you don’t tick this export to actionscript option???

the export allows actionscript to recognize objects in the library, whether it be a sound or a movieclip. Then, actionscript has a refrence from which it is able to grab something out of the library using the specified linker ID. Otherwise, actionscript can’t access that library item and should you need to attach it dynamically with actionscript, there’d be no way.

Basically its just a way to reference things from the library which you can get out and add using actionscript.

so if you don’t tick it, the attachMovie from library won’t work, basically?

right. since theres no way for attachMovie to know how to get that movieclip. Attach movie uses the linker ID as an argument. Without a valid ID, there is no attaching

thanks! where did you learn all these things?
(and can I persuade you to also answer my other question about attachMovie from library :wink: )…

what other question was that?

What is the use of this (library)?
“AttachMovie from a library… takes a symbol from the library and attaches it to the movie on the Stage specified by MovieClip”.

Am I right to think that the use of this library-attachMovie linking is that with it you can automatically load external SWF’s into a main SWF (in holder MCs) without that it needs a preloader in the sense that they are already automatically loaded in frame0 (so together with the whole movie)???

And if so, what are the other disadvantages of it (apart from that it loads the library at frame 0, so if you put your preloader at frame1, you first don’t see anything for a while till the library is loaded)

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=31247

Well if you’re working in Flash 5, you dont have that option. But all exported movieclips from the library are downloaded before the first frame of the movie. Because of this, if you have a preloader on frame 1, your linked library items would be loaded before the preloader is even loaded. Thats when your preloader starts at 30% or something and people come here and complain about it :wink: Getting around that is using a preloader movie and loading your main movie into that. The preloader movie sees all of the loading main movie starting with everything loading in before frame 1.

anywho, why would you want to attach something from the library? There are LOTS of reasons. Anything dynamic you would want to have that kind of dynamic creation for. For example. Lets say you give the user the option to make their own menu. ou allow them to specify how many items they want and what goes in each one. Well you dont know how many items they will want - thats all based on their decision so you have no way of knowing how many menu items to put on the timeline. Using actionscript and attachMovie, you can easily add as many as you need right from the library based on the number they chose.

A simpler example would be a popup dialog. Why have a popup dialog on the timeline when it doesnt always need to be there? If you ever need the popup dialog (which is a movieclip made to look like any other pop-up), just attach it from the library then remove it when its closed. A movieclip on-demand.

i merged threads =)

great, thanks Senocular!
(and slick move Ahmed :wink: )

so I was right with thinking that indeed with AttachMovie/Library I can position external SWF’s at the spots and frames that I want, and they get automatically loaded before the main movie starts playing and when the playhead arrives to that point, the external movie just plays/shows without delay…

I should take that as a yes Senocular…? :wink: