Frame rate question

Just a question - if i dynamically import a swf into a movie, will it play at its original rate or will it readjst itself to the movie its imported into?

original

Rev

…unless you have streaming audio in which case the Flash player will adjust to meet the framerate of that audio (which is sometimes used as a hack around adjusting FPS of a movie dynamically)

what?
I tryed it awhile ago, and the swf i imported dynamically started playing at a faster rate (the rate of the movie i imported it into)

The FPS rate of the movie loaded inherits the FPS rate of the main movie it loads into.

How can i get around this?

You can create a mock FPS rate. Something like this on the first frame of your movie should do it…

[AS]
//create the function to play the nextframe of the timeline
function mockRate(){
nextFrame();
}
//set fps rate value
var fps = 12;
//use setInterval to create the fake frame rate
fauxFPS = setInterval(mockRate, 1000/fps);[/AS]

I hope that helps.

the main movie or the one being imported

The one being imported.

Keep in mind that it depends on how you load the swfs. If you load a swf in at level 0 then it will replace the previous one and will be the “master control” movie and set the framerate. If you load in at any other level the original framerate will stay in control.

If you want to test it out, create a simple animation in a file and set it to a really high framerate–say 100 fps. Call it movie1 and publish it. Test it & you’ll see it plays at or near that frame rate.

Create a second file with two buttons. Set the framerate to 10 fps. On the first button, put :

on (release) {
loadMovieNum(“movie1.swf”, 0);
}

On the second button put:

on (release) {
loadMovieNum(“movie1.swf”, 1);
}

If save & publish it out & test it–you’ll see that if you click on the second button, it will load the animation in & play at the 10 fps. If you click on the first button, it will play at the 100 fps. In both cases, it’s loading the exact same swf but the target level dictates which swf controls the framerate.