You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

How to communicate between flash plugins? Created Nov 20, 2009

This thread is solved

Views: 1835     Replies: 5     Last reply Dec 21, 2009  
You must login first before you can use this feature

peter.gedoehns

Posts: 11

Registered:
Aug 26, 2009

How to communicate between flash plugins?

Posted: Nov 20, 2009

Hi,

is there a possibility to dispatch an event in a plugin so that another plugin is notified?

I tried to use the PluginEvent, but this seems to work only inside of a plugin, not between plugins. The PlayerEvent does also not work for me, because there you don't have a custom event, which a plugin can listen for.

Thanks in advance.

dherbst

Posts: 75

Registered:
Apr 20, 2009

» How to communicate between flash plugins?

Posted: Nov 20, 2009

Reply to: How to communicate between flash plugins?, from peter.gedoehns
If it is just a flash event, you can use dispatchEvent as you would normally in actionscript.

peter.gedoehns

Posts: 11

Registered:
Aug 26, 2009

» » How to communicate between flash plugins?

Posted: Nov 23, 2009

Reply to: » How to communicate between flash plugins?, from dherbst
OK, thanks. I only wondered if there is some support from the Flowplayer API, like the PluginEvents.

Marnixvdb

Posts: 24

Registered:
Nov 19, 2009

» How to communicate between flash plugins?

Posted: Nov 23, 2009

Reply to: How to communicate between flash plugins?, from peter.gedoehns
Hi,

I haven't tried it yet, but the following should work.

Each plugin gets passed an instance of the FlowPlayer through the onLoad() function that you can use to dispatch events and to listen to events. I usually create a private var _flowplayer in onLoad, with code that looks like:

public function onLoad(player:Flowplayer):void {
			_flowplayer = player;
			_model.dispatchOnLoad();
		}

The FlowPlayer class is a child of the Flash EventDispatcher class, so you can use it to dispatch events and listen to events. All plugins should be able to do this.

So in plugin A you write something like

_flowplayer.dispatchEvent(new Event("myEventDescription"));

and in plugin B you listen for the same event:

_flowplayer.addEventListener("myEventDescription", myEventHandler);

peter.gedoehns

Posts: 11

Registered:
Aug 26, 2009

» » How to communicate between flash plugins?

Posted: Nov 24, 2009

Reply to: » How to communicate between flash plugins?, from Marnixvdb
Thank you for your reply, sounds good...

However, in the meantime I wrote my own event dispatcher. Thanks!

luc

Posts: 21

Registered:
Oct 9, 2009

» » How to communicate between flash plugins?

Posted: Dec 21, 2009

Reply to: » How to communicate between flash plugins?, from Marnixvdb
I'm interested as well, and I'd like to share my findings.

As of 3.1.5 it's not possible to listen to events on the Flowplayer object. The Flowplayer class extends the EventDispatcher (the Flowplayer version not the AS3 built-in version) which doesn't provide any public method to listen to events.

I don't quite get the purpose of the PluginModel.onPluginEvent() and PluginModel.dispatchEvent() seems it doesn't seem to be shared among plugins. Or maybe I'm wrong?

The only way right now seems to be what Peter did I suppose, which is to build (yet) another plugin to dispatch events (NB: this plugin would need to be loaded first in order to work properly...).

Can someone shed more light on this?

I'd like to first confirm it's not possible before posting a request for such a feature.