View Full Version : Framerate of loaded SWF changing framerate of main movie?
Rossman
04-04-2005, 04:50 PM
I don't understand why this is happening, as everywhere I read said this was impossible, but - I have my main movie defined as 24fps.
I use the following code to load in an SWF that happens to be 12fps.
_root.ImageLoop.createEmptyMovieClip("anSWF", _root.ImageLoop.getNextHighestDepth());
_root.ImageLoop.anSWF.loadMovie("./InsulinClip4plasma_12fps_mx.swf");
As I understand it the main movie should control the framerate so I was terribly shocked when I found my main movie runs at 12fps after loading in that swf.
Does anyone know how I can circumvent this?
Thanks!
badlorry
04-04-2005, 05:30 PM
the main movie does control the main frame rate.
I think you are simply loading your movie into level0, which becomes in effect the main timeline.
I just ran a test with this code. if you create 2 movies, the first at 12 fps, the other at 25 fps, then place the code in, you will see that both run at 12 fps. If you uncomment the code in the first movie, the first movie will switch to 25 fps.
first movie, 12 fps
====================
checkTime = function () {
//
_root.createEmptyMovieClip("level1_mc", 10);
_root.myStartTime = getTimer();
_root.count = 0;
//
this.onEnterFrame = function() {
//
var diffTime = getTimer()-_root.myStartTime;
_root.count++;
trace("1 - frame: " + _root.count +", diffTime: " + diffTime);
if(_root.count >= 12){
_root.loadNextMovie();
this.onEnterFrame = undefined;
}
};
};
//
loadNextMovie = function () {
loadMovie("timertests_02.swf", "level1_mc");
//
//loadMovie("timertests_02.swf", level0);
}
//
checkTime();
=====================================
second movie, 25 fps, called timertests_02.swf
=====================================
checkTime = function () {
_root.myStartTime = getTimer();
_root.count = 0;
this.onEnterFrame = function() {
//
var diffTime = getTimer()-_root.myStartTime;
_root.count++;
trace("2 - frame: " + _root.count +", diffTime: " + diffTime);
if(_root.count >= 25){
this.onEnterFrame = undefined;
}
};
};
//
//
checkTime();
=====================================
Rossman
04-04-2005, 07:01 PM
I see what you are saying, and yes I can see using the debugger that the 12fps movie is being loaded into a movieclip symbol in _level0.
However, I don't really understand how to use _level1 for my loaded movieclip, I don't think. Is there some way to createEmptyMovieClip on a new level? Because I'm not sure how I can load this content/swf into a mc symbol on the stage (which seems to be _level0) and get it to go onto _level1.
Any further advice appreciated!
Thanks!
sfhazel
04-05-2005, 10:30 AM
_root.ImageLoop.anSWF.loadMovie("./InsulinClip4plasma_12fps_mx.swf", 1);
just add the ", 1" to the end of your loadMovie function to put it on layer 1.
Rossman
04-05-2005, 03:00 PM
Thanks, but that doesn't work. Maybe because the ImageLoop mc is on _level0, I dunno.
Rossman
04-13-2005, 06:30 PM
So, I tried the folllowing code:
loadMovieNum("./InsulinClip4plasma_12fps_mx.swf", 2);
I just put that on the root timeline and I can see using the debugger that the swf is indeed loaded into _level2. However, it still slows my main movie down to 12fps instead of running at 24fps.
This is driving me crazy any other ideas?
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.