[Flashcoders] AIR: application quit via update mech

2009-12-02 Thread Eric E. Dolecki
I am supplying cleanup for my application when a user quits the application
view close button and control-q. Works great.

However if there is an update triggered for the application, the updater
quits my app and seems to bypass my cleanup mechanism (is there a special
event to listen for) - or is this not presently available to us?

Thanks,
Eric
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AIR: Application opened by someone else?

2009-12-02 Thread Eric E. Dolecki
Chris,

That's an interesting idea about the hard crash/power loss & interval
stamping. That's a circumstance I didn't think about. Right now I am
displaying the number of running instances (if more than 1) and warning the
users in the UI about data stomping... I'm not locking the data at the
moment but I could pretty easily.

Since local computers could have differing clocks I could put the timestamp
part of it in the script on the server.

I'm handling all other circumstances to provide clean up with the app quits.
event.preventDefault() rocks.

Thanks for your reply,
Eric

On Wed, Dec 2, 2009 at 12:02 PM, Chris  wrote:

> What you are mentioning sounds like the most logical course of action.
> You're basically implementing a 'lock' file within the application.
> The only issue with this approach is 'wedging' which can occur. If a
> user opens the application and their computer crashes, the file will
> be locked with no way to unlock without prompting the user to unlock.
> An approach to this is to add a timestamp to the lock and have the app
> refresh the timestamp every minute or so. Then if a timestamp is older
> than one minute (and change) you can be assured that the user with the
> lock is no longer working on the file.
>
> Peace
> C
>
> On Wed, Dec 2, 2009 at 7:43 AM, Eric E. Dolecki 
> wrote:
> > I was wondering if there is a framework for determining if an AIR
> > application has been opened by more than one person on a network?
> >
> > I have a data file that the AIR application opens and allows editing for.
> > Works great, however instances of the application all open the same data
> > file. The chances are slim that more than one person will be accessing
> that
> > single data file at a time, but I think I need to allow for detection and
> > alert a user that someone else is also accessing the data & therefore
> they
> > could stomp on each other's changes.
> >
> > I was going to use a simple XML file and when the app loads, check a
> value
> > in the XML. Each time someone opens the app, it checks the number and
> adds 1
> > to it & writes to the XML. Each time the app (instance) is quit, it
> > decrements the number until 0 (no one else is accessing). Not sure if
> this
> > is a good approach or not since it's based solely on happening when one
> > starts the application up and I was going to avoid polling the XML to see
> if
> > it changed over time.
> >
> > So looking for an easy to implement solution to this problem. Perhaps my
> XML
> > file thing is the way to go - not sure.
> >
> > Thanks for any insight,
> > Eric
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AIR: Application opened by someone else?

2009-12-02 Thread Chris
What you are mentioning sounds like the most logical course of action.
You're basically implementing a 'lock' file within the application.
The only issue with this approach is 'wedging' which can occur. If a
user opens the application and their computer crashes, the file will
be locked with no way to unlock without prompting the user to unlock.
An approach to this is to add a timestamp to the lock and have the app
refresh the timestamp every minute or so. Then if a timestamp is older
than one minute (and change) you can be assured that the user with the
lock is no longer working on the file.

Peace
C

On Wed, Dec 2, 2009 at 7:43 AM, Eric E. Dolecki  wrote:
> I was wondering if there is a framework for determining if an AIR
> application has been opened by more than one person on a network?
>
> I have a data file that the AIR application opens and allows editing for.
> Works great, however instances of the application all open the same data
> file. The chances are slim that more than one person will be accessing that
> single data file at a time, but I think I need to allow for detection and
> alert a user that someone else is also accessing the data & therefore they
> could stomp on each other's changes.
>
> I was going to use a simple XML file and when the app loads, check a value
> in the XML. Each time someone opens the app, it checks the number and adds 1
> to it & writes to the XML. Each time the app (instance) is quit, it
> decrements the number until 0 (no one else is accessing). Not sure if this
> is a good approach or not since it's based solely on happening when one
> starts the application up and I was going to avoid polling the XML to see if
> it changed over time.
>
> So looking for an easy to implement solution to this problem. Perhaps my XML
> file thing is the way to go - not sure.
>
> Thanks for any insight,
> Eric
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] AIR: Application opened by someone else?

2009-12-02 Thread Eric E. Dolecki
I was wondering if there is a framework for determining if an AIR
application has been opened by more than one person on a network?

I have a data file that the AIR application opens and allows editing for.
Works great, however instances of the application all open the same data
file. The chances are slim that more than one person will be accessing that
single data file at a time, but I think I need to allow for detection and
alert a user that someone else is also accessing the data & therefore they
could stomp on each other's changes.

I was going to use a simple XML file and when the app loads, check a value
in the XML. Each time someone opens the app, it checks the number and adds 1
to it & writes to the XML. Each time the app (instance) is quit, it
decrements the number until 0 (no one else is accessing). Not sure if this
is a good approach or not since it's based solely on happening when one
starts the application up and I was going to avoid polling the XML to see if
it changed over time.

So looking for an easy to implement solution to this problem. Perhaps my XML
file thing is the way to go - not sure.

Thanks for any insight,
Eric
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Prevent space button passing click event to button (as3)

2009-12-02 Thread Paul Steven
Thanks Henrik - yes totally agree that it is a great accessibility feature -
I guess it just tripped me up as this wasn't the case in AS2 as far as I am
aware - think it was the enter button previously?

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik
Andersson
Sent: 02 December 2009 13:36
To: Flash Coders List
Subject: Re: [Flashcoders] Prevent space button passing click event to
button (as3)

Paul Steven wrote:
> Thanks for the replies.
>
> When you say "buttons are meant to be pressed like that" - do you mean
that
> it is standard practice to use the tab key to move between buttons and
then
> use the SPACE key to click it?

It wasn't implemented just to screw with people. It is how disabled 
people can interact with flash movies.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Prevent space button passing click event to button (as3)

2009-12-02 Thread Henrik Andersson

Paul Steven wrote:

Thanks for the replies.

When you say "buttons are meant to be pressed like that" - do you mean that
it is standard practice to use the tab key to move between buttons and then
use the SPACE key to click it?


It wasn't implemented just to screw with people. It is how disabled 
people can interact with flash movies.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Prevent space button passing click event tobutton (as3)

2009-12-02 Thread Paul Steven
Thanks Muzak - that appears to have done the trick. Nice one!!

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Muzak
Sent: 02 December 2009 12:02
To: Flash Coders List
Subject: Re: [Flashcoders] Prevent space button passing click event tobutton 
(as3)

Try:

gameMenuBtn.focusRect = false;

- Original Message - 
From: "Paul Steven" 
To: "'Flash Coders List'" 
Sent: Wednesday, December 02, 2009 11:51 AM
Subject: RE: [Flashcoders] Prevent space button passing click event tobutton 
(as3)


> Thanks for the replies.
> 
> When you say "buttons are meant to be pressed like that" - do you mean that
> it is standard practice to use the tab key to move between buttons and then
> use the SPACE key to click it?
> 
> You are correct in assuming I have a game where there is a button on the
> interface that allows the user to quit the game.
> 
> I have the following code on this button:
> 
> gameMenuBtn.addEventListener(MouseEvent.CLICK, clickGameMenuButton);
> 
> function clickGameMenuButton(event:MouseEvent) {
> 
> gotoAndStop("splash");
> }
> 
> I was hoping there was just a simple way to prevent the SPACE key from
> virtually clicking this button. I still want the user to be able to click it
> with the mouse.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Prevent space button passing click event tobutton (as3)

2009-12-02 Thread Muzak

Try:

gameMenuBtn.focusRect = false;

- Original Message - 
From: "Paul Steven" 

To: "'Flash Coders List'" 
Sent: Wednesday, December 02, 2009 11:51 AM
Subject: RE: [Flashcoders] Prevent space button passing click event tobutton 
(as3)



Thanks for the replies.

When you say "buttons are meant to be pressed like that" - do you mean that
it is standard practice to use the tab key to move between buttons and then
use the SPACE key to click it?

You are correct in assuming I have a game where there is a button on the
interface that allows the user to quit the game.

I have the following code on this button:

gameMenuBtn.addEventListener(MouseEvent.CLICK, clickGameMenuButton);

function clickGameMenuButton(event:MouseEvent) {

gotoAndStop("splash");
}

I was hoping there was just a simple way to prevent the SPACE key from
virtually clicking this button. I still want the user to be able to click it
with the mouse.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Prevent space button passing click event to button (as3)

2009-12-02 Thread Paul Steven
Thanks for the replies.

When you say "buttons are meant to be pressed like that" - do you mean that
it is standard practice to use the tab key to move between buttons and then
use the SPACE key to click it?

You are correct in assuming I have a game where there is a button on the
interface that allows the user to quit the game.

I have the following code on this button:

gameMenuBtn.addEventListener(MouseEvent.CLICK, clickGameMenuButton);

function clickGameMenuButton(event:MouseEvent) {

gotoAndStop("splash");
}

I was hoping there was just a simple way to prevent the SPACE key from
virtually clicking this button. I still want the user to be able to click it
with the mouse.




-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik
Andersson
Sent: 02 December 2009 10:11
To: Flash Coders List
Subject: Re: [Flashcoders] Prevent space button passing click event to
button (as3)

Buttons are meant to be pressed like that. You are using the wrong 
object for the job.

Here is my take on it: you have a game where there are button instances 
in the gui. I would add the keyboard listener to the stage as usual. 
However, in the listener, I would add a condition to ignore events for 
things that actually have a logical response.

if(e.target is TextField||e.target is SimpleButton||(e.target is Sprite 
&& Sprite(e.target).buttonMode)) return;
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Prevent space button passing click event to button (as3)

2009-12-02 Thread Henrik Andersson
Buttons are meant to be pressed like that. You are using the wrong 
object for the job.


Here is my take on it: you have a game where there are button instances 
in the gui. I would add the keyboard listener to the stage as usual. 
However, in the listener, I would add a condition to ignore events for 
things that actually have a logical response.


if(e.target is TextField||e.target is SimpleButton||(e.target is Sprite 
&& Sprite(e.target).buttonMode)) return;

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re:Trying to set multiple images to 'export for AS' with JSFL

2009-12-02 Thread Cedric Muller

but it isn't a MovieClip, is it ?
A MovieClip can contain a (or multiple) Bitmaps, but a Bitmap cannot  
contain a MovieClip, so are these really the same ?
and if you take lots of them: lots of Bitmaps are better than lots of  
MovieClips.
... or you can convert a MovieClip to Bitmap, but the opposite would  
be quite hard.


But I may be caught in a landslide, and I don't know where I'll  
end  I answer without knowing what the inital question was. Pun me!



Craig Bowman wrote:
It's NOT a bug. A bitmap can't be assigned the attributes you want  
directly

and never has. It must be wrapped inside a symbol, like a MovieClip.


Not true, there is a fully working Bitmap symbol type just for this.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Prevent space button passing click event to button (as3)

2009-12-02 Thread Cor
My guess is that the button has the focus at that particular moment.
So maybe you can set button.mouseEnabled = false;
And set a listener to enable the button on pe. if mouseX and mouseY is at a
specific point.

HTH

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: woensdag 2 december 2009 10:27
To: 'Flash Coders List'
Subject: [Flashcoders] Prevent space button passing click event to button
(as3)

I have created a game in AS3 that uses the "SPACE" bar on the keyboard to
make the character jump. I have encountered a problem whereby pressing the
"SPACE" bar causes a button on my game screen to be clicked.

I read up that setting buttonMode to false would fix this but it does not
seem to like me using this property on my button.

i.e I tried gameMenuBtn.buttonMode = false;

but here is the error message:

1119: Access of possibly undefined property buttonMode through a reference
with static type flash.display:SimpleButton.

My button is a custom button I have created and not a button from the
components library i.e I just selected a graphic and converted to a symbol
and choose "Button".

Any ideas how to prevent this button being clicked by the "SPACE" bar being
pressed? I could change the key for jumping but feel that the "SPACE" bar is
the standard one used for this.

Thanks

Paul

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.709 / Virus Database: 270.14.89/2539 - Release Date: 12/01/09
20:32:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Prevent space button passing click event to button (as3)

2009-12-02 Thread Paul Steven
I have created a game in AS3 that uses the "SPACE" bar on the keyboard to
make the character jump. I have encountered a problem whereby pressing the
"SPACE" bar causes a button on my game screen to be clicked.

I read up that setting buttonMode to false would fix this but it does not
seem to like me using this property on my button.

i.e I tried gameMenuBtn.buttonMode = false;

but here is the error message:

1119: Access of possibly undefined property buttonMode through a reference
with static type flash.display:SimpleButton.

My button is a custom button I have created and not a button from the
components library i.e I just selected a graphic and converted to a symbol
and choose "Button".

Any ideas how to prevent this button being clicked by the "SPACE" bar being
pressed? I could change the key for jumping but feel that the "SPACE" bar is
the standard one used for this.

Thanks

Paul

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders