Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup Window in Flash MX

Status
Not open for further replies.

jason12776

Technical User
Nov 15, 2001
93
0
0
US
What needs done:

When a button is clicked, I need to have a window appear, with options. When the user selects an option, the parent window will populate in certain text boxes with information from the popup window.

The problem:

How do I have a new window appear, then populate the parent form with information from the popup window?

Any ideas?

Cheers,
Jason
 
The new window is simple - have a look at this tutorial on Flashkit:


Populating Flash textfields with info passed from another page is slightly more difficult, though. I'd imagine you'd have to use some sort of CGI script to pass variables to a text file or something, then get Flash to constantly check that file to see what's happening in the other window.

Not as easy as it sounds!
 
you could have the new window as a movieclip in flash. Initialize it with the _visible set to false. when the button is pressed set the _visible to true. Then values and buttons on the form in the new window/movieclip can change the values of your dynamic textboxes. This is probably the easiest way of doing it. let me know if you have questions or would prefer to do it another way and I will see if I can help.

Blast
 
BlastRadius:

I like that idea, but I'm so new to flash, I don't have much of a clue on how to accomplish that. I'm assuming the _visible is like the visible property in Visual Basic, and can set that item to visible when a certain even happens. I am not, however, sure how to make your idea work though. I'm just a Flash newbie, and expected to come up with a professional and expert level project. Not too sure how I'm going to do that though. Any other thoughts would be greatly appreciated.

Cheers,
Jason
 
ok here we go
press the insert option on the menu and click new symbol on the form that pops up select movieclip and press ok
this will open a new timeline
create a graphic that looks like a window - put a x in the corner and all that stuff. put your buttons and whatever you want inside the window.
return to you mainline by clicking on scene 1 or whatever you have renamed it to.
create new layer in your main timeline and place and instance of your window on this layer (drag from the library - you may need to F11 to see your lybrary) and place it where you want it. With the focus on this window object click the instance panel you want to track as a movie clip and give the instance a relevent name - ex myWindow
on the timeline if you don't have an actions layer I would create one. Creat a keyframe in frame 1 on the actions layer. select frame 1 right click it and select actions this will bring up the actions panel. Press the + sign and navigate threw the menu until you find set property and click it. on the form select _visible for the property type myWindow(or what instance name you gave the window) for the target and false for the value and check the expression checkbox for the value. If you are in expert mode you could just type in:

setProperty("myWindow", _visible, false);

this will make it so that the window will not be seen when the movie starts and as long as you have an active frame on your timeline for the window layer you can use an on(click) event or another event to reset the _visible propery value to true (use above code with value true instead of false) making the window appear to popup. Then after the user has input some info and submitted it set the _visible property to false reset the varibles filling your dynamic textbox and your off to the races.

I hope this helps if there is a need for me to clarify anything just ask and I will try and make it as simple as can be for you.

Blast
 
Blast,

Thank you, although I haven't tried it yet, I will on Monday, that makes perfect sense now. My only question now, is how would I pass information from the hidden window, to the parent window. For example, when the user clicks on an item in the hidden window, information from that window will populate into the parent window into text boxes. Any ideas?

Cheers,
Jason

I will not be able to respond untill Sunday at the earlies. I want to thank you and everybody else for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top