dispatchEvent

View: New views
4 Messages — Rating Filter:   Alert me  

dispatchEvent

by Darrin Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok all i want to do is add a eventListner to a variable, so when it changes
value I kick off a event.......  why is it so damm hard?  I am using
cairngorn, and the variable is in the model scope.  But I can not for the
life of me figure how to get the dispatch / addeventlister to work and where
it goes and what packages need to be added


this is the last step I need to get done for a release any help would be
sweet

RE: dispatchEvent

by Gregor Kiddie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use binding?

 

Gregor Kiddie
Senior Developer
INPS

Tel:       01382 564343

Registered address: The Bread Factory, 1a Broughton Street, London SW8
3QJ

Registered Number: 1788577

Registered in the UK

Visit our Internet Web site at www.inps.co.uk
<blocked::http://www.inps.co.uk/>

The information in this internet email is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is not authorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
INPS or any of its affiliates. If you are not the intended recipient
please contact is.helpdesk@...

 


RE: dispatchEvent

by Jim Hayes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

is it Watcher that you're looking for?
something along these lines :
(warning - straight off the top of my head so could well be wrong in detail at least. best check the docs)

private function addWatcher():void
{
    Watcher.watch(yourModelInstance,"yourModelProperty",onYourModelPropertyChanged);
}

private function onYourModelPropertyChanged(changeEvent:ChangeEvent)
{
    trace(changeEvent.newValue);
    //make and despatch your event here
}

I expect there are other ways to it as well..


-----Original Message-----
From: flexcoders@... on behalf of Darrin Kay
Sent: Tue 11/3/2009 10:51 AM
To: flexcoders@...
Subject: [flexcoders] dispatchEvent
 
ok all i want to do is add a eventListner to a variable, so when it changes
value I kick off a event.......  why is it so damm hard?  I am using
cairngorn, and the variable is in the model scope.  But I can not for the
life of me figure how to get the dispatch / addeventlister to work and where
it goes and what packages need to be added


this is the last step I need to get done for a release any help would be
sweet


______________________________________________________________________
This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person.
This email has been scanned for Primal Pictures by the MessageLabs Email Security System.
______________________________________________________________________
 

winmail.dat (4K) Download Attachment

RE: dispatchEvent

by Jim Hayes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ooops, maybe that should be ChangeWatcher.
Apologies, I've just got off a 14 hour overnight flight in cattle class I'm afraid!


-----Original Message-----
From: flexcoders@... on behalf of Jim Hayes
Sent: Tue 11/3/2009 12:29 PM
To: flexcoders@...
Subject: RE: [flexcoders] dispatchEvent
 
is it Watcher that you're looking for?
something along these lines :
(warning - straight off the top of my head so could well be wrong in detail at least. best check the docs)

private function addWatcher():void
{
    Watcher.watch(yourModelInstance,"yourModelProperty",onYourModelPropertyChanged);
}

private function onYourModelPropertyChanged(changeEvent:ChangeEvent)
{
    trace(changeEvent.newValue);
    //make and despatch your event here
}

I expect there are other ways to it as well..


-----Original Message-----
From: flexcoders@... on behalf of Darrin Kay
Sent: Tue 11/3/2009 10:51 AM
To: flexcoders@...
Subject: [flexcoders] dispatchEvent
 
ok all i want to do is add a eventListner to a variable, so when it changes
value I kick off a event.......  why is it so damm hard?  I am using
cairngorn, and the variable is in the model scope.  But I can not for the
life of me figure how to get the dispatch / addeventlister to work and where
it goes and what packages need to be added


this is the last step I need to get done for a release any help would be
sweet



______________________________________________________________________
This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person.
This email has been scanned for Primal Pictures by the MessageLabs Email Security System.
______________________________________________________________________
 

winmail.dat (4K) Download Attachment