Re: [Flashcoders] Re: Flushing Socket data when TCP-connection suspends and then resumes

2011-05-26 Thread Alexander Farber
, Alexander Farber alexander.far...@gmail.com wrote: Nevermind, found 1 issue in my server... _ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

[Flashcoders] Flushing Socket data when TCP-connection suspends and then resumes

2011-05-19 Thread Alexander Farber
Hello, I have a small Facebook game sending urlencoded strings over Socket connection: _socket.writeUTF(_dataVars.toString()); _socket.flush(); It works mostly well since several years. I.e. I don't have the usual newbie problems with missing socket policy or sending data before

[Flashcoders] Re: Flushing Socket data when TCP-connection suspends and then resumes

2011-05-19 Thread Alexander Farber
Nevermind, found 1 issue in my server... ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

[Flashcoders] Why is URLStream.connected always true?

2011-04-06 Thread Alexander Farber
Hello flashcoders, does anybody please know, why is URLStream.connected is always true in my simple test program at http://stackoverflow.com/questions/5571175/why-is-urlstream-connected-always-true ? Thank you Alex ___ Flashcoders mailing list

[Flashcoders] Set HTTP cookies with navigateToURL()

2010-11-13 Thread Alexander Farber
Hello, I have a small multiplayer Flash game in which you can display a player profile by clicking at his or her avatar: const PROFILE_URL:String = 'http://myserver/user.php?id='; try { navigateToURL(new URLRequest(PROFILE_URL+id), '_blank'); } catch(e:Error) { } This works well, but now I'd

[Flashcoders] mod_socket_policy: Apache module for serving socket policy file

2010-10-26 Thread Alexander Farber
Hello, I'd like to send a short note about my Apache module for serving socket policy file in a more effective and secure way than many current scripts on the net do: It can't be blocked by a slow/malicious client, runs with reduced privilleges (as apache, www, nobody, YMMV) and doesn't read any

[Flashcoders] Call to a possibly undefined method inflate through a reference with static type flash.utils:ByteArray

2010-10-03 Thread Alexander Farber
Hello, I'm trying to compress XML data being exchanged via Socket with a Perl backend and after taking several hurdles, I'm stuck at this error message: 1061: Call to a possibly undefined method inflate through a reference with static type flash.utils:ByteArray. My code is:

Re: [Flashcoders] Call to a possibly undefined method inflate through a reference with static type flash.utils:ByteArray

2010-10-03 Thread Alexander Farber
On Sun, Oct 3, 2010 at 6:27 PM, Dave Watts dwa...@figleaf.com wrote: In your code, if there's nothing to read, your exception handlers fall through after calling handleTcpError. At compile time, the compiler has no guarantee that there'll be anything in the byte array. Thanks Dave, you're

Re: [Flashcoders] Call to a possibly undefined method inflate through a reference with static type flash.utils:ByteArray

2010-10-03 Thread Alexander Farber
I've even added 2 checks for the _nbytes being 0 and a check for _bytes != null and still it fails with 1061: Call to a possibly undefined method inflate through a reference with static type flash.utils:ByteArray. (ok, I understand that by static compiler means _bytes being null) My

Re: [Flashcoders] Call to a possibly undefined method inflate through a reference with static type flash.utils:ByteArray

2010-10-03 Thread Alexander Farber
On Sun, Oct 3, 2010 at 7:44 PM, Henrik Andersson he...@henke37.cjb.net wrote: Dave Watts skriver: In your code, if there's nothing to read, your exception handlers fall through after calling handleTcpError. At compile time, the compiler has no guarantee that there'll be anything in the byte

Re: [Flashcoders] Call to a possibly undefined method inflate through a reference with static type flash.utils:ByteArray

2010-10-03 Thread Alexander Farber
Bingo, Tom - On Sun, Oct 3, 2010 at 8:14 PM, Tom Gooding t...@quickthinkmedia.co.uk wrote: It looks to me like your compiler error is due to a call to _bytes.inflate() where the compiler detects that inflate() is not a method of the ByteArray class, I think it was added in later player

[Flashcoders] fl.controls.Label.textField.textColor not working

2010-09-21 Thread Alexander Farber
Hello, does anybody please know, why I can only set the background color here? var _label:Label = new Label(); _label.text = 'should be red'; _label.textField.background = true; _label.textField.backgroundColor = 0x00FF00; _label.textField.textColor = 0xFF;

Re: [Flashcoders] fl.controls.Label.textField.textColor not working

2010-09-21 Thread Alexander Farber
Thanks, but - On Tue, Sep 21, 2010 at 11:36 AM, Karl DeSaulniers k...@designdrumm.com wrote: Have you tried setting the text color before the background color? I think you were assigning your text to _label not _label.textField. Is this what you wanted? Try    var _label:Label = new

Re: [Flashcoders] fl.controls.Label.textField.textColor not working

2010-09-21 Thread Alexander Farber
Unfortunately there is no html property, and even this is not working: var _label:Label = new Label(); _label.textField.background = true; _label.textField.backgroundColor = 0x00FF00; _label.textField.textColor = 0xFF; _label.textField.text = should be red; _label.textField.htmlText = should

Re: [Flashcoders] fl.controls.Label.textField.textColor not working

2010-09-21 Thread Alexander Farber
Nope :-) On Tue, Sep 21, 2010 at 11:57 AM, Karl DeSaulniers k...@designdrumm.com wrote: _label.label = 'should be red'; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] fl.controls.Label.textField.textColor not working

2010-09-21 Thread Alexander Farber
Thank you Kenneth, this explains what probably happens beneath the hood On Tue, Sep 21, 2010 at 1:16 PM, Kenneth Kawamoto kennethkawam...@gmail.com wrote: If you cancel the TextFormat you should be able to apply textColor, i.e. _label.setStyle(textFormat, new TextFormat(null, null, null));

Re: [Flashcoders] Custom cellRenderer for a List with XML data

2010-09-16 Thread Alexander Farber
Hello, On Wed, Sep 15, 2010 at 10:53 PM, Kerry Thompson al...@cyberiantiger.biz wrote: What you really want is something like this: games      game id=0/      game id=9012        user id=OK10218913103 name=Yervand/      /game      game id=9013        user id=OK305894249541 name=chabo/   

[Flashcoders] Creating sliding panel with a TransitionManager.start

2010-09-16 Thread Alexander Farber
Hello, I've created a MovieClip _rect and have placed several components on it and packed that alltogether inside a class which extends Sprite. I would like that stuff to slide in and out of screen and so I've added: public function hidePanel():void {

Re: [Flashcoders] Custom cellRenderer for a List with XML data

2010-09-16 Thread Alexander Farber
It's a List (AS3 Flash component). Thanks, I've ended up creating an Array and filling it with XML data: private var _allDP:DataProvider = new DataProvider(); for each (var game:XML in xlist) { var obj:Object = { id: ga...@id, xml: game, len: game.elements('user').length() };

Re: [Flashcoders] Custom cellRenderer for a List with XML data

2010-09-15 Thread Alexander Farber
Hello Kerry and others, Alexander Farber wrote: http://stackoverflow.com/questions/3709172/custom-cellrenderer-for-a-list-with-xml-data thank you, I've traced the set data in debugger and its d argument is really an Object, not XML. Flash seemingly will go through all the 1st level children

[Flashcoders] Custom cellRenderer for a List with XML data

2010-09-14 Thread Alexander Farber
Hello, I can't figure out, how to feed data to a List cellRenderer if it is in XML format. What argument will set data() receive? In the trace output I only see, that it is an object. I have prepared a simple test case demonstrating my problem (and posted a copy and screenshot at

Re: [Flashcoders] E4X question: counting number of subnodes

2010-08-26 Thread Alexander Farber
Hello fellow flashcoders, I'm still struggling with my e4x problem. With Kenneth's help I've got it partly working for the cases where each game has at least 1 user node: var games:XML = games game user/ user/ user/ /game game user/ user/

Re: [Flashcoders] E4X question: counting number of subnodes

2010-08-26 Thread Alexander Farber
Thank you for the pointers, I'll read up on child() and attribute() - I've missed them in the docs somehow ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] E4X question: counting number of subnodes

2010-08-23 Thread Alexander Farber
Hello Kenneth and others, On Thu, Aug 19, 2010 at 9:05 PM, Kenneth Kawamoto kennethkawam...@gmail.com wrote: trace(Full games: + games.game.(user.length() == 3).length()); trace(Vacant games: + games.game.(user.length() 3).length()); thank you - now my Flash code is working, but my Flex

Re: [Flashcoders] pdf encoders

2010-08-23 Thread Alexander Farber
Maybe script it with Openoffice? On 8/20/10, Glen Pike postmas...@glenpike.co.uk wrote: Hi, Never tried it, but what about Zend_Pdf? Glen Anthony Pace wrote: I am sending this here just cause I think it's likely some developers here have had to work with PDF output. I know

[Flashcoders] E4X question: counting number of subnodes

2010-08-19 Thread Alexander Farber
Hello, my server delivers XML data over socket, representing games, with up to 3 players in each. In my custom component I'd like to display a summary: total number of games, number of full games (3 players) number of vacant games (joinable, because less than 3 players). I've prepared a reduced

[Flashcoders] Re: Flex3: attaching assets from .swf using getDefinitionByName

2010-03-25 Thread Alexander Farber
I've prepared an even simpler test case and it still doesn't work: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=onCreationComplete(); mx:Script ![CDATA[ [Embed('../assets/symbols.swf',

Re: [Flashcoders] Re: Flex3: attaching assets from .swf using getDefinitionByName

2010-03-25 Thread Alexander Farber
On Thu, Mar 25, 2010 at 2:18 PM, Glen Pike g...@engineeredarts.co.uk wrote: I think you have to instanciate the SPADES if you do it in Actionscript try this: spriteHolder.addChild(new SPADES() as DisplayObject); Yes, spriteHolder.addChild(new Symbols.SPADES()) works, thank you (found it an 1h

[Flashcoders] Flex3: attaching assets from .swf using getDefinitionByName

2010-03-24 Thread Alexander Farber
Hello, may I ask another Flex question here? (the Yahoo flexcoders-list seems not to be very responsive, asked a question 4h ago there, it still hasn't appeared) I've prepared a short test case to demonstrate my problem: Test.mxml: ?xml version=1.0 encoding=utf-8? mx:Application

[Flashcoders] Flex3: how to refer the child canvas of a TabNavigator

2010-03-21 Thread Alexander Farber
Hello, not sure if Flex questions are allowed here? Why can't I refer to the tabs.table.spriteHolder.addChild(sprite); below? If I remove the TabNavigator and all Canvases, then spriteHolder.addChild(sprite); will work just fine: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;

[Flashcoders] Flex 3 newbie: how to use Sprite's, how to find parent's dimensions

2010-03-20 Thread Alexander Farber
Hello, I'd like to port a game of mine to a Flex app, because I'd like to use tabs, controls and charts. I'm reading the docs for already a week, there are lots of them and well explained. But what do I do with my Sprites? My app consists mostly of Sprites, for example user avatars with names+

Re: [Flashcoders] Flex 3 newbie: how to use Sprite's, how to find parent's dimensions

2010-03-20 Thread Alexander Farber
Thank you for the explanations and - On Sat, Mar 20, 2010 at 7:04 PM, Chris zomgfore...@gmail.com wrote: http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_advanced_2.html I've started to read it. But maybe someone can give me a start: If I have a Canvas in Flex:

Re: [Flashcoders] How to remove bytes from the beginning of a ByteArray?

2010-02-24 Thread Alexander Farber
In my desperation I've asked the same question in a german and a russian forum last night. And where do I find the useful replies in the morning? This mailing list is priceles :-) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

[Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Alexander Farber
Hello, I have multiplayer game, which reads XML data from the server: _socket = new Socket(); _socket.addEventListener(ProgressEvent.SOCKET_DATA, handleTcpData); . private function handleTcpData(event:Event):void { while (_socket.bytesAvailable) { var str:String =

Re: [Flashcoders] An event when a Sprite's visible changes?

2010-02-23 Thread Alexander Farber
Thank you! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Alexander Farber
Hello, On Tue, Feb 23, 2010 at 2:25 PM, Henrik Andersson he...@henke37.cjb.net wrote: Doing anything but copying the data from the event to your own bytearray buffer object is a disaster waiting to happen. TCP is a stream based protocol, you can get chunks of any length each time the event

Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Alexander Farber
I've come up with this, but still have a flaw there: private function handleTcpData(event:Event):void { var len:uint; if (0 == _socket.bytesAvailable) return; try { _socket.readBytes(_ba, _ba.bytesAvailable,

Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Alexander Farber
I've added some traces there and see that this doesn't work: if (_ba.bytesAvailable = len) { var str:String = _ba.readUTFBytes(len); updateGUI(str); // copy the remaining bytes

Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Alexander Farber
Yes, that's with what I had started and what doesn't work :-) On Tue, Feb 23, 2010 at 11:17 PM, Valentin Schmidt v...@dasdeck.com wrote: private function handleTcpData(event:Event):void {  if(_socket.bytesAvailable) {    try{      var str:String = _socket.readUTF();      updateGUI(str);    

Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Alexander Farber
Hello Valentin, On Wed, Feb 24, 2010 at 12:06 AM, Valentin Schmidt v...@dasdeck.com wrote: so then why did you start with posting code here (pasted below) that didn't contain any exception catching? that's the crucial point: you have to catch the exception, otherwise you would either get

[Flashcoders] How to remove bytes from the beginning of a ByteArray?

2010-02-23 Thread Alexander Farber
Hello, sorry, but I'll try to start another thread to explain my problem. I read data from a socket into a ByteArray _ba and keep inspecting it. When there is enough data, I'd like to extract and process it and remove the processed bytes from the _ba. Here is how I try to do the removal, but it

Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Alexander Farber
On Wed, Feb 24, 2010 at 12:36 AM, Valentin Schmidt v...@dasdeck.com wrote: And if you use an if instead of while, then you lose even more incoming data. how come? Ok, here your suggestion again: private function handleTcpData(event:Event):void { if(_socket.bytesAvailable) { // USE IF, NOT

Re: [Flashcoders] bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

2010-02-23 Thread Alexander Farber
After some thought... the 2nd case (not enough data arrived) is not a problem for your code, because the handleTcpData() will get called again - once the rest of the data arrived. But for the 1st case (several UTF strings arrived at once)... Maybe I should try the following (and don't need a

[Flashcoders] An event when a Sprite's visible changes?

2010-02-21 Thread Alexander Farber
Is there please an AS3-event broadcasted when a Sprite is shown or hidden? Can't find this in the docs Thank you Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

[Flashcoders] Detecting if full screen mode is allowed before setting it

2010-02-17 Thread Alexander Farber
Hello, is it possible to detect, if a full screen mode is allowed before calling stage.displayState = StageDisplayState.FULL_SCREEN; ? I have the same .swf file embedded at several sites including Facebook (and there for some reason you can't do full screen unless using their iframe mode. My

Re: [Flashcoders] Detecting if full screen mode is allowed before setting it

2010-02-17 Thread Alexander Farber
On Wed, Feb 17, 2010 at 3:10 PM, Juan Pablo Califano califa010.flashcod...@gmail.com wrote: I'm not sure if there's a clean way, but I'm afraid the ugly way won't work either. If I recall correctly, you can't set the displayState to fullscreen unless you're responding to user interaction (i.e.

[Flashcoders] Creating a XMLList in the source code

2010-02-10 Thread Alexander Farber
Sorry for one more probably basic XML question, but how do you create an XMLList object? I've tried: var list:XMLList = user pos=0 money=123 changed=2 pool=10.20.30 whist1=10.20 whist2=100 / user pos=2 money=-123 changed=4 mount=1.2.3 whist1=10.20.100.300 whist2=100 / ; var list:XMLList =

[Flashcoders] XML question with a test case

2010-02-06 Thread Alexander Farber
Hello, I've prepared a simple test case for my problem: var xml1:XML = pref lobby user id=DE2 name=Alex avatar=2_1211369175.jpg/ /lobby game id=0/ /pref; var xml2:XML = pref user0 id=DE2 name=Alex avatar=2_1211369175.jpg/

Re: [Flashcoders] XML question with a test case

2010-02-06 Thread Alexander Farber
Thank you - I'll do, but On Sat, Feb 6, 2010 at 7:01 PM, Juan Pablo Califano califa010.flashcod...@gmail.com wrote: Because your second query returns an empty list instead of null. So, instead of checking for null, just check the length of the result. trace(describeType(xml1.lobby));

Re: [Flashcoders] XML question with a test case

2010-02-06 Thread Alexander Farber
Thank you ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] XMLList question

2010-02-03 Thread Alexander Farber
On Wed, Feb 3, 2010 at 8:07 AM, Cor c...@chello.nl wrote: I always use ![CDATA[My text]] in xml. Is that a bad habbit? Not good for my app - if the user enters ]] and then some XML ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] XMLList question

2010-02-03 Thread Alexander Farber
are an excellent way of helping us to understand. That said, the 12,000 lines of python code that you may have written several years ago doesn't mean that you can 'do' actionscript without bothering to read a book first a On Wed, Feb 3, 2010 at 8:06 AM, Alexander Farber alexander.far...@gmail.com

[Flashcoders] Joining XMLList elements

2010-02-03 Thread Alexander Farber
Sorry, I keep reading the docs, but haven't wrapped my brain around this yet. How could I create a string of several joined chat-lines here var myxml:XML = myxml chat0XXX/chat0 chat0YYY/chat0 chat0ZZZ/chat0 /myxml; handleChat(myxml.chat0); function handleChat(list:XMLList):void {

Re: [Flashcoders] Joining XMLList elements

2010-02-03 Thread Alexander Farber
That's a cool idea, thank you On Wed, Feb 3, 2010 at 9:19 PM, Jer Brand thejhe...@gmail.com wrote: Off the wall suggestion: If you're just adding this to a HTML enabled text field (or some other HTML enabled container), you might change your tag's to p/p rather than chat0.../chat0 and add the

[Flashcoders] XMLList question

2010-02-02 Thread Alexander Farber
Hello, I'm parsing following XML: var lobby:XML = lobby info idDE2/id nameAlex/name avatar2_1211369175.jpg/avatar /info info idDE55/id nameVasja/name avatar55_1232308551.jpg/avatar /info /lobby; var _people:Array = new Array();

Re: [Flashcoders] XMLList question

2010-02-02 Thread Alexander Farber
Thank you all! And, On Wed, Feb 3, 2010 at 2:21 AM, Steven Sacks flash...@stevensacks.net wrote: As a rule, I only put string values that never contain special characters in attributes, otherwise you end up with XML validation errors (like putting ampersands in attributes). I was actually

[Flashcoders] XML + socket + gzip

2010-01-17 Thread Alexander Farber
Hello, I have an AS3/Perl/C card game which works over sockets, but also over HTTP as a fallback. For HTTP I compress the data with gzip if the browser claims to support it and it works well. My data is urlencoded and records are separated by ; This is difficult to read and maintain and I'm

[Flashcoders] Re: XML + socket + gzip

2010-01-17 Thread Alexander Farber
For gzip I've found http://code.google.com/p/ascompress/ Or maybe I can use ByteArray.compress() ? Regards Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] A 3-way FMS chat rooms

2010-01-09 Thread Alexander Farber
On Sat, Jan 9, 2010 at 2:51 AM, Nate Beck n...@tldstudio.com wrote: Programming Flash Communication Server (Brian Lesser) walks you through this exact thing.

[Flashcoders] A 3-way FMS chat rooms

2010-01-08 Thread Alexander Farber
Hello, how would you roughly implement video-chat rooms with up to 3 connected clients in a room? You would call nc.connect(roomNumner); and that argument would be available to the server side application.onConnect, correct? But what would you do next? I especially don't understand how to make

Re: [Flashcoders] A 3-way FMS chat rooms

2010-01-08 Thread Alexander Farber
Have you tried it yourself? On Fri, Jan 8, 2010 at 10:44 PM, Karl DeSaulniers k...@designdrumm.com wrote: Google FlashChat Karl On Jan 8, 2010, at 3:17 PM, Alexander Farber alexander.far...@gmail.com wrote: Hello, how would you roughly implement video-chat rooms with up to 3 connected

[Flashcoders] 64 bit integers

2010-01-04 Thread Alexander Farber
Hello, I have programmed a card game and because the game type has 32 cards I made a decision to represent each card as a bit in a uint number. That decision has made many aspects easier for me: for example, checking if a player has any cards of some suit is simply an -operation against a

[Flashcoders] Working with assets from auth. environment

2009-12-30 Thread Alexander Farber
Hello, I'm trying to move from pure AS3 MovieClips to the ones composed from auth.env. assets from the library - so that I can easier add gradients etc. But when for example doing so for text fields, I don't see any text that I add in my AS code. So I've added a defaultTextFormat setting for

Re: [Flashcoders] Working with assets from auth. environment

2009-12-30 Thread Alexander Farber
Thank you and happy new year to all subscribers :-) On Wed, Dec 30, 2009 at 4:29 PM, Glen Pike postmas...@glenpike.co.uk wrote:     Are you making sure that you embed the font in the authoring environment?   If you are using rotation / alpha or other effects on the font, you may need to make

[Flashcoders] Loading and resizing images despite wrong crossdomain.xml

2009-12-25 Thread Alexander Farber
Hello Flash-coders, I have an AS3 game hosted at my site http://preferans.de which displays resized avatars of gamers. It works ok. To attract more users, I've added support for the users of http://vkontakte.ru (the russian Facebook clone, 50 mio. users) to play at my site without additional

[Flashcoders] Re: Loading and resizing images despite wrong crossdomain.xml

2009-12-25 Thread Alexander Farber
Oh, I think I start to understand: my Event.INIT callback _is_ being called. But once it tries to access Loader.content for resizing the loaded image, then I get the SecurityError. On Fri, Dec 25, 2009 at 6:22 PM, Alexander Farber alexander.far...@gmail.com wrote: I have an AS3 game hosted

[Flashcoders] How to detect browser closure or user navigating away?

2009-11-22 Thread Alexander Farber
Hello fellow flashcoders, is there a way in AS3 to detect when the user closes the browser with your flash movie or navigates away from the web page containing it? I'd like to send short information to the server when doing so. I have a flash movie acting both as socket and HTTP client

[Flashcoders] How to test URLVariables members

2009-11-04 Thread Alexander Farber
How do you test (without warnings and errors) if a var vars:URLVariables contains something on an Event.COMPLETE? For example if there is a vars.myname set? (I.e. otherwise vars.myname would be undefined - according to http://help.adobe.com/en_US/AS3LCR/Flash_10.0/package.html#undefined )

[Flashcoders] AS3: Clicking fl.controls.Button by a key

2009-10-23 Thread Alexander Farber
Hello, I'd like to create 2 Buttons labeled and and to be able not only click them by mouse but also by pressing the left and right keyboard keys. I probably should add the stage as a key event listener, but how do I control the buttons to make them appear depressed and released? Thank you

[Flashcoders] Re: AS3: Clicking fl.controls.Button by a key

2009-10-23 Thread Alexander Farber
Ok, found the setMouseState() ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

[Flashcoders] 2.5D playing cards - how to restore original image?

2009-10-21 Thread Alexander Farber
Hello, I have a game with nice detailed playing cards (the only nice graphics in my app) which can be dragged around. On the MOUSE_DOWN event I add a shadow to filters and set scaleX = scaleY = 1.2. And on MOUSE_UP I remove shadow and set scaleX = scaleY = 1. Now I've decided to try the new

Re: [Flashcoders] Vista-like glossy SimpleButton - please help with the final touch

2009-10-18 Thread Alexander Farber
Hello all, thank you for your replies. I've added another Shape on top of my gradient and set its blendMode to BlendMode.OVERLAY and am finally satisfied with the result (except the downState - red doesn't look good there for some reason. The overlay is too bright there)... Your suggestion with

[Flashcoders] Vista-like glossy SimpleButton - please help with the final touch

2009-10-17 Thread Alexander Farber
Hello, could someone please help me with a glossy button? I think I'm missing something minor in my code (at the bottom). I have a gradient running vertically, but it's too soft - I don't know how to create the crisp line in the middle, which you see for example in this Photoshop example:

Re: [Flashcoders] Vista-like glossy SimpleButton - please help with the final touch

2009-10-17 Thread Alexander Farber
Hi Glen, On Sat, Oct 17, 2009 at 3:31 PM, Glen Pike postmas...@glenpike.co.uk wrote: The gradient overlay would be a layer on top of your button shape which had a linear gradient white fill, with alphas [...@0%, 1...@50%, 0...@51%, 1...@100%] sorry I still don't understand. Do you mean

Re: [Flashcoders] Vista-like glossy SimpleButton - please help with the final touch

2009-10-17 Thread Alexander Farber
I don't understand how to make the Photoshop overlay blending mode in ActionScript. http://www.jooria.com/Drawing-Glossy-Button-a138.html Regards Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

[Flashcoders] Calculate stringWidth() for a TextField.text

2009-10-09 Thread Alexander Farber
Hello, how do you please find out the width of a string in a TextField? I have a Sprite representing a comic bubble (my code available at http://pastebin.com/m6d9f4087 ) and use a TextField with TextFieldAutoSize.LEFT there to accomodate the text. I would like to shrink the TextField's width

Re: [Flashcoders] as3 to iphone app

2009-10-09 Thread Alexander Farber
On Thu, Oct 8, 2009 at 3:09 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: The following native device APIs and functionality are supported: MultiTouch Screen Orientation Saving images to Photo Library Accelerometer Geo-location Cut / Copy / Paste More info here:

Re: [Flashcoders] monitor outgoing http requests

2009-10-09 Thread Alexander Farber
I use WireShark ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] Calculate stringWidth() for a TextField.text

2009-10-09 Thread Alexander Farber
Hello Glen, On Fri, Oct 9, 2009 at 2:51 PM, Glen Pike g...@engineeredarts.co.uk wrote: You can get the text metrics - |flash.text.TextField.getLineMetrics()| Have a look in the docs about this class it's quite useful. Watch out for the obligatory 2px gutter around your text.. Alexander

Re: [Flashcoders] Calculate stringWidth() for a TextField.text

2009-10-09 Thread Alexander Farber
Thank you Glen, both of your replies have been helpful ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

[Flashcoders] Policy file for a socket connection

2009-09-08 Thread Alexander Farber
Hello fellow flashcoders! 1) Are wildcards allowed in policy files? When I send the following text (+ a trailing 0-byte): cross-domain-policy allow-access-from domain=*.preferans.de to-ports=8080/ allow-access-from domain=172.16.6.* to-ports=8080/ /cross-domain-policy then I get: OK:

Re: [Flashcoders] Policy file for a socket connection

2009-09-08 Thread Alexander Farber
Hello Dave, 3) And finally I'm still not clear about when policy-file-request/ + 0 byte is being sent? At the very beginning? And is the socket connection closed a reopened afterwards? Or is the connection kept opened? This is the document you want to read:

Re: [Flashcoders] Policy file for a socket connection

2009-09-08 Thread Alexander Farber
From what I see in Wireshark though, the Flash Player closes the connection after receiving the policy XML and then reopens it ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

[Flashcoders] Missing wait(), notify(), sleep() in AS3

2009-08-21 Thread Alexander Farber
Hello, I have an AS3 app which continuously send HTTP requests to a server. If there is a HTTP request in progress already and it's not important (kind of I am alive event) I would like to cancel it. But if the ongoing request is important, I'd like to wait its completion before I send another

Re: [Flashcoders] CLICK event not getting fired

2009-08-18 Thread Alexander Farber
On Tue, Aug 18, 2009 at 6:22 AM, Sajid Saiyedsajid.fl...@gmail.com wrote: I should have given a bit more background. I am trying to detect a CLICK anywhere on the (blank) stage. Only when the user clicks somewhere on stage, I want to show something. How can I do this? Do I still need to

Re: [Flashcoders] Re: Sending 2 HTTP requests from a webchat-like app

2009-08-18 Thread Alexander Farber
On Mon, Aug 17, 2009 at 10:36 AM, Mick Gmix...@gmail.com wrote: You might want to think about using something more robust like smartfoxserver so you can not have the restrictions of http requests. I've been using is on a chat/whiteboard app for a while and it's an enormous performance increase

[Flashcoders] Sending 2 HTTP requests from a webchat-like app

2009-08-16 Thread Alexander Farber
Hello, I have a Flash+Perl/C multiplayer card game which works as a web chat on its backend: my Flash app sends a HTTP request every 15 seconds to the backend Apache module or earlier - if the user submits some action. All works solid, but of course a bit sluggish, because new infos come in only

[Flashcoders] Re: Sending 2 HTTP requests from a webchat-like app

2009-08-16 Thread Alexander Farber
Ok I had to enter about:config in Firefox and increase network.http.max-persistent-connections-per-server ( - that is at my development server. At my prod. server I will use multiple hostnames) Now I'm few steps further, but any good experiences/advices on 2 HTTP requests setups (1 blocking + 1

Re: [Flashcoders] No MOUSE_UP event when dragged under another sprite

2009-07-13 Thread Alexander Farber
Thank, that was it - stage.addEventListener(...) Found a good tutorial too: http://www.flashandmath.com/basic/dragdroptour/dd_tour2.html Regards Alex On Sun, Jul 12, 2009 at 2:59 AM, Andrei Thomazandreitho...@gmail.com wrote: on mouse down, you could add a listener to stage to MOUSE_UP event,

[Flashcoders] No MOUSE_UP event when dragged under another sprite

2009-07-11 Thread Alexander Farber
Good day, I have a class representing draggable playing cards: public dynamic class Card extends Sprite { public function Card() { addEventListener(MouseEvent.MOUSE_DOWN, handleDown);

[Flashcoders] stop() not working

2009-05-24 Thread Alexander Farber
Hello, if I create a new Flash file (AS3), press F9 and enter stop(); trace(-); then it will print that line just once as expected. But if I enter: stop(); trace(-); var user:User = new User(); addChild(user); user.x = user.y = 200; user.userid = 53; user.username = 'Алекс';

Re: [Flashcoders] stop() not working

2009-05-24 Thread Alexander Farber
Thank you. Yes, I should investigate more myself. I was just hoping that maybe it's some known issue ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] AS3: for-loop in a static initializer - Access of undefined property i

2009-04-13 Thread Alexander Farber
and calling it seems a bit cleaner if you need some static initialization logic. Cheers Juan Pablo Califano 2009/4/12 Alexander Farber alexander.far...@gmail.com Hello, I have a static initializer in my class and it works ok: private static var BLACK:TextFormat = new TextFormat('Arial', 24

[Flashcoders] AS3: for-loop in a static initializer - Access of undefined property i

2009-04-12 Thread Alexander Farber
Hello, I have a static initializer in my class and it works ok: private static var BLACK:TextFormat = new TextFormat('Arial', 24, 0x00, true); private static var RED:TextFormat = new TextFormat('Arial', 24, 0xFF, true); // place 1 closer to 0 in the 10 string {

Re: [Flashcoders] AS3: for-loop in a static initializer - Access of undefined property i

2009-04-12 Thread Alexander Farber
On Sun, Apr 12, 2009 at 11:46 AM, Karl DeSaulniers k...@designdrumm.com wrote: //for (var i:uint = 0; i 10; i++) for (var i:int = 0; i 10; i++) Nope this doesn't change anything and also { var i:int; for (var i:int = 0; i 10; i++) trace(i); } won't work Regards

Re: [Flashcoders] AS3: for-loop in a static initializer - Access of undefined property i

2009-04-12 Thread Alexander Farber
Oops a typo: On Sun, Apr 12, 2009 at 11:58 AM, Alexander Farber alexander.far...@gmail.com wrote: Nope this doesn't change anything and also {      var i:int;      for (i = 0; i 10; i++)            trace(i); } won't work ___ Flashcoders

[Flashcoders] AS3: if (urlvars.bids != null) trace(urlvars.bids); still prints null?

2009-04-09 Thread Alexander Farber
Hello, does anybody please have an idea, why would this code: private function handleComplete(event:Event):void { var urlvars:URLVariables = event.target.data; .. if (urlvars.bids != null urlvars.bids != 0) { trace(urlvars.bids); .

[Flashcoders] AS3: How to check if an URLVariables contains a field?

2009-03-31 Thread Alexander Farber
Hello, I have the following function called repeatedly: private function handleComplete(event:Event):void { var urlvars:URLVariables = event.target.data; . if (urlvars.lobby) { . } else if (urlvars.bids) {

[Flashcoders] AS3: Troubles styling the List

2009-03-14 Thread Alexander Farber
Hello, I'm trying to change the font size in a fl.controls.List: private static const SMALL:TextFormat = new TextFormat('Arial', 18, 0x00); list = new List(); list.setStyle('textFormat', SMALL); but the size of the font in the List doesn't seem to change. Has

Re: [Flashcoders] advice to ms word/xml

2009-03-05 Thread Alexander Farber
vim user here (I use :set encoding=utf8) On Thu, Mar 5, 2009 at 11:54 PM, Nate Beck n...@tldstudio.com wrote: . emacs ;) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  1   2   >