View Full Version : Export for Actionscript????
Annabella
August 10th, 2003, 04:38 AM
"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)
Annabella
August 10th, 2003, 05:22 AM
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?)
Voetsjoeba
August 10th, 2003, 05:37 AM
Well, for as much I know it is mostly used to use imported movies and mp3s with actionscript. (eg sound.attachSound("linkageID");)
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.
Annabella
August 10th, 2003, 06:25 AM
but what happens (or doesn't happen) when you don't tick this export to actionscript option???
senocular
August 10th, 2003, 07:29 AM
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.
Annabella
August 10th, 2003, 07:32 AM
so if you don't tick it, the attachMovie from library won't work, basically?
senocular
August 10th, 2003, 07:39 AM
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
Annabella
August 10th, 2003, 07:48 AM
thanks! where did you learn all these things?
(and can I persuade you to also answer my other question about attachMovie from library ;) )...
senocular
August 10th, 2003, 08:09 AM
what other question was that?
Annabella
August 10th, 2003, 08:14 AM
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
senocular
August 10th, 2003, 09:23 AM
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 ;) 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.
ahmed
August 10th, 2003, 10:04 PM
i merged threads =)
Annabella
August 11th, 2003, 04:23 AM
great, thanks Senocular!
(and slick move Ahmed ;) )
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....
Annabella
August 12th, 2003, 05:47 AM
I should take that as a yes Senocular...? ;)
ericinho
September 6th, 2003, 01:02 PM
helpful thread, but one thing I am not understanding...
with this attachMovie from library...
you automatically load an external SWF into a placeholder without that the user has to click anything, and without that it still needs to be loaded to moment the playhead arrives to it... right?
if yes, does this mean that each time when you alter this external SWF, it automatically is being 'updated' into the main.swf in which you attachMovie from library this external SWF?????
(or does flash make a internal MC of it and therefore it not only adds to the file-size of the main.swf, but also can't be updated without altering the main.swf)????
thanks!
ericinho
September 8th, 2003, 06:06 AM
hmmm, i guess no would be the answer.
dunno why i had this external swf loadMovie and attachMovie from library concept completely mixed up
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.