Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do i make a pop-up window without a button?

Guest
Oct 14, 2015 Oct 14, 2015

Hi, I am creating a game where the player will move according to a dice roll and upon reaching the designated space, there will be a interactive pop-up that comes out immediately.

However i am unable to do it without a button to call the pop-up window. Is there anyway to make sure the pop-up is automatically called?

The window is a movie clip and not an URL.

TOPICS
ActionScript
507
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Oct 15, 2015 Oct 15, 2015

In Flash player there's no pop-up window,  if you need something like that you have to create a java script pop-up function in your web page and call it in ActionScript..

In your case I think you don't need to do that just use some function to show and hide the window inside the swf file..

For example:

var window_mc:MovieClip = new MovieClip();

var textField:TextField = new TextField();

var textFormat:TextFormat = new TextFormat();

textFormat.font = "Arial";

textFormat.size = 15;

textFormat.color = 0x66

...
Translate
Enthusiast ,
Oct 14, 2015 Oct 14, 2015

if the window is a MovieClip then use addChild(window_mc); upon reaching the designated space..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 14, 2015 Oct 14, 2015

but how do i add in what i want to pop up? How do i code it that it calls the window?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 15, 2015 Oct 15, 2015

In Flash player there's no pop-up window,  if you need something like that you have to create a java script pop-up function in your web page and call it in ActionScript..

In your case I think you don't need to do that just use some function to show and hide the window inside the swf file..

For example:

var window_mc:MovieClip = new MovieClip();

var textField:TextField = new TextField();

var textFormat:TextFormat = new TextFormat();

textFormat.font = "Arial";

textFormat.size = 15;

textFormat.color = 0x666666;

textField.text = "Your text here..";

textField.wordWrap = true;

textField.setTextFormat(textFormat);

textField.width = textField.textWidth +5;

textField.height = textField.textHeight +5;

window_mc.addChild(textField);

window_mc.x = 200;

window_mc.y = 100;

window_mc.visible = false;

addChild(window_mc);

Now the pop-up window is on the stage, you can use window_mc.visible = true; to show it whenever you want, and window_mc.visible = false; to hide it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 20, 2015 Oct 20, 2015

thank you so much! Really great help!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 20, 2015 Oct 20, 2015
LATEST

You're welcome my friend.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines