"Popup" within Flash

Like so many others I’m thinking of making a game. I’m thinking of displaying messages to the player (which they can respond to by pressing one of the buttons and thus returning an answer to the game) in some sort of popup box within Flash (so not any new browser windows).

Which way would be the best to do this? And how?

Thanks in advance :slight_smile:

Make a separate swf that is just a box the size you want with a dynamic textfield on it. Then you can load in the different textfiles depending on what button is pushed.

Oh, and then you can use loadMovie or loadMovieNum (read the references, I always get them confused) to load the external swf into a level. Then you could make a little “close” button on the external swf to unloadMovie/Num.

Thank you. It works fine with loadMovieNum, and I can communicate between the two using _levelN.

However I tried centering the new _level using the following:

_level1._x = (_level0._width / 2);
_level1._y = (_level0._height / 2);

Instead it got placed in the lower right corner. Can you explain why?

(the center of the new _level is in the upper left corner?)

I’m not quite sure what you are getting at here. What is _levelN? Is that the name of your external swf/box?

I wouldn’t reccomend external swf’s. You can either have a movieclip with the first frame being blank, and the rest of the frames having the differenet messages. When you need to pop-up a message, you gotoAndStop on that frame containing the message, OR, you can use the _visible property of movieclips to toggle them on and off :slight_smile:

[bows down in respect to moderator] . . .

why wouldn’t you use externals? If there are a lot of text messages wouldn’t it be nice to have just one with a dynamic text box that loads in the different messages? :h:

You could still use the ‘movieclip with a blank first frame’ suggestion and implement a dynamic text box in it. I’ve always avoided externals. Why? Communincation could get messed up, having everything in a single swf (especially things as simple as a message box) is better i think, but then again, it’s just a perferance after all :slight_smile:

I’ll try out the Movie Clip thingie as well - thanks for the suggestions :slight_smile:

*Originally posted by lunatic *
**I’m not quite sure what you are getting at here. What is _levelN? Is that the name of your external swf/box? **
I use the loadMovieNum to place the new swf into a level. Then with the _levelN (where N is an integer) you can communicate with the different levels. _level0 is the first level where my main movie is loaded into, and in my example I loaded the new swf into _level1.

So the answer to your question should be “yes” :slight_smile:

So I tried centering the new swf over my main movie using the above script.