Re: [Flashcoders] AS3: Dispatching events to further listeners, but not to itself
Hello, may I please rephrase my question, maybe someone will have a hint for me? By my PlayingCard objects I'd like to dispatch 2 events: Event.CHANGE and MouseEvent.CLICK I do it because in my game you can drag cards, but also you can select them from a list and click a button. So I could use same handler functions. My problem with the MouseEvent.CLICK is however that I receive it twice - 1 event comes from the PlayingCard and another one seems to be dispatched automatically. Is there please a way to prevent the latter event from being sent? Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3: Dispatching events to further listeners, but not to itself
I think your event is bubbling. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Alexander Farber Sent: zondag 28 december 2008 11:14 To: Flash Coders List Subject: Re: [Flashcoders] AS3: Dispatching events to further listeners, but not to itself Hello, may I please rephrase my question, maybe someone will have a hint for me? By my PlayingCard objects I'd like to dispatch 2 events: Event.CHANGE and MouseEvent.CLICK I do it because in my game you can drag cards, but also you can select them from a list and click a button. So I could use same handler functions. My problem with the MouseEvent.CLICK is however that I receive it twice - 1 event comes from the PlayingCard and another one seems to be dispatched automatically. Is there please a way to prevent the latter event from being sent? Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1866 - Release Date: 27-12-2008 20:49 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: Dispatching events to further listeners, but not to itself
I haven't studied your code in depth - however, I would say this this is wrong (whatever you are doing): private function handleMouseMove(event:MouseEvent):void { // XXX trying to reuse the MOUSE_MOVE event // XXX and to dispatch it to PlayingTable - fails :-( dispatchEvent(event); } The Flash event system doesn't like redispatching the same event object. To redispatch an event like this, try the following: private function handleMouseMove(event:MouseEvent):void { // XXX trying to reuse the MOUSE_MOVE event // XXX and to dispatch it to PlayingTable - fails :-( dispatchEvent(event.clone()); } HTH, Ian On Sun, Dec 28, 2008 at 10:16 AM, Cor c...@chello.nl wrote: I think your event is bubbling. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Alexander Farber Sent: zondag 28 december 2008 11:14 To: Flash Coders List Subject: Re: [Flashcoders] AS3: Dispatching events to further listeners, but not to itself Hello, may I please rephrase my question, maybe someone will have a hint for me? By my PlayingCard objects I'd like to dispatch 2 events: Event.CHANGE and MouseEvent.CLICK I do it because in my game you can drag cards, but also you can select them from a list and click a button. So I could use same handler functions. My problem with the MouseEvent.CLICK is however that I receive it twice - 1 event comes from the PlayingCard and another one seems to be dispatched automatically. Is there please a way to prevent the latter event from being sent? Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1866 - Release Date: 27-12-2008 20:49 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: Dispatching events to further listeners, but not to itself
Mousechildren = false ? Sent from my iPhone On 28 Dec 2008, at 10:13, Alexander Farber alexander.far...@gmail.com wrote: Hello, may I please rephrase my question, maybe someone will have a hint for me? By my PlayingCard objects I'd like to dispatch 2 events: Event.CHANGE and MouseEvent.CLICK I do it because in my game you can drag cards, but also you can select them from a list and click a button. So I could use same handler functions. My problem with the MouseEvent.CLICK is however that I receive it twice - 1 event comes from the PlayingCard and another one seems to be dispatched automatically. Is there please a way to prevent the latter event from being sent? Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3LCR as CHM
If you can't open it by double clicking on it (usually i can, but this time i couldn't) use a software like xCHM (free, 1.1Mb ) to open it. http://sourceforge.net/project/downloading.php?group_id=87007use_mirror=garrfilename=xchm-1.13.zip15359781 On Sun, Dec 28, 2008 at 11:07 AM, Cor c...@chello.nl wrote: Valentin, The file seems to be empty?? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Valentin Schmidt Sent: zondag 28 december 2008 1:10 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] AS3LCR as CHM hi, just a little hint for all adherents of the CHM format: there is a good CHM version of the ActionScript 3.0 Language and Components Reference (english CS4 version) at http://rapidshare.com/files/177383554/as3lcr.chm cheers, valentin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1866 - Release Date: 27-12-2008 20:49 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3LCR as CHM
I can open it, but when I select an item it does not show the according text. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Pedro Kostelec Sent: zondag 28 december 2008 13:08 To: Flash Coders List Subject: Re: [Flashcoders] AS3LCR as CHM If you can't open it by double clicking on it (usually i can, but this time i couldn't) use a software like xCHM (free, 1.1Mb ) to open it. http://sourceforge.net/project/downloading.php?group_id=87007use_mirror=garrfilename=xchm-1.13.zip15359781 On Sun, Dec 28, 2008 at 11:07 AM, Cor c...@chello.nl wrote: Valentin, The file seems to be empty?? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Valentin Schmidt Sent: zondag 28 december 2008 1:10 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] AS3LCR as CHM hi, just a little hint for all adherents of the CHM format: there is a good CHM version of the ActionScript 3.0 Language and Components Reference (english CS4 version) at http://rapidshare.com/files/177383554/as3lcr.chm cheers, valentin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1866 - Release Date: 27-12-2008 20:49 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1866 - Release Date: 27-12-2008 20:49 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3LCR as CHM
Yes, that did the trick. Thank you!! -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Pedro Kostelec Sent: zondag 28 december 2008 13:08 To: Flash Coders List Subject: Re: [Flashcoders] AS3LCR as CHM If you can't open it by double clicking on it (usually i can, but this time i couldn't) use a software like xCHM (free, 1.1Mb ) to open it. http://sourceforge.net/project/downloading.php?group_id=87007use_mirror=garrfilename=xchm-1.13.zip15359781 On Sun, Dec 28, 2008 at 11:07 AM, Cor c...@chello.nl wrote: Valentin, The file seems to be empty?? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Valentin Schmidt Sent: zondag 28 december 2008 1:10 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] AS3LCR as CHM hi, just a little hint for all adherents of the CHM format: there is a good CHM version of the ActionScript 3.0 Language and Components Reference (english CS4 version) at http://rapidshare.com/files/177383554/as3lcr.chm cheers, valentin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1866 - Release Date: 27-12-2008 20:49 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1866 - Release Date: 27-12-2008 20:49 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] multi language support and font embed/styling best practices?
greetings list. the team i am on is building an AS3 site that needs to support multi languages. I'm inquiring about best practices, custom built classes/solutions, etc for dealing with runtime font loading/sharing vs. embedding... basically a font management and styling solution allowing external text. i've seen a few blog posts on the subject and was wondering if there was a general consensus as to the best approach. thanks in advance. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] multi language support and font embed/styling best practices?
The way I handle this is to use a server-side script to serve a swf file (as an RSL). I.e. fonts.php that checks against a language cookie (or session) and depending on the language serves up a different swf. The only thing you have to take into consideration here is caching, so make sure server-side caching is turned off for the fonts.php file and set the caching headers appropriately Locally, to test you can just rename one of your font swf's to fonts.php and test away. Hope this helps. - Taka On Sun, Dec 28, 2008 at 11:09 AM, Jah flash@gmail.com wrote: greetings list. the team i am on is building an AS3 site that needs to support multi languages. I'm inquiring about best practices, custom built classes/solutions, etc for dealing with runtime font loading/sharing vs. embedding... basically a font management and styling solution allowing external text. i've seen a few blog posts on the subject and was wondering if there was a general consensus as to the best approach. thanks in advance. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] custom contextual menu
Hey everyone, I'm getting an error here on this line: _customMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function() { menuItemSelected(event:ContextMenuEvent, _i:uint) } ); here is the code ... any ideas? package com.Browser { import flash.display.Sprite; import flash.events.ContextMenuEvent; import flash.net.URLRequest; import flash.net.navigateToURL; import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; public class ContextualMenu extends Sprite { private var _menuItemLabels:Array = [Google, Yahoo, Ask]; private var _menuItemURLs:Array = [http://www.google.com;, http://www.yahoo.com;, http://www.ask.com;]; private var _contextualMenu:ContextMenu; public function ContextualMenu() { _contextualMenu = new ContextMenu(); _contextualMenu.hideBuiltInItems(); for (var _i:uint = 0; _i _menuItemLabels.length; _i++) { var _customMenuItem:ContextMenuItem = new ContextMenuItem(_menuItemLabels[_i]); _customMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function() { menuItemSelected(event:ContextMenuEvent, _i:uint) } ); _contextualMenu.customItems.push(_customMenuItem); } this.contextMenu = _contextualMenu; } private function menuItemSelected(evt:ContextMenuEvent, URLArrayPosition:uint):void { var _req:URLRequest = new URLRequest(_menuItemURLs[URLArrayPosition]); navigateToURL(_req, '_blank'); } } } -- Click to become a master chef, own a restaurant and make millions. http://tagline.hushmail.com/fc/PnY6qxtWo9EITXxhgoD6rzH9gpAnEse9ndywh4dJme1GA94J7kAGr/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AS3: Dispatching events to further listeners ...
You may need to look at: stopPropagation() and stopImmediatePropagation() Could also have to do with event bubbling, and what phase these events are firing at. Here is a link to get you started: http://www.flashscript.biz/flashas3/eventbubble/event_bubbling_2.html Also, I suggest tracing out the events and looking at all values, ie: public function mouseHandler(me:MouseEvent = null):void { trace(mouseHandler(me:MouseEvent = : + me); } (Note: the '= null' I've thrown into this function is a little trick that allows you to fire the function without a mouse event - can come in very handy). Good Luck, SF. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders