开发者

Importing a flash quiz into another movie

开发者 https://www.devze.com 2022-12-25 23:21 出处:网络
I am having trouble loading a quiz.swf into another another movie. To generate my quiz I goto File > New > Templates > Quiz > Quiz_style_1

I am having trouble loading a quiz.swf into another another movie.

To generate my quiz I goto File > New > Templates > Quiz > Quiz_style_1

and in the first frame of the example quiz I add

stop(); // To prevent playback
this._lockroot = true; // to preserve the heirarchy

Then I publish the quiz as testquizex.swf, and I can test this movie and it works fine by itself.

Then in a different movie I start with a blank scene I add a keyframe and I insert

stop();
var mc:MovieClip = this.createEmptyMovieClip("mc", 开发者_Go百科this.getNextHighestDepth());
mc.loadMovie("testquizex.swf");

Now the movie imports and loads into the frame and I can navigate through to the first question page, but the quiz doesn't actually work anymore i.e. drop targets dont work and the score won't increase. Is there anything else I have to do to the stock quiz template to make it importable into another project?


i believe that the lockroot should be applied to the movieclip that is loading the clip, not in the clip that is being loaded.

try:

var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc._lockroot = true;
mc.loadMovie("testquizex.swf");
0

精彩评论

暂无评论...
验证码 换一张
取 消