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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resusable Confirmation Dialog 1

Status
Not open for further replies.

digiduck

Programmer
Apr 4, 2003
95
US
I'm trying to create a resusable confirmation dialog like what other languages have that I can use in my flash projects. I'd like to be able to call just like you can in like VisualBasic or C#, Javascript, ect... Like
Code:
on (press) {
   if (confirm("Are you sure?") == true) {
      // Do something
   }
}
Something like that. I just have no idea how to make something like that since I'm still learning flash. But I really need it for my applications.

Thanks
 
all i can think of right now is to disable anything clickable while the box is displaying the message.

my_btn.enabled = false;
my_clip.enabled = false;

and set enabled back to true when the box is dismissed
 
Yeah, that's all I could bloody think of too, but theres heaps of stuff to disable so it's either disable them all one by one or rewrite the whole bloody thing to be inside one movie clip.
Maybe I will just stick it out with trying to make the javascript work for now... I'm nearly there...
Thanks anyway!
 
A modal dialog - kind of a hash and not that pretty, but so far it seems to work.

I created a new button which was the size of my stage that is basically a white rectangle. I added this to a new movieclip called dialog and set it's alpha=0 and enabled=false. I added some textboxes and buttons to the dialog and whenever I want to show a message I set it to true. When the user clicks on the on button I hide it again.

Because the unenabled button is in the dialog, the users can't click on anything behind the dialog!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top