librelist archives

« back to archive

How to dispatch events

How to dispatch events

From:
varun kumar
Date:
2012-09-24 @ 14:31
Hi,

Could any one please help me on "How to dispatch events using Melomel (How
to trigger events on flash/flex applications using melomel ?) "



Thanks in advance !!

-- 
With Regards&Thanks
Varun Ponugoti

Re: [melomel] How to dispatch events

From:
Ben Johnson
Date:
2012-09-24 @ 15:34
Unfortunately Melomel doesn't have a way to instantiate classes with 
constructors that have required arguments. You'll need to provide a 
function in your application to actually create the event like this:

public class MyUtil {
  static public function createMyEvent():MyEvent {
    return new MyEvent("myType");
  }
}

And then call that function from Melomel. Once you have a reference to the
event you can just call dispatchEvent() on an object and pass in your 
event object.

What kind of events are you trying to dispatch?


Ben


On Sep 24, 2012, at 8:31 AM, varun kumar wrote:

> Hi, 
> 
> Could any one please help me on "How to dispatch events using Melomel 
(How to trigger events on flash/flex applications using melomel ?) "
> 
> 
> 
> Thanks in advance !!
> 
> -- 
> With Regards&Thanks
> Varun Ponugoti
> 

Re: [melomel] How to dispatch events

From:
varun kumar
Date:
2012-09-24 @ 15:58
Hi Ben ,
thanks for the quick reply.

Actually as i said couple of weeks ago i have created a java client to use
Melomel swc.

As i am setting the properties ex . a text property which really dosent
invoke/trigger "change" event on it ( Which is need to enable a disabled
button )

( I am having problem while implementing Key press ) .

I have implemented Selenium WebDriver style of code style with Melomel Java

Ex.

public Button buttonName = new Button (By.name ("chatInput") ,
"flash.display.MovieClip");

public Button buttonName = new Button (By.id ("chatInput") ,
"mx.controls.Button");

public TextField buttonName = new TextField (By.name ("chatInput") ,
"mx.Controls.TextField");


Writing Doc's at the moment. ASAP i will do open source this one

On Mon, Sep 24, 2012 at 4:34 PM, Ben Johnson <benbjohnson@yahoo.com> wrote:

> Unfortunately Melomel doesn't have a way to instantiate classes with
> constructors that have required arguments. You'll need to provide a
> function in your application to actually create the event like this:
>
> public class MyUtil {
>   static public function createMyEvent():MyEvent {
>     return new MyEvent("myType");
>   }
> }
>
> And then call that function from Melomel. Once you have a reference to the
> event you can just call dispatchEvent() on an object and pass in your event
> object.
>
> What kind of events are you trying to dispatch?
>
>
> Ben
>
>
> On Sep 24, 2012, at 8:31 AM, varun kumar wrote:
>
> Hi,
>
> Could any one please help me on "How to dispatch events using Melomel (How
> to trigger events on flash/flex applications using melomel ?) "
>
>
>
> Thanks in advance !!
>
> --
> With Regards&Thanks
> Varun Ponugoti
>
>
>


-- 
With Regards&Thanks
Varun Ponugoti

Re: [melomel] How to dispatch events

From:
Ben Johnson
Date:
2012-09-24 @ 16:08
There are some static methods within the melomel.core.UI class for 
interacting with UI elements. There's a click(), doubleClick(), mouseUp(),
mouseDown(), keyUp(), keyDown() & keyPress(). Hopefully those can help.

I do remember hitting an issue with invoking a key press a while back. I'm
not sure whatever happened with that though.


Ben


On Sep 24, 2012, at 9:58 AM, varun kumar wrote:

> Hi Ben , 
> thanks for the quick reply.
> 
> Actually as i said couple of weeks ago i have created a java client to 
use Melomel swc.
> 
> As i am setting the properties ex . a text property which really dosent 
invoke/trigger "change" event on it ( Which is need to enable a disabled 
button ) 
> 
> ( I am having problem while implementing Key press ) . 
> 
> I have implemented Selenium WebDriver style of code style with Melomel Java 
> 
> Ex. 
> 
> public Button buttonName = new Button (By.name ("chatInput") , 
"flash.display.MovieClip");
> 
> public Button buttonName = new Button (By.id ("chatInput") , 
"mx.controls.Button");
> 
> public TextField buttonName = new TextField (By.name ("chatInput") , 
"mx.Controls.TextField");
> 
> 
> Writing Doc's at the moment. ASAP i will do open source this one 
> 
> On Mon, Sep 24, 2012 at 4:34 PM, Ben Johnson <benbjohnson@yahoo.com> wrote:
> Unfortunately Melomel doesn't have a way to instantiate classes with 
constructors that have required arguments. You'll need to provide a 
function in your application to actually create the event like this:
> 
> public class MyUtil {
>   static public function createMyEvent():MyEvent {
>     return new MyEvent("myType");
>   }
> }
> 
> And then call that function from Melomel. Once you have a reference to 
the event you can just call dispatchEvent() on an object and pass in your 
event object.
> 
> What kind of events are you trying to dispatch?
> 
> 
> Ben
> 
> 
> On Sep 24, 2012, at 8:31 AM, varun kumar wrote:
> 
>> Hi, 
>> 
>> Could any one please help me on "How to dispatch events using Melomel 
(How to trigger events on flash/flex applications using melomel ?) "
>> 
>> 
>> 
>> Thanks in advance !!
>> 
>> -- 
>> With Regards&Thanks
>> Varun Ponugoti
>> 
> 
> 
> 
> 
> -- 
> With Regards&Thanks
> Varun Ponugoti
> 

Re: [melomel] How to dispatch events

From:
varun kumar
Date:
2012-09-24 @ 16:15
Hi ,

Thanks for suggesting

Have you had a look at this one


https://github.com/scho/melomel/blob/master/src/main/flex/melomel/commands/CreateObjectCommand.as

Is it worth trying ???? ( Its accepting constructor parameters )

On Mon, Sep 24, 2012 at 5:08 PM, Ben Johnson <benbjohnson@yahoo.com> wrote:

> There are some static methods within the melomel.core.UI class for
> interacting with UI elements. There's a click(), doubleClick(), mouseUp(),
> mouseDown(), keyUp(), keyDown() & keyPress(). Hopefully those can help.
>
> I do remember hitting an issue with invoking a key press a while back. I'm
> not sure whatever happened with that though.
>
>
> Ben
>
>
> On Sep 24, 2012, at 9:58 AM, varun kumar wrote:
>
> Hi Ben ,
> thanks for the quick reply.
>
> Actually as i said couple of weeks ago i have created a java client to use
> Melomel swc.
>
> As i am setting the properties ex . a text property which really dosent
> invoke/trigger "change" event on it ( Which is n eed to enable a disabled
> button )
>
> ( I am having problem while implementing Key press ) .
>
> I have implemented Selenium WebDriver style of code style with Melomel
> Java
>
> Ex.
>
> public Button buttonName = new Button (By.name ("chatInput") ,
> "flash.display.MovieClip");
>
> public Button buttonName = new Button (By.id ("chatInput") ,
> "mx.controls.Button");
>
> public TextField buttonName = new TextField (By.name ("chatInput") ,
> "mx.Controls.TextField");
>
>
> Writing Doc's at the moment. ASAP i will do open source this one
>
> On Mon, Sep 24, 2012 at 4:34 PM, Ben Johnson <benbjohnson@yahoo.com>wrote:
>
>> Unfortunately Melomel doesn't have a way to instantiate classes with
>> constructors that have required arguments. You'll need to provide a
>> function in your application to actually create the event like this:
>>
>> public class MyUtil {
>>   static public function createMyEvent():MyEvent {
>>     return new MyEvent("myType");
>>   }
>> }
>>
>> And then call that function from Melomel. Once you have a reference to
>> the event you can just call dispatchEvent() on an object and pass in your
>> event object.
>>
>> What kind of events are you trying to dispatch?
>>
>>
>> Ben
>>
>>
>> On Sep 24, 2012, at 8:31 AM, varun kumar wrote:
>>
>> Hi,
>>
>> Could any one please help me on "How to dispatch events using Melomel
>> (How to trigger events on flash/flex applications using melomel ?) "
>>
>>
>>
>> Thanks in advance !!
>>
>> --
>> With Regards&Thanks
>> Varun Ponugoti
>>
>>
>>
>
>
> --
> With Regards&Thanks
> Varun Ponugoti
>
>
>


-- 
With Regards&Thanks
Varun Ponugoti

Re: [melomel] How to dispatch events

From:
Ben Johnson
Date:
2012-09-25 @ 02:38
Yeah, that should work fine.

Ben


On Sep 24, 2012, at 10:15 AM, varun kumar wrote:

> Hi , 
> 
> Thanks for suggesting 
> 
> Have you had a look at this one 
> 
> 
https://github.com/scho/melomel/blob/master/src/main/flex/melomel/commands/CreateObjectCommand.as
> 
> Is it worth trying ???? ( Its accepting constructor parameters )
> 
> On Mon, Sep 24, 2012 at 5:08 PM, Ben Johnson <benbjohnson@yahoo.com> wrote:
> There are some static methods within the melomel.core.UI class for 
interacting with UI elements. There's a click(), doubleClick(), mouseUp(),
mouseDown(), keyUp(), keyDown() & keyPress(). Hopefully those can help.
> 
> I do remember hitting an issue with invoking a key press a while back. 
I'm not sure whatever happened with that though.
> 
> 
> Ben
> 
> 
> On Sep 24, 2012, at 9:58 AM, varun kumar wrote:
> 
>> Hi Ben , 
>> thanks for the quick reply.
>> 
>> Actually as i said couple of weeks ago i have created a java client to 
use Melomel swc.
>> 
>> As i am setting the properties ex . a text property which really dosent
invoke/trigger "change" event on it ( Which is n eed to enable a disabled 
button ) 
>> 
>> ( I am having problem while implementing Key press ) . 
>> 
>> I have implemented Selenium WebDriver style of code style with Melomel Java 
>> 
>> Ex. 
>> 
>> public Button buttonName = new Button (By.name ("chatInput") , 
"flash.display.MovieClip");
>> 
>> public Button buttonName = new Button (By.id ("chatInput") , 
"mx.controls.Button");
>> 
>> public TextField buttonName = new TextField (By.name ("chatInput") , 
"mx.Controls.TextField");
>> 
>> 
>> Writing Doc's at the moment. ASAP i will do open source this one 
>> 
>> On Mon, Sep 24, 2012 at 4:34 PM, Ben Johnson <benbjohnson@yahoo.com> wrote:
>> Unfortunately Melomel doesn't have a way to instantiate classes with 
constructors that have required arguments. You'll need to provide a 
function in your application to actually create the event like this:
>> 
>> public class MyUtil {
>>   static public function createMyEvent():MyEvent {
>>     return new MyEvent("myType");
>>   }
>> }
>> 
>> And then call that function from Melomel. Once you have a reference to 
the event you can just call dispatchEvent() on an object and pass in your 
event object.
>> 
>> What kind of events are you trying to dispatch?
>> 
>> 
>> Ben
>> 
>> 
>> On Sep 24, 2012, at 8:31 AM, varun kumar wrote:
>> 
>>> Hi, 
>>> 
>>> Could any one please help me on "How to dispatch events using Melomel 
(How to trigger events on flash/flex applications using melomel ?) "
>>> 
>>> 
>>> 
>>> Thanks in advance !!
>>> 
>>> -- 
>>> With Regards&Thanks
>>> Varun Ponugoti
>>> 
>> 
>> 
>> 
>> 
>> -- 
>> With Regards&Thanks
>> Varun Ponugoti
>> 
> 
> 
> 
> 
> -- 
> With Regards&Thanks
> Varun Ponugoti
>