Copy link to clipboard
Copied
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.
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
...Copy link to clipboard
Copied
if the window is a MovieClip then use addChild(window_mc); upon reaching the designated space..
Copy link to clipboard
Copied
but how do i add in what i want to pop up? How do i code it that it calls the window?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
thank you so much! Really great help!
Copy link to clipboard
Copied
You're welcome my friend.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now