Skip to main content
Arioman
Inspiring
October 26, 2012
Answered

create pop-up window with close button

  • October 26, 2012
  • 1 reply
  • 6166 views

hi , i want to create a popup window with close button and it`s be great if there is minimize and dragable .

i search around google but i only find some popup window with JavaScript code and load URL

what i want :

1- there is button like more info

2- i want when i click it a window (layout) appear , i want to load (show) some content like : text , images , movieclips from my library

3-i need a close button that remove (close) my window

i try to not use AS3 and use Frame and graphic Technics to create popup window but it make me so confused, and i think it`s better to use some load and unload movieclip script or something's like that

anyone can help ?  thanks so much

This topic has been closed for replies.
Correct answer kglad

thanks Kglad , the add movie clip work  well with your script but i get an error when try to use remove child

can you help me ?

this is my script :

enter_mc.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);

function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void

{

var rectangle:MovieClip = new my_rectangle();

addChild(rectangle);

}

removebt.addEventListener(MouseEvent.CLICK, sos);

function sos(event:MouseEvent):void

{

    removeChild(rectangle); 

}

i have 2 button :

1-enter_mc  for addchild

2-removebt for removechild

and my movie clip name & class : my_rectangle

after test this error show and nothing work :

Scene 1, Layer 'Layer 2', Frame 1, Line 161120: Access of undefined property rectangle.

and maybe it will be important :  my removebt (Close button ) is placed in my my_rectangle movie clip


just like ned mentioned, you made rectangle local to fl_clickToGoToAndPlayFromFrame_2.  to make rectangle available outside that function call, use:

var rectangle:MovieClip

enter_mc.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);

function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void

{

rectangle= new my_rectangle();

addChild(rectangle);

}

removebt.addEventListener(MouseEvent.CLICK, sos);

function sos(event:MouseEvent):void

{

    removeChild(rectangle); 

}

1 reply

kglad
Braniac
October 26, 2012

you'll need to create that yourself or search for an as3 window component that does what you want.

Arioman
AriomanAuthor
Inspiring
October 26, 2012

any tips or guide about whats the best way ?

can you help any script to load an Movieclip ??   

i just need script to load movieclip and another for unload it

any free component ?

Arioman
AriomanAuthor
Inspiring
October 29, 2012

does removebt exist on frame 1 of rectangle?  if not, add it there and use the code i suggested.


thanks so much

finally it works ...

i put all my script in main scene this time too