Copy link to clipboard
Copied
Hello Flash people, I suspect this is an extremely easy and simple question from a beginner...
I need to make a pop up window effect within a flash movieclip.
I read another discussion where someone got the following advice...
--------------------------
So you want it in actionscript 3?
There are several ways to do it.
One is to pull it out of the library the second is to place it on stage, set it visible = false via actionscript and set it visible = true when you click the button.
popUp.visible = false;
showBtn.addEventListener(MouseEvent.CLICK, ShowPopUP);
function ShowPopUp(e:MouseEvent) {
popUp.visible = true;
}
popUp.hideBtn.addEventListener(MousEvent.CLICK, HidePopUp);
function HidePopUp(e:MouseEvent) {
e.currentTarget.parent.visible = false;
}
This should work if you have the popUp placed on stage and you have, inside it, a button with an instance name "hideBtn". Also, of course you should name you popup window "popUp" and the trigger button "showBtn".
----------------------------------------
So I tried this and but have the following compiler error...
ReferenceError: Error #1065: Variable ShowPopUP is not defined.
at default_fla::MainTimeline/default_fla::frame1()
Copy link to clipboard
Copied
The problem may just be related to the following typo since the variable mentioned bythe error is not a variable, but the name of a function... note the spelling difference and fix it
showBtn.addEventListener(MouseEvent.CLICK, ShowPopUP);
function ShowPopUp
Copy link to clipboard
Copied
Thank you for your fast reply Ned, Tried the correction you gave and got a new version of the error...
ReferenceError: Error #1065: Variable MousEvent is not defined.
at default_fla::MainTimeline/default_fla::frame1()
Copy link to clipboard
Copied
That's another typo... should be MouseEvent.
Copy link to clipboard
Copied
a sample for you:
Copy link to clipboard
Copied
Hello and thank you for your reply!
Your code looks a bit like the there code.. But it seems to be a bit better. The other code also comes
with a com folder and .as files. And I think your code is all inclusive within the .fla.
I like that!
So going to try it now... I will let you know how it goes..
Copy link to clipboard
Copied
Hi again!
this code worked wonderfully!!!
Terrific solution, simple and to the point!
thank you incredibly for your quick solution and help!!!
great weekend!