Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Flash 5: Actionscript: Need an OnUnload kind of function

Posted on 2004-10-02
8
Medium Priority
?
335 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 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 1000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

610 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