Importing Flash into Flash
- Started
- Last post
- 11 Responses
- pr2
I'm trying ti import swf file int flash but it keeps breaking up. WTF?
- honda0
hehe. you can't import .swf's and expect to get individual _mc's. it imports the .swf as one element and break up the animatio nacross tons of frames and loosely translates some objects as grouped graphics. thats about it. no real way around it. sorry dude.
- pr2-1
all i need is one big mc not some grouped objects here and ther.
wasn't it possiblem in flash 5?
- arlo0
It imports frames, it doesn't inherit any structure. Maybe look into a decompiler if you are in a severe bind:
- CyBrainX0
Could you just load the swf using the loadmovie command?
- pr2-1
Are loaded movies always on top? I kind of want to load the movie but have some of teh original movie play something on top (without loading another movie).
- unformatted0
load the swf into a mc on your main movie. put the mc on a whatever layer you want in your main movie and it will stack accordingly.
- unfittoprint0
or use the following:
loadedMC.swapDepths(stageMC);
- honda0
if you are using mx, just create and empty movieclip and load the .swf into that. then you can pdynamically place the _mc anywhere you want AND have the ability to edit _mc's in the loaded .swf if you know the embedded _mc names.
- honda0
whoa my grammar was way bad in that last post. sorry. anyway, here is some code for ya.
//i prefer "onClipEvents" to write code, but understand that most use timeline based scripting, so put this code in whatever frame you are calling your loadMovie( ); event.
//create your dynamic _mc and give it an instance name
createEmptyMovieClip("newMC_name... 1);//place your new _mc on the stage
newMC_name._x = 0;
newMC_name._y = 0;//load the .swf into your newly created dynamic _mc
loadMovie("external.swf", newMC_name);//preload the .swf you are loading
this.onEnterFrame = function(){
var l = newMC_name.getBytesLoaded();
var t = newMC_name.getBytesTotal();
if(l == t){
if(newMC_name._width > 1){
newMC_name.gotoAndPlay(2);
delete this.onEnterFrame;
}
}
};//begin playing your newly created _mc
newMC_name.gotoAndPlay(2);/*you can now target your dynamic _mc and make it do whatever
or target elements in the .swf you just loaded like:newMC_name.targetMCinside_loaded... = 0;
*/
- JazX0
yeah, why not source outside .swf's with their own preloaders?
- honda0
you can. but lets say you have a .swf that didn't have a preloader in it, or you want the file to stop playing after the preloder finishes so you can target items manually or play the .swf when you wanted.
loading external .swfs into flash automatically starts them playing. so preloading the element first before playing it is a good idea. or just one i have been playin with.
either or, the createEmptyMovieClip feature is sure nice. control control control. dynamic dynamic dynamic