?
Solved

Flash 5: Actionscript: Need an OnUnload kind of function

Posted on 2004-10-02
8
Medium Priority
?
328 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

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!

Question has a verified solution.

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

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

801 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