PDA

View Full Version : AsBroadcaster tutorial


Tink
05-19-2004, 04:58 AM
i noticed a new tutorial here (http://www.actionscripts.org/tutorials/intermediate/Flash_Broadcasters_and_Listeners/index.shtml) on the AsBroadcaster and listeners.

is it wise to have tutorial on an undocumented feature. i.e. if people begin to use this and macromedia decide to drop it from future players it could cause massive problems.

I'd really recommend writing and using you own AsBroadcaster in you projects, which don't use unsupported features.

if you using AS 2.0 you can just include and external Class file, or if your using AS 1.0 there is some code in the link below you can use.

http://www.flash-forum.co.uk/forum/showthread.php?s=&threadid=2346

if your going to keep the tutorial up there really ought to be some sort of warning, so that users know this function might not be supported in later versions of the player.

farafiro
05-20-2004, 02:58 AM
hey Tink
this was released in the early days of flash MX
u can read more about in the WIKI chat rooms
http://chattyfig.figleaf.com/
also I think flashguru did something about it
and senoculer

Tink
05-20-2004, 04:24 AM
i think what i'm trying to say is i know that its around, but it isn't documented by Macromedia. Therefore if they remove support for in from future player (which is unlikely, but they could) anyone who is using the AsBroadcaster would hav to re-code there files (which could be a bloody nightmare).

i'm stating this due to the stuff that i've read about the AsBroadcaster (specifically in 'Object Orientated Programming with Actionscript'), although maybe i'm wrong and now Macromedia have released it as a documented feature although if you do a search for it here http://www.macromedia.com/support/flash/action_scripts_dict.html, it still doesn't return anything.

i haven't got Flash handy, but can you find it in your Actionscript Dictionary in 2004.

if not i suggest the workarounds are used, as they will definately be supported in future players.

What also backs my thinking up is that Peners 'Tween' class that comes with 2004 does no use the built in AsBroadcaster, but another external class. why would he bother doing that??

farafiro
05-20-2004, 04:50 AM
but I think it's documented in MX 2004
http://www.actionscript.org/forums/showthread.php3?t=34991&highlight=AsBroadcaster

Tink
05-20-2004, 04:56 AM
that thread doesn't have any official documentation quotes from Macromedia or links to anything official by them. also as you can see by that thread Macromedia are playing around with the function.

try searching this dictionary, which should be up-to-date with 2004 http://www.macromedia.com/support/f...ripts_dict.html


im not saying don't use it, but use it understanding there is a small risk involved. this risk can be easily eleminated using the code in the link at the start of this thread. why take a risk if theres no need to??

farafiro
05-20-2004, 05:46 AM
I think I've read something about it in the documentation not in the dectionary, let me see

Tink
05-20-2004, 06:13 AM
i'd be interested in any official info you can find on it.

Korona
05-20-2004, 06:51 PM
isnt the component event model derived from ASBroadcaster? MM would be shooting themselves in the foot if they binned it now.

Tink
05-20-2004, 07:21 PM
i asked about the AsBroadcaster at the UK macromedia meeting this evening and it is still undocumented.

i was advised to use the EventDispatcher, which is documented (and i believe based on or even utilizing the AsBroadcaster).

I suggest all AS 2.0 users, use the EventDispatcher and not the AsBroadcaster

hangalot
05-21-2004, 05:04 AM
in core how it works
u import this class
import mx.events.EventDispatcher;
and call the static initialize method passing it an object reference which in turn copies the necesary methods onto the class.
events can then be dispatched using the dispatchEvent method which takes a object as a parameter
so u would do something like this
dispatchEvent({type:"myEvent",myArg:"argone",myArg:"argTwo"});
this however is already built into the uiComponent interface so when extending those classes u need not innitialize an independant evventDispatcher.

hope this helps
:D

some handy reading on this would be
http://www.jessewarden.com/archives/000509.html
http://www.peterjoel.com/blog/index.php?archive=2004_04_01_archive.xml

on chattyfig this was a big discussion about 4-6 months ago and searching their archives would b handy for info.

farafiro
05-21-2004, 09:00 AM
thanks hangalot for the links