Solved

Flash 5: Actionscript: Need an OnUnload kind of function

Posted on 2004-10-02
8
315 Views
Last Modified: 2012-08-13
I have a chat program. Works great.

I need an unload function though.

The chat program runs in the flash .exe format - and when someone clicks on the "X" to close the window, I need the program to connect to the server and log the user out.

The user can click on a logout button, but not many people will be doing that. :)

Any ideas?

I was hoping maybe flash had an OnUnload function like in Javascript.

Thanks :)
0
Comment
Question by:dr34m3rs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
8 Comments
 
LVL 10

Expert Comment

by:muso120999
ID: 12208257
I personally haven't seen a solution that works yet (I have looked at a few options), although I would like to.

There was a related discussion here: http:116#11893006 although it isn't entirely resolved, and if there is a solution it is more than likely it will use JavaScript like you mentioned.
0
 
LVL 10

Expert Comment

by:muso120999
ID: 12208260
0
 
LVL 1

Author Comment

by:dr34m3rs
ID: 12208408
Well javascript isn't an option in my case unless it can be called somehow with getURL("javascript:something()");

I was looking for any code that does something when the "X" is hit in an .exe format swf file (or on an UnLoad)

Thanks :)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:muso120999
ID: 12208432
> I was looking for any code that does something when the "X" is hit in an .exe format swf file (or on an UnLoad)

There is no such option that I am aware of within a projector file, but this would be much more straightforward using either Director or Authorware as a host program, with your Flash embedded.  Then the onClose event can be captured using the Windows API functions, and flags sent back to Flash before the closure, to exit gracefully.
0
 
LVL 7

Expert Comment

by:ssdesign
ID: 12217033
Why dont you call the same script that you use for logout button onto the X button?

Thats like saying you have 2 logout button, one called LOGOUT and another called X. BOth doing the same thing.
0
 
LVL 7

Accepted Solution

by:
ssdesign earned 250 total points
ID: 12217047
Sorry if i missunderstood, r u refering to the X button in on the porjector window?

If yes then try using something like, SCREENWEAVER (http://www.screenweaver.com/index.cfm?nav=0).
0
 
LVL 1

Author Comment

by:dr34m3rs
ID: 12217427
Yes I meant the X button in the projector window itself :)

Sorry to not have made that more clear...

SCREENWEAVER looks neat, I will look into that and see if it solves that problem. =D
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question