Say I have a save button that can exist in multiple views and can save
multiple things. What's the best way to do this? Dispatch a different custom
event from each type of button? Send one type of custom event with different
parameters? I have a controller that listens for 28 different custom
-
From: Mattheis, Erik (MIN-WSW) ematth...@webershandwick.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, March 15, 2012 10:25 PM
Subject: [Flashcoders] Dispatching events from V to C
Say I have a save button that can exist in multiple views and can save multiple
Usually I let the view detail the event handlers, which in turn call the
appropriate controller methods. In this case, each view would have something
like
private function saveButton_clickHandler(event:MouseEvent):void{
this.controller.save(/*here is the differing parameter*/);
}
Where the
us know if it doesn't :)
regards,
Muzak
- Original Message - From: Mattheis, Erik (MIN-WSW)
ematth...@webershandwick.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, March 15, 2012 10:25 PM
Subject: [Flashcoders] Dispatching events from V to C
How does the controller know about each command class? Is each instantiated by
the controller? Do the command classes talk directly to the model or view or
back through the controller?
On 3/15/12 4:44 PM, Peter Ginneberge p.ginnebe...@telenet.be wrote:
...@webershandwick.com
To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Thursday, March 15, 2012 11:10 PM
Subject: Re: [Flashcoders] Dispatching events from V to C
How does the controller know about each command class? Is each instantiated by the controller? Do the command classes talk
Hi,
Is it possible to dispatch events from a simple call to a method?
I have a view class that extends an abstract view class that contains
the EventDispatcher class.
I don't have a problem dispatching events from onPress and other
handler, but what if I want to dispatch an event when
You have to initialize EventDispatcher to dispatch events. Your
_parent._parent must already be setup, that's why it works.
On 6/8/06, Sam [EMAIL PROTECTED] wrote:
Hi,
Is it possible to dispatch events from a simple call to a method?
I have a view class that extends an abstract view class
Hello :)
your code is very light :)
try this :
import mx.events.EventDispatcher ;
class com.test.mvc.AbstractView{
// ---o Constructor
private function AbstractView() {
// Abstract Class !!
}
// o Init EventDispatcher
static private var __initDispatcher =
the call to initialize is in my AbstractView constructor, I just did
not post it, sorry.
So, I should be able to just call dispatchEvent wherever I like, I
does not need to be tied to an event like onClick?
On Jun 8, 2006, at 2:04 PM, Ryan Matsikas wrote:
You have to initialize
Hi,
Thanks, sorry I quickly stripped the classes down for posting here.
Can you explain this portion of your code:
static private var __ASPF__ = _global.ASSetPropFlags(SampleView,
[LOAD_SOMETHING], 7, 7) ;
On Jun 8, 2006, at 2:06 PM, eka wrote:
Hello :)
your code is very light :)
try
I´d like to get a lift on this subject too because I´m still trying to
understand the best way to generate my own events
and I found this small example below which I mainly understood but seemed
too simple compared with Eka pro solution ...
but I´m still stucked with the fact that I don´t find
Hello :)
With ASSetPropFlags you can change the properties in an object :) (read only
? write or not... etc...)
With this hack my property static LOAD_SOMETHING is a real constant like
Math.PI for example :)
In AS3 you can use the keyword const... in AS2 you can do a constant with
ooops i forget :)
... if you want use an Event Model AS3 compatible... you can use my
framework VEGAS and the vegas.events package : http://osflash.org/vegas
You can use my EventDispatcher class :
-
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/vegas/events/EventDispatcher.as
you can
: donderdag 16 februari 2006 16:01
To: flashcoders at chattyfig.figleaf.com
Subject: [Flashcoders] dispatching events at creation time?
--
class tryOut {
public var addEventListener:Function;
public var removeEventListener:Function;
private var dispatchEvent:Function
Subject: [Flashcoders] dispatching events at creation time?
--
class tryOut {
public var addEventListener:Function;
public var removeEventListener:Function;
private var dispatchEvent:Function;
function tryOut() {
mx.events.EventDispatcher.initialize
--
class tryOut {
public var addEventListener:Function;
public var removeEventListener:Function;
private var dispatchEvent:Function;
function tryOut() {
mx.events.EventDispatcher.initialize(this);
trace(I am Here 1);
I've done it the same you have, but it only worked correctly in IE.
Basically, I was replacing the MovieClip.onLoad, but when I tested in
Firefox it never happened.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the
You can dispatch a Event at creation time, but no listener can listen to
this event at creation time ;-)
What came firstThe chicken or the egg? ;-)
Luca Candela schrieb:
--
class tryOut {
public var addEventListener:Function;
public var
You can dispatch a Event at creation time, but no listener can listen to
this event at creation time ;-)
Yeah that would help.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
: donderdag 16 februari 2006 16:01
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] dispatching events at creation time?
--
class tryOut {
public var addEventListener:Function;
public var removeEventListener:Function;
private var dispatchEvent:Function
I resolved this issue with a callback to a function defined outside the
class that sends the Event. anyone can tell me anything about my other
problem of the day?
On 2/16/06, John Giotta [EMAIL PROTECTED] wrote:
You can dispatch a Event at creation time, but no listener can listen to
this
Hi Javier,
This is because you've got things happening in the wrong order:
- You create your EventTry() object, which calls init()
- Init fires the event, but onEvent is still undefined
- Init then calls die()
- Die() deletes the EventTry object
- You then set onEvent to your function - after
, 2005 2:33 PM
Subject: [Flashcoders] dispatching events from a class
Hello, I'm having troubles implementing the EventDispatcher class with flash8.
I do the same I use to do before, but now the class doesn't fired the event.
Here is a sample class:
___
import mx.events.EventDispatcher
Still doesn't work. If you look at the code the class fired the event
before deleting itself. Anyway I simplify it without the die() method:
//
import mx.events.EventDispatcher;
//
//
class EventTry {
//
//members;
//event functions;
private var
that still wont work because you are dispatching the event before you
bind the function as the handler.
what are you trying to achieve (apart from getting the event to fire), i
know this is just an example, but it seems a bit strange.
anyway, you cant call init in the constructor to dispatch
Yes!!
Thanks a lot Martin, in the way you explain it, works. I didn´t notice
it before because in real coding perhaps doesn't have such issue. But
it's something to remember.
_
that still wont work because you are dispatching the event before you
bind the function as the
-
From: Javier Tello [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Sunday, November 13, 2005 10:25 AM
Subject: Re: [Flashcoders] dispatching events from a class
Yes ok Muzak, but for example, it's the way the Tween class were
implemented. It is like
Hi, I'm also having problems with Events. Could someone give me a little
help on this issue?
The EventListener is firing fine, but its associated method CAN NOT call
another Class method. Why?
Here is the Main Class: (Here is the Problem)
import com.ultrafactor.LblButton;
class
You need to use a Delegate. As this is a question which comes up about one a
week on this mailing list (not your, fault, I know!) I'm afraid I'm going to
direct you to the Flashcoders Wiki page about the problem rather than answer
you in full here...
http://www.osflash.org/flashcoders/as2
Hope
@chattyfig.figleaf.com
Sent: Sunday, November 13, 2005 12:33 PM
Subject: Re: [Flashcoders] dispatching events from a class
Thanks Jester, I know, it was a discussion about using or not the
prototype keyword, and if actionscript will support it in future
versions. But like you say, it is still being
Why delegate if the method is inside the same Class?
thanks
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas
Sent: domingo, 13 de novembro de 2005 15:46
To: Flashcoders mailing list
Subject: Re: [Flashcoders] dispatching events from a class
You need to use the Delegate in your addEventListener line - because you're
passing clickTab to a completely different object, which will later call
back to clickTab, but doesn't have the correct context. Passing
this.clickTab isn't enough - passing Delegate.create(this,clickTab) should
be enough.
Thanks!
Btw, AS 3.0 looks like AS 2.0 FIXED...
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas
Sent: domingo, 13 de novembro de 2005 16:25
To: Flashcoders mailing list
Subject: Re: [Flashcoders] dispatching events from a class = HELP
You need
How do you guys handle the following situation:
I have a class, let's say Dog that holds an instance of the class Leg.
Outside of Dog I have another class called Street that holds the dog.
Anyway, now I want street to find out whenever the dog's leg has
moved. The only way I can figure out how to
35 matches
Mail list logo