Solved

Flash 5: Actionscript: Need an OnUnload kind of function

Posted on 2004-10-02
8
285 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
  • 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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 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…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now