[flexcoders] Flex builder problems
I am using Flex Builder 3.0.2 and 3 things that use to work do not anymore 1- Outline window is always empty 2- No intellisense. 3- Double clicking or right click - Go To on an error in the Problem Window does not go to the error line in the source How these can be fixed? Thanks
[flexcoders] UITextField alignment question
I need to place a text in a ActionScript 3 project. The supplied X and Y is left and baseline coordinates. I use UITextField and subtracted its baselinePosition from Y. This places the text very close to where it should be vertically but not the exact location (text displayed a little higher). Horizontal position is not accurate neither and text is positioned a little to the right of supplied X. I could not find any property in UITextField or TextFormat to correct this. Any idea? Thanks
[flexcoders] Re: UITextField alignment question
Thanks for the quick reply. I am not counting for the 2 pixels. Are the pixels always there even if no border is drawn? Is it always 2 pixels? --- In flexcoders@yahoogroups.com, Daniel Freiman freima...@... wrote: Are you accounting for the 2 pixel border of the textfield? - Daniel Freiman On Wed, Jul 1, 2009 at 10:10 AM, ACasualObserver pof...@... wrote: I need to place a text in a ActionScript 3 project. The supplied X and Y is left and baseline coordinates. I use UITextField and subtracted its baselinePosition from Y. This places the text very close to where it should be vertically but not the exact location (text displayed a little higher). Horizontal position is not accurate neither and text is positioned a little to the right of supplied X. I could not find any property in UITextField or TextFormat to correct this. Any idea? Thanks
[flexcoders] Re: UITextField alignment question
Thanks. This solved my problem. You saved me hours of work. --- In flexcoders@yahoogroups.com, Daniel Freiman freima...@... wrote: Yeah (subject to scaling/transform/etc), see http://livedocs.adobe.com/flex/3/langref/flash/text/TextLineMetrics.html On Wed, Jul 1, 2009 at 11:11 AM, ACasualObserver pof...@... wrote: Thanks for the quick reply. I am not counting for the 2 pixels. Are the pixels always there even if no border is drawn? Is it always 2 pixels?
[flexcoders] Re: 2 Questions abot TextField in ActionScript
Thanks. I want halo as it appears on the Figure A on http://articles.techrepublic.com.com/5100-10878_11-6118091.html
[flexcoders] Re: 2 Questions abot TextField in ActionScript
Thanks, Gordon. 1- I would like to text translucent not its background. 2- I use TextField to put a text on the stage. I would like to be able to add halo to the text. This text is not part of UI. It is used to annotate the drawing.
[flexcoders] 2 Questions abot TextField in ActionScript
1- Is it possible to create a translucent TextField (or whatever class that can be added to a DisplayObjectContainer to display) ? How? 2- The same question about a text with halo? Thanks
[flexcoders] Re: I am so confused about the coordinate and transformation in AS 3
Thanks, Alex. This was very useful. In reality, we have more than one S. All are added to Stage. we added another Sprite and add them between all those S and Stage and it is working so far. All the mouse events work except the fact that we don't get the top part (zoom in, zoom out, etc.) of the context menu when right click. Our other question is what changes the default zoom in in context menu makes in what object in the display tree? Thanks again --- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote: Don't know which other learning material to point you to, but the ASDoc for Stage says that you shouldn't set the transform so it is likely that setting parts of the transform may not work either. Sounds like transforming S is working as expected as far as visuals are concerned. When I have an interactivity problem, I next look at the interactivity properties like buttonMode, mouseEnabled and mouseChildren. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui
[flexcoders] I am so confused about the coordinate and transformation in AS 3
We have crated a subclass of Sprite (let's call it S) and added it to the stage. Then we added another Sprite that draws polygon (P) and a TextField (T) to S. If we get the stage.transform.matrix, scales it, and put it back, P scales correctly but T stays at the same location. If we get the S.transform.matrix, scales it, and put it back, everything scales correctly. The problem is that if we right click on an area that use to be empty before scale but no empty now, we don't get the context menu. I have no logical explanation mostly due to lack of experience with AS 3. Any help is appreciated. If there is book or online article with in depth explanation would be very helpful. I have learned AS 3 by reading AS 3 Cookbook by O'Reilly and Flex Builder help docs. Any other suggestion for learning material?
[flexcoders] How does the build in zoom in in context menu works?
In AS3, I have added 2-3 levels (by level, I mean sprites are added as child of other one) of sprite on the stage. Everything is displayed nicely in the right place. When I right click and select Zoom In it zooms. Then when I right click and select View All it does not show it all and the bottom right corner graphic is off the Flash viewer. I don't know why. Any idea? To investigate stage down to lowest sprite to see what zoom in has changed. I could not see anything change after zoom in including scaleX, scaleY, and transform.matrix. My question is variables are changed as a result of Zoom In? Thanks
[flexcoders] Mouse event capture by a lower level sprite
We have added two sprites to the stage that are just containers for other sprite. Let's call them S1 and S2. S1 is displayed on top of S2. We want children of S1 not to capture mouse events (which should be easy) but the children of S2 to capture mouse events even if they are behind the children of S1. Is there any way to do this? Thanks
[flexcoders] How to zoom and pan everything in Stage
We have an Actionscript 3 application that adds several Layers (Sprite subclass) to the Stage and each of these layers other sprites that represent graphical elements. We need to implement zoom in, zoom out, and pan. What we need to do to make all the graphical elements to zoom and pan? Thanks
[flexcoders] Re: Reading compressed file in AS 3
I tried it in AIR with no success. I used both DEFLATE and ZLIB arguments. To test, I created a SVG string (instead of plain XML) in my code and used the same function to compress it. Adobe SVG viewer could display it so the compression part is fine. Is there any open source compression C/C++ Windows library which can compress in such a way that ByteArray:uncompress can uncompress? Thanks --- In flexcoders@yahoogroups.com, David Adams dpad...@... wrote: On Fri, Feb 27, 2009 at 12:42 PM, ACasualObserver pof...@... wrote: Jim, I am using the zlib in a C program. Just as an experiment, have you tried putting the code into an AIR application where you can specify a wider range of decompression methods? I'm struggling with the same error you've described using a zlib compressor. I've found that I _can_ decompress the ByteArray in an AIR app with code like the following, where ba contains my zipped data: ba.uncompress(CompressionAlgorithm.DEFLATE) I actually find this a bit confusing as my understanding is that Flex handles deflate...so I'm unclear what I'm doing/not doing in Flex that makes the compression fail. I've really got the same code - apart from the CompressionAlgorithm argument. Anyway, it's something else for you to try...not that I know what the results mean ;-) Perhaps someone else can offer a suggestion as to what this particular finding means. (I'm new to Flex.) For background, what I'm trying to experiment with is compressing XML on the server-side and decompressing it on the client-side to see if I can improve performance. If anyone has thoughts or suggestions on this topic, I'm all ears. (AMF is not supported on the server I'm using, so AMF-over-HTTP is not an option.) - David Adams dpad...@... AU: (02) 6493-3250 US: 831 621-4585 Wallaga Lake 2546 NSW -
[flexcoders] Re: Reading compressed file in AS 3
It works now. I changed my C++ code. Instead of using gzopen, gzwrite, and gzclose functions is zlib, I used compress2 in zlib and write the compressed data using fopen, fwrite, and fclose. Thanks for all the help.
[flexcoders] Reading compressed file in AS 3
I have a program that create an XML string and write it to a file using either regular file function or zlib file function to create compressed file. This is done on the server. On the client, I can read and process the uncompressed file in an AS3 application using URLLoader and URLRequest. I have problem doing the same with compressed file. The code copies the data correctly to a ByteArray but uncompress method gives Error #2058: There was an error decompressing the data. What can be wrong and what is the solution. In case it is useful, the first 16 bytes of the file in HEX are: 1F 8B 08 00 00 00 00 00 00 0B CC BC 67 AF F4 CC They match the first 16 bytes of the ByteArray. Thanks.
[flexcoders] Re: Reading compressed file in AS 3
Thanks for the quick response. Both my server and client are Windows. Actually they are the same machine!!! I will try the checksum tomorrow but I checked number of bytes that are both the same. Another test I did was to send the uncompressed file and read into a ByteArray. When I compress the ByteArray on the sever, the result is 13 bytes larger than the compressed file. Compressed files is over 88,000 bytes. I create the compressed file by calling gzopen. I use wb9 for the mode. Should I used another mode? Thanks. --- In flexcoders@yahoogroups.com, Maciek Sakrejda msakre...@... wrote: What are the other bytes ;) ? I've run into some issues working with low-level bit-twiddling before (only on Linux, but that still may be indicative of larger problems). For example, in FP9 on Linux, sending a payload with a POST URLRequest truncates the payload data at the first 0x00 byte (!). On FP10 in Linux, that seems to have been fixed, but I'm getting a different error that I have not yet tracked down. I'm not sure if your issue is related, but I'd make sure your data makes it to the client okay before you try to decompress it. E.g., can you compute a checksum for both client and server and compare? -- Maciek Sakrejda Truviso, Inc. http://www.truviso.com
[flexcoders] Re: Reading compressed file in AS 3
Jim, I am using the zlib in a C program. Alex, The file passed t AS3 is not zip file. Thanks. --- In flexcoders@yahoogroups.com, Jim Cheng li...@... wrote: I'm assuming you're using PHP based upon gzopen. From reading the zlib library documentation, you'll want to use the gzcompress function instead of gzopen to compress your string into the zlib data format (which corresponds to ByteArray's compress/uncompress methods). Note that gzopen uses a slightly different data format, gzip, which is based upon, but incompatible with zlib. This likely accounts for the slight difference in file size and your inability to decompress the file on the Flex side of things. Hope this helps, Jim ACasualObserver wrote: I create the compressed file by calling gzopen. I use wb9 for the mode. Should I used another mode?
[flexcoders] Re: Adding the same mask to several Sprites
I found a solution. If I create a new instance of MYSprite and sets its components property to the same components of another MySprite instance, both can be as mask for different display objects. --- In flexcoders@yahoogroups.com, ACasualObserver pof...@... wrote: Thanks for the quick response, Ryan. The sprite has an array of a MyArea class we created. MyArea class has an array of vertexes. The draw method of the sprite calls the draw method of each of MyArea instances in the array. mySprite | - components | - myArea1 | - myArea2 | - myArea3
[flexcoders] Adding the same mask to several Sprites
In AS3, I created 3 sprites (S1, S2, and S3). I would like to do the following: S1.mask = S3; S2.mask = S3; The result is that mask is only applied to S2. If I remove the second line, it is applied to S1. It seems that setting the mask of S2 to S3 removes S3 as mask of S1. Is there a solution for this? Recreating S3 from scratch is not possible in my app but if there was a way to copy/clone it, it would work. Thanks in advance.
[flexcoders] Re: Adding the same mask to several Sprites
Thanks for the quick response, Ryan. The sprite has an array of a MyArea class we created. MyArea class has an array of vertexes. The draw method of the sprite calls the draw method of each of MyArea instances in the array. mySprite | - components | - myArea1 | - myArea2 | - myArea3 --- In flexcoders@yahoogroups.com, Ryan Graham ryan.gra...@... wrote: That is the standard behavior for masks in the framework. Can you provide a little more info on what type of display object your mask is? That would help us make suggestions for replicating the mask, or an object close enough (e.g. a rectangular display object would be much easier to clone/fake than an object with a more organic shape). HTH, Ryan From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of ACasualObserver Sent: Wednesday, January 21, 2009 3:54 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Adding the same mask to several Sprites In AS3, I created 3 sprites (S1, S2, and S3). I would like to do the following: S1.mask = S3; S2.mask = S3; The result is that mask is only applied to S2. If I remove the second line, it is applied to S1. It seems that setting the mask of S2 to S3 removes S3 as mask of S1. Is there a solution for this? Recreating S3 from scratch is not possible in my app but if there was a way to copy/clone it, it would work. Thanks in advance. This message is private and confidential. If you have received it in error, please notify the sender and remove it from your system.
[flexcoders] Accessing the main class
I am creating an AS3 application. The mail file has some thing like this: package { import ...; public class myClass extends Sprite { public function svg() { } } } I also have other classes that will be created by myClass or other classes. Is there anyway that I can calls methods in myClass? In other word, is myClass instance globally available? Thanks
[flexcoders] Calculating a DisplayObject.transfor.matrix
I have created an ActionScript project to draw some graphics. The bounding box of graphic and the graphic data is read from an XML on the server. The SWF size is the default 500x375. I use the graphic bounding box and stageHeight/stageWidth to calculate DisplayObject.transfor.matrix to best fit the graphic on the stage. When the width and height of the OBJECT in HTML is 500x375 (original size), the graphic is perfectly fit. When anything else is used for OBJECT's width and height, the graphic is not fit to the stage. Any idea? TIA