[flexcoders] Performance feedback PLEASE
I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! Allan Pichler RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@gmail.com Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype:apichler Yahoo:allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler
Re: [flexcoders] Performance feedback PLEASE
105-107 FPS i7 Extreme 965 On 09/04/2010 10:51, Allan Pichler wrote: I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! *Allan Pichler* RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@gmail.com mailto:dreamc...@gmail.com Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype:apichler Yahoo:allan_pichler Facebook: www.facebook.com/apichler http://www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler http://www.linkedin.com/in/apichler
[flexcoders] applying styles to UITextfield, embeding fonts and more fun stuff
Hello fellow flexcoders. I'm stuck at a critical point while developing my application. Here's the context : A user can add and style text to a postcard (being a Canvas). The text can then be modified and rotated. The rotation is handled by a library performing well on pictures. The text is a UITextField object, the style is a TextFormat Object. Both are handled in a global container (extending the Canvas class). The fonts are embedded in a font library. On creation, it seems that the font is not loaded (the text is still shown with the usual boring police). Therefore , the font is not embedded and rotation makes the text disappear. I'm not sure what my problem exactly is, and this is why I'm calling for your help knowledge. bellow is the definition of the font library : [Bindable] public final class FontsLibrary { // public static var fontLib : Array = new Array(); doesn't work /** * The verdana font from the assets library */ [Embed(source=../assets/fonts/verdana.TTF , fontName=verdana , mimeType='application/x-font-truetype')] public static var verdana:Class; //assigning font to static attribute // public static var verdana : FontAsset = new LCVerdana (); // fontLib.push (verdana) ; . Bellow is the constructor of my text element public function LCTextElementField( AText : String = , AColor : int = -1 , ASize : int = -1) { super(); var afont : Font = new FontsLibrary.RAVIE(); this.elementText = new UITextField(); textFormat = new TextFormat(); if (AColor != -1) { this.textFormat.color = AColor ; } if (ASize != -1) { this.textFormat.size = ASize ; } else { this.textFormat.size = 30 ; } this.textFormat.font = afont.fontName; this.elementText.defaultTextFormat = textFormat ; this.elementText.embedFonts = true; this.elementText.autoSize = TextFieldAutoSize.LEFT; this.elementText.antiAliasType = AntiAliasType.ADVANCED ; if (AText == ) { this.elementText.text = Lorem ipsum dolor sit amet; } else { this.elementText.text = AText ; } this.addChild(this.elementText); } As you can see the code is pretty basic. At the moment, I set the police to RAVIE, so I can notice rapidly if the changes have been set. Any help, advice, anything would be of great use. I'm running short on ideas.
[flexcoders] Re: applying styles to UITextfield, embeding fonts and more fun stuff
problem solved using textfield and textformat objects. here are the modifications : this.elementText = new TextField(); textFormat = new TextFormat(); ... ... var conteneur : UIComponent = new UIComponent(); conteneur.addChild(this.elementText); this.addChild(conteneur); for the curious ones, a textfield must be added to a uicomponent before adding it to a canvas, as canvas only accept uicomponents. --- In flexcoders@yahoogroups.com, ouaqa abenef...@... wrote: Hello fellow flexcoders. I'm stuck at a critical point while developing my application. Here's the context : A user can add and style text to a postcard (being a Canvas). The text can then be modified and rotated. The rotation is handled by a library performing well on pictures. The text is a UITextField object, the style is a TextFormat Object. Both are handled in a global container (extending the Canvas class). The fonts are embedded in a font library. On creation, it seems that the font is not loaded (the text is still shown with the usual boring police). Therefore , the font is not embedded and rotation makes the text disappear. I'm not sure what my problem exactly is, and this is why I'm calling for your help knowledge. bellow is the definition of the font library : [Bindable] public final class FontsLibrary { //public static var fontLib : Array = new Array(); doesn't work /** * The verdana font from the assets library */ [Embed(source=../assets/fonts/verdana.TTF , fontName=verdana , mimeType='application/x-font-truetype')] public static var verdana:Class; //assigning font to static attribute //public static var verdana : FontAsset = new LCVerdana (); //fontLib.push (verdana) ; . Bellow is the constructor of my text element public function LCTextElementField( AText : String = , AColor : int = -1 , ASize : int = -1) { super(); var afont : Font = new FontsLibrary.RAVIE(); this.elementText = new UITextField(); textFormat = new TextFormat(); if (AColor != -1) { this.textFormat.color = AColor ; } if (ASize != -1) { this.textFormat.size = ASize ; } else { this.textFormat.size = 30 ; } this.textFormat.font = afont.fontName; this.elementText.defaultTextFormat = textFormat ; this.elementText.embedFonts = true; this.elementText.autoSize = TextFieldAutoSize.LEFT; this.elementText.antiAliasType = AntiAliasType.ADVANCED ; if (AText == ) { this.elementText.text = Lorem ipsum dolor sit amet; } else { this.elementText.text = AText ; } this.addChild(this.elementText); } As you can see the code is pretty basic. At the moment, I set the police to RAVIE, so I can notice rapidly if the changes have been set. Any help, advice, anything would be of great use. I'm running short on ideas.
Re: [flexcoders] Performance feedback PLEASE
Windows XP SP2 dualcore 2x2.13 Player plugin debugger (Chrome, Opera, FireFox, Safari) - 38-41 fps. Player ActiveX debugger - 38-47 fps. Standalone debugger - 36-37 fps. Player version 10.0.32 for all kinds. Best. Oleg
Re: [flexcoders] Performance feedback PLEASE
crunchbang (ubuntu) AMD Athlon(tm) 64 X2 Dual Core Processor 4600+ flashplayer 10.0.32.18 : 40-41fps great visual result thomas parquier --- http://www.web-attitude.fr/realisations/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net téléphone portable : +33601 822 056 2010/4/9 Allan Pichler dreamc...@gmail.com I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! *Allan Pichler* RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@gmail.com Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype:apichler Yahoo:allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler
Re: [flexcoders] Performance feedback PLEASE
53 fps Intel Core 2 Duo T9400 @ 2.53GHz Flash player version 10,1,51,95 On Fri, Apr 9, 2010 at 4:51 AM, Allan Pichler dreamc...@gmail.com wrote: I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! *Allan Pichler* RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@gmail.com Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype:apichler Yahoo:allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler
Re: [flexcoders] Performance feedback PLEASE
70 fps Intel Core 2 Duo @ 3Ghz flash player version 10,0,45,2 On Fri, Apr 9, 2010 at 8:27 AM, Robert VanCuren Jr robert.vancuren...@gmail.com wrote: 53 fps Intel Core 2 Duo T9400 @ 2.53GHz Flash player version 10,1,51,95 On Fri, Apr 9, 2010 at 4:51 AM, Allan Pichler dreamc...@gmail.com wrote: I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! *Allan Pichler* RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@gmail.com Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype:apichler Yahoo:allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler
[flexcoders] A Viewstack but not with Canvases
Hi, I have a complex flex app I've been building for months, most of the containers are Boxes,VBoxes, HBoxes.. now I need to have two layers: my current app(1st layer), and a videodisplay that will take the whole space(2nd layer). That would be easily done(I assume) if both of my layers were Canvas and I used a Viewstack to switch between them. But apparently the Viewstack won't work properly with Boxes... Assuming you guys got my problem, any ideas? Best regards, Leonardo C.
[flexcoders] Re: Performance feedback PLEASE
60 fps Intel Core2 Duo 2.67GHz 4 GB RAM 64-bit Windows 7 --- In flexcoders@yahoogroups.com, Allan Pichler dreamc...@... wrote: I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! Allan Pichler RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@... Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype:apichler Yahoo:allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler
[flexcoders] how to know SWF file size?
Hi, I am using mx:SWFLoader to load swf files. My question is how to know the real width and height for the swf file. Thanks Mark S
[flexcoders] With the latest eula agreement from Apple
Will adobe punch back and file a law suit against apple? This is total crap.
[flexcoders] how to make component sutomaticalllt fit container?
Hi, I want to change the container size and I hope components inside the container automatically fit to it (not scroll bar appear). Thanks Mark
Re: [flexcoders] how to know SWF file size?
Hi, Mark. Look into these: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/LoaderInfo.html#height http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/LoaderInfo.html#width Best. Oleg
[flexcoders] displaying list one at a time (flex4)
hi guys. i have a question. suppose i have 15items in a list. i want to : 1) show each item in the list one at a time (like a screensaver eg: huge font) for 4seconds 2) the entire list item should be hidden or not displayed. only one list at a time must be shown can someone tell me how to go about it? thanks in advance guys sorry im a newbie :p
RE: [flexcoders] Disappearing item renderer
I tried that, the problem is still occurring. Any other possible solutions? Thanks. To: flexcoders@yahoogroups.com From: aha...@adobe.com Date: Thu, 8 Apr 2010 22:00:12 -0700 Subject: Re: [flexcoders] Disappearing item renderer Set a minWidth/height on the renderer. On 4/8/10 6:27 PM, method_air loudj...@hotmail.com wrote: Image component items in a HorizontalList, with the 'source' set to a Bitmap are disappearing when scrolled (appears to be related to item renderer recycling). This doesn't occur when the Image source is set to a string... Is there a workaround to stop this from occurring? Thanks, Philip -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui _ http://clk.atdmt.com/UKM/go/19780/direct/01/ Do you have a story that started on Hotmail? Tell us now
[flexcoders] AS2 SWF lost function when loaded second time
Hi All, In my flex app, I loaded a AS2 swf. The AS2 swf is a document, generated by print2flash. The swf document worked great at the first time. However, if I unload it, and load another document (or load the same document again), the mouse drag function didn't work. I found a post on adobe, ActionScript 2 components may fail when loaded into an ActionScript 3 SWF. http://kb2.adobe.com/cps/000/54e2eda3.html I think it is what happen to me. But I didn't find a solution. Any ideas?
[flexcoders] Re: open source flex sdk | flex lib.swc | Missing Datavisualization.swc
Thanks Jeffry --- In flexcoders@yahoogroups.com, Jeffry Houser j...@... wrote: To get the charting classes [in Flex 3] you needed to purchase Flex Builder Pro. They have been open sourced as of the release of Flex 4 / Flash Builder 4. I have no idea how that relates to 'legacy' licenses; but in theory you can download the code and compile it with the Flex 3.4 SDK and use that in your project. --- In flexcoders@yahoogroups.com, ilikeflex ilikeflex@ wrote: Hi I am using the open source flex sdk build Version 3.4.0 build 9271 . At the same time i am using flexlib.swc from google code base. the flexlib.swc requires access to charting compoenents classes. The charting classes are normally in datavisualization.swc. This file is missing from open source. how can i create this file or from where can i get it. Thanks ilikeflex
Re: [flexcoders] FlashBuilder 4 Linux Released!
u can download the fb4linux from :http://code.google.com/p/fb4linux/ 闲云孤鹤 - 清冷香中抱膝吟 On Fri, Apr 9, 2010 at 12:44 AM, Joe Cabezas joe.cabe...@gmail.com wrote: where i can get this?, adobe trials page not yet :/ 2010/4/8 feiy eshang...@gmail.com hi,now *FB4Linux is Platform independent,and can work with i386 x64.don't need the ia32 java in x64 system.* enjoy it! 闲云孤鹤 - 清冷香中抱膝吟 On Mon, Mar 29, 2010 at 8:14 PM, Guillaume Aveline gavel...@pikko-software.com wrote: Le 29/03/2010 12:47, Tom Chiverton a écrit : On Thursday 25 Mar 2010, feiy wrote: base the office released FlashBuilder4 2010/03/23. more info: All the links except the GoogleCode one are dead, and I doubt the legal situation has been cleared up ? quote : port the Adobe Flash Builder 4 to Linux this is not a official version. -- Helping to efficiently harvest attention-grabbing portals as part of the IT team of the year 2010, '09 and '08 This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.Halliwells.com. -- *Guillaume Aveline* Ingénieur développement *www.Pikko-Software.com*
Re: [flexcoders] displaying list one at a time (flex4)
Hello, You can use a viewstack : only one element is visible at a time, some effects can be added for transitions. have a good day, thomas parquier --- http://www.web-attitude.fr/realisations/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net téléphone portable : +33601 822 056 2010/4/9 James Dean ew6...@yahoo.com hi guys. i have a question. suppose i have 15items in a list. i want to : 1) show each item in the list one at a time (like a screensaver eg: huge font) for 4seconds 2) the entire list item should be hidden or not displayed. only one list at a time must be shown can someone tell me how to go about it? thanks in advance guys sorry im a newbie :p
Re: [flexcoders] Re: Performance feedback PLEASE
Some figures: Mac Pro 2008, 8 cores @ 2.8Ghz; NVidia 8800 GT. Under flash 10.0 : ~23fps Under flash 10.1 : ~46fps Here's the kicker On the same machine, running Windows in VMWare fusion in a window : Under flash 10.0 : ~64fps Yep. That's right. It's much quicker in a Windows VM. Little wonder Apple has such distaste for Adobe these days. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Allan Pichler dreamc...@... wrote: I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! Allan Pichler RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@... Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype: apichler Yahoo: allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler
RE: [flexcoders] With the latest eula agreement from Apple
I love my MacBook Pro, and related Apple products, but Steve Jobs is really starting to piss me off. Apparently this 'restriction' is not being applied evenhandedly across the boards with other similar packaging tools. I am sure that Flash being integrated with Chrome isn't helping things either. But in Steve's world, it's his way or the highway. And then to invoke the Open Standards criticism of Flash becomes even more disingenuous that before. Open standards my a**, this is just plain and simple cutthroat competition. And the timing - the timing of this given the imminent release of CS5 - you'd think that if he was going to do this he should have done it a year or more ago. It's not like he didn't know that this capability was being developed. This smacks of anti-competitive practices and I for one hope something can (and will) be done about it. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Patrick Sent: Friday, April 09, 2010 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] With the latest eula agreement from Apple Will adobe punch back and file a law suit against apple? This is total crap. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Grid | colspan | how to change dynamically
hi See the code below. On button click i want to change the grid's row 2. But the colspan does not change. I have tried all kind of invalidate... methods. How can this be done.Any pointers... Thanks ilikeflex mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Grid id=myGrid !-- Define Row 1. -- mx:GridRow id=row1 !-- Define the first cell of Row 1. -- mx:GridItem mx:Button label=Button 1/ /mx:GridItem !-- Define the second cell of Row 1. -- mx:GridItem mx:Button label=2/ /mx:GridItem !-- Define the third cell of Row 1. -- mx:GridItem mx:Button label=Button 3/ /mx:GridItem /mx:GridRow !-- Define Row 2. -- mx:GridRow id=row2 !-- Define a single cell to span three columns of Row 2. -- mx:GridItem colSpan=3 horizontalAlign=center id=dridItemtest mx:Button label=Long-Named Button 4/ /mx:GridItem /mx:GridRow !-- Define Row 3. -- mx:GridRow id=row3 !-- Define an empty first cell of Row 3. -- mx:GridItem/ !-- Define a cell to span columns 2 and 3 of Row 3. -- mx:GridItem colSpan=2 horizontalAlign=center mx:Button label=Button 5/ /mx:GridItem /mx:GridRow /mx:Grid mx:Button label=Test click=onClick()/ mx:Script ![CDATA[ public function onClick(){ dridItemtest.colSpan = 1; dridItemtest.validateDisplayList(); dridItemtest.validateProperties(); //myGrid.validateDisplayList(); //myGrid.validateProperties(); } ]] /mx:Script /mx:Application
[flexcoders] Re: A Viewstack but not with Canvases
Hi Leonardo, ViewStack requires its children to be a Container, or subclass of Container. Box, HBox and VBox all extend Container and should work just fine. Besides, you're talking about adding a sibling to your current app. So, you could wrap the code for your current app into any Container; the children don't matter. -TH --- In flexcoders@yahoogroups.com, Leonardo Camargo camargoleona...@... wrote: Hi, I have a complex flex app I've been building for months, most of the containers are Boxes,VBoxes, HBoxes.. now I need to have two layers: my current app(1st layer), and a videodisplay that will take the whole space(2nd layer). That would be easily done(I assume) if both of my layers were Canvas and I used a Viewstack to switch between them. But apparently the Viewstack won't work properly with Boxes... Assuming you guys got my problem, any ideas? Best regards, Leonardo C.
[flexcoders] Re: With the latest eula agreement from Apple
Can you provide a source for the restrictions not being applied evenhandedly? As far as I know, Apple has changed their developer agreement for iPhone / iPad / iPod Touch. They have not attempted to enforce the new restriction on anyone, Adobe or otherwise. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... wrote: I love my MacBook Pro, and related Apple products, but Steve Jobs is really starting to piss me off. Apparently this 'restriction' is not being applied evenhandedly across the boards with other similar packaging tools. I am sure that Flash being integrated with Chrome isn't helping things either. But in Steve's world, it's his way or the highway. And then to invoke the Open Standards criticism of Flash becomes even more disingenuous that before. Open standards my a**, this is just plain and simple cutthroat competition. And the timing - the timing of this given the imminent release of CS5 - you'd think that if he was going to do this he should have done it a year or more ago. It's not like he didn't know that this capability was being developed. This smacks of anti-competitive practices and I for one hope something can (and will) be done about it. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Patrick Sent: Friday, April 09, 2010 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] With the latest eula agreement from Apple Will adobe punch back and file a law suit against apple? This is total crap. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] A label on a border - is this a skin?
FB3 I need to put a fancy oval text thing superimposed onto the top of a VBox. Would this be a skin for the VBox border or some other technique? It would be nice to be able to do it in .css if possible. I have no idea how to proceed. Please point me in the right direction. I was gonna upload a drawing jpg but I can't figure out how to do that either :) Thanks, Libby
[flexcoders] Positioning / Scrolling problem with Flex popup
Hi all, I'm trying to work out a specific problem I'm having with positioning in Flex using the PopUpManager. Basically I'm wanting to create a popup which will scroll with the parent container - this is necessary because the parent container is large and if the user's browser window isn't large enough (this will be the case the majority of the time) - they will have to use the scrollbar of the container to scroll down. The problem is that the popup is positioned relative to another component, and it needs to stay by that component. (also sorry if the code below isn't formatted right, but I pasted it right from Eclipse). ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.core.UITextField; import mx.containers.TitleWindow; import mx.managers.PopUpManager; private function clickeroo(event:MouseEvent):void { var popup:TitleWindow = new TitleWindow(); popup.width = 250; popup.height = 300; popup.title = Example; var tf:UITextField = new UITextField(); tf.wordWrap = true; tf.width = popup.width - 30; tf.text = This window stays put and doesn't scroll when the hbox is scrolled (even with using the hbox as parent in the addPopUp method), I need the popup to be local to the HBox.; popup.addChild(tf); PopUpManager.addPopUp(popup, hbox, false); } ]] /mx:Script mx:HBox width=100% height=2000 id=hbox mx:Button label=Click Me click=clickeroo(event)/ /mx:HBox /mx:Application
RE: [flexcoders] Re: With the latest eula agreement from Apple
The source may be hearsay, but is referenced in this blog post: http://whydoeseverythingsuck.com/2010/04/steve-jobs-has-just-gone-mad.html Reportedly Unity 3D was told that this new EULA would not apply to them, yet on the face of it, it should. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeffry Houser Sent: Friday, April 09, 2010 1:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: With the latest eula agreement from Apple Can you provide a source for the restrictions not being applied evenhandedly? As far as I know, Apple has changed their developer agreement for iPhone / iPad / iPod Touch. They have not attempted to enforce the new restriction on anyone, Adobe or otherwise. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... wrote: I love my MacBook Pro, and related Apple products, but Steve Jobs is really starting to piss me off. Apparently this 'restriction' is not being applied evenhandedly across the boards with other similar packaging tools. I am sure that Flash being integrated with Chrome isn't helping things either. But in Steve's world, it's his way or the highway. And then to invoke the Open Standards criticism of Flash becomes even more disingenuous that before. Open standards my a**, this is just plain and simple cutthroat competition. And the timing - the timing of this given the imminent release of CS5 - you'd think that if he was going to do this he should have done it a year or more ago. It's not like he didn't know that this capability was being developed. This smacks of anti-competitive practices and I for one hope something can (and will) be done about it. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Patrick Sent: Friday, April 09, 2010 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] With the latest eula agreement from Apple Will adobe punch back and file a law suit against apple? This is total crap. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Simply Cannot Insert Values into My Database From Flex
I'm trying to learn how to insert values from my flex app to my mysql database via a php file. I've followed the following example to the letter but it simply will not work for me:- http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_2.html When I click the button in the app which should do the insert it just does not do it. It's bizzare. I have uploaded the app to my server along with the php file and changed the url within the code to my php file etc and it all looks perfect but I try to do the insert then when I go to my mysql database it just isn't there and the table is still empty. Can anybody suggest why this might be?
[flexcoders] Re: Positioning / Scrolling problem with Flex popup
You'll want to create a method that does something like this: var target:Point = localToGlobal( new Point( hbox.x, hbox.y ) ); popup.move( target.x, target.y ); Call the method after you add the popup and when the container is scrolled. In some cases localToContent is more appropriate. -TH --- In flexcoders@yahoogroups.com, s_grollins s.groll...@... wrote: Hi all, I'm trying to work out a specific problem I'm having with positioning in Flex using the PopUpManager. Basically I'm wanting to create a popup which will scroll with the parent container - this is necessary because the parent container is large and if the user's browser window isn't large enough (this will be the case the majority of the time) - they will have to use the scrollbar of the container to scroll down. The problem is that the popup is positioned relative to another component, and it needs to stay by that component. (also sorry if the code below isn't formatted right, but I pasted it right from Eclipse). ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.core.UITextField; import mx.containers.TitleWindow; import mx.managers.PopUpManager; private function clickeroo(event:MouseEvent):void { var popup:TitleWindow = new TitleWindow(); popup.width = 250; popup.height = 300; popup.title = Example; var tf:UITextField = new UITextField(); tf.wordWrap = true; tf.width = popup.width - 30; tf.text = This window stays put and doesn't scroll when the hbox is scrolled (even with using the hbox as parent in the addPopUp method), I need the popup to be local to the HBox.; popup.addChild(tf); PopUpManager.addPopUp(popup, hbox, false); } ]] /mx:Script mx:HBox width=100% height=2000 id=hbox mx:Button label=Click Me click=clickeroo(event)/ /mx:HBox /mx:Application
[flexcoders] Re: render tree click problem with viewstack
If I put in an Alert statement before the mainviewstack.selectedChild = Container(mainviewstack.getChildByName(selectedno...@hidden)); then everything works fine ? It's like the viewstack is not created in time but adding the alert slows it down and allows it to be created, very weird. --- In flexcoders@yahoogroups.com, advancedonsite nos...@... wrote: Let me give more details... Sometimes the viewstack shows sometimes it throws the error even on the same viewstack? its like something is not rendered in time or such? --- In flexcoders@yahoogroups.com, advancedonsite nospam@ wrote: I've been using this code to choose a viewstack based on name of the canvas ID... and it works but as the tree grew a bit larger I've noticed that certain items throw an error of ReferenceError: Error #1065: Variable is not defined. getDefinitionByName() === // Event handler for the Tree control change event. public function treeChanged(event:Event):void { selectedNode=Tree(event.target).selectedItem as XML; trace(selectedno...@hidden); mainviewstack.selectedChild = Container(mainviewstack.getChildByName(selectedno...@hidden)); } mx:XMLList id=treeData root label=Root Tree main label=Announcements hidden=announcements view label=Add hidden=announcements_add/ view label=Remove hidden=announcements_remove/ /main main label=Stations hidden=stations view label=Information hidden=stations_information/ mx:Tree id=RootTree width=15% height=100% labelField=@label showRoot=false dataProvider={treeData} change=treeChanged(event)/ mx:ViewStack id=mainviewstack width=85% height=100% mx:Canvas backgroundColor=#FF id=announcements mx:Text text=TEST fontWeight=bold paddingTop=10 paddingLeft=10 / /mx:Canvas mx:Canvas backgroundColor=#CC id=announcements_add mx:Text text=This is test viewstack fontWeight=bold paddingTop=10 paddingLeft=10 / /mx:Canvas
[flexcoders] Re: With the latest eula agreement from Apple
I'd love to see a source other than something that someone said in a comment on a blog post; about Unity3D being excluded. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... wrote: The source may be hearsay, but is referenced in this blog post: http://whydoeseverythingsuck.com/2010/04/steve-jobs-has-just-gone-mad.html Reportedly Unity 3D was told that this new EULA would not apply to them, yet on the face of it, it should. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeffry Houser Sent: Friday, April 09, 2010 1:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: With the latest eula agreement from Apple Can you provide a source for the restrictions not being applied evenhandedly? As far as I know, Apple has changed their developer agreement for iPhone / iPad / iPod Touch. They have not attempted to enforce the new restriction on anyone, Adobe or otherwise. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battershall@ wrote: I love my MacBook Pro, and related Apple products, but Steve Jobs is really starting to piss me off. Apparently this 'restriction' is not being applied evenhandedly across the boards with other similar packaging tools. I am sure that Flash being integrated with Chrome isn't helping things either. But in Steve's world, it's his way or the highway. And then to invoke the Open Standards criticism of Flash becomes even more disingenuous that before. Open standards my a**, this is just plain and simple cutthroat competition. And the timing - the timing of this given the imminent release of CS5 - you'd think that if he was going to do this he should have done it a year or more ago. It's not like he didn't know that this capability was being developed. This smacks of anti-competitive practices and I for one hope something can (and will) be done about it. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Patrick Sent: Friday, April 09, 2010 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] With the latest eula agreement from Apple Will adobe punch back and file a law suit against apple? This is total crap. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
Re: [flexcoders] AS2 SWF lost function when loaded second time
Try different ways of unloading. Unload it, then destroy the SWFLoader used to load it and create a new SWFLoader instead. You might have to force garbage collection along the way. On 4/9/10 8:47 AM, James kkke...@yahoo.com wrote: Hi All, In my flex app, I loaded a AS2 swf. The AS2 swf is a document, generated by print2flash. The swf document worked great at the first time. However, if I unload it, and load another document (or load the same document again), the mouse drag function didn't work. I found a post on adobe, ActionScript 2 components may fail when loaded into an ActionScript 3 SWF. http://kb2.adobe.com/cps/000/54e2eda3.html I think it is what happen to me. But I didn't find a solution. Any ideas? -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Disappearing item renderer
Sorry, I just read this more carefully and saw that you are using Bitmap. The problem is that a renderer on the free list owns the bitmap. One possible solution is to make clones of the Bitmap. On 4/9/10 8:45 AM, Philip Smith loudj...@hotmail.com wrote: I tried that, the problem is still occurring. Any other possible solutions? Thanks. To: flexcoders@yahoogroups.com From: aha...@adobe.com Date: Thu, 8 Apr 2010 22:00:12 -0700 Subject: Re: [flexcoders] Disappearing item renderer Set a minWidth/height on the renderer. On 4/8/10 6:27 PM, method_air loudj...@hotmail.com http://hotmail.com wrote: Image component items in a HorizontalList, with the 'source' set to a Bitmap are disappearing when scrolled (appears to be related to item renderer recycling). This doesn't occur when the Image source is set to a string... Is there a workaround to stop this from occurring? Thanks, Philip -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Re: With the latest eula agreement from Apple
http://www.pocketgamer.biz/r/PG.Biz/Unity3D+iPhone/news.asp?c=19851 http://www.pocketgamer.biz/r/PG.Biz/Unity3D+iPhone/news.asp?c=19851The CEO is unconcerned. No word of Unity being excluded. Cheers, Claus. On Fri, Apr 9, 2010 at 5:01 PM, Jeffry Houser j...@dot-com-it.com wrote: I'd love to see a source other than something that someone said in a comment on a blog post; about Unity3D being excluded. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... wrote: The source may be hearsay, but is referenced in this blog post: http://whydoeseverythingsuck.com/2010/04/steve-jobs-has-just-gone-mad.html Reportedly Unity 3D was told that this new EULA would not apply to them, yet on the face of it, it should. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeffry Houser Sent: Friday, April 09, 2010 1:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: With the latest eula agreement from Apple Can you provide a source for the restrictions not being applied evenhandedly? As far as I know, Apple has changed their developer agreement for iPhone / iPad / iPod Touch. They have not attempted to enforce the new restriction on anyone, Adobe or otherwise. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battershall@ wrote: I love my MacBook Pro, and related Apple products, but Steve Jobs is really starting to piss me off. Apparently this 'restriction' is not being applied evenhandedly across the boards with other similar packaging tools. I am sure that Flash being integrated with Chrome isn't helping things either. But in Steve's world, it's his way or the highway. And then to invoke the Open Standards criticism of Flash becomes even more disingenuous that before. Open standards my a**, this is just plain and simple cutthroat competition. And the timing - the timing of this given the imminent release of CS5 - you'd think that if he was going to do this he should have done it a year or more ago. It's not like he didn't know that this capability was being developed. This smacks of anti-competitive practices and I for one hope something can (and will) be done about it. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Patrick Sent: Friday, April 09, 2010 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] With the latest eula agreement from Apple Will adobe punch back and file a law suit against apple? This is total crap. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Re: With the latest eula agreement from Apple
There is no official word of Adobe being excluded either. In fact, so far as I know, no word from Apple at all on the issue. Just lots of speculation. --- In flexcoders@yahoogroups.com, Claus Wahlers cl...@... wrote: http://www.pocketgamer.biz/r/PG.Biz/Unity3D+iPhone/news.asp?c=19851 http://www.pocketgamer.biz/r/PG.Biz/Unity3D+iPhone/news.asp?c=19851The CEO is unconcerned. No word of Unity being excluded. Cheers, Claus. On Fri, Apr 9, 2010 at 5:01 PM, Jeffry Houser j...@... wrote: I'd love to see a source other than something that someone said in a comment on a blog post; about Unity3D being excluded. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battershall@ wrote: The source may be hearsay, but is referenced in this blog post: http://whydoeseverythingsuck.com/2010/04/steve-jobs-has-just-gone-mad.html Reportedly Unity 3D was told that this new EULA would not apply to them, yet on the face of it, it should. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeffry Houser Sent: Friday, April 09, 2010 1:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: With the latest eula agreement from Apple Can you provide a source for the restrictions not being applied evenhandedly? As far as I know, Apple has changed their developer agreement for iPhone / iPad / iPod Touch. They have not attempted to enforce the new restriction on anyone, Adobe or otherwise. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battershall@ wrote: I love my MacBook Pro, and related Apple products, but Steve Jobs is really starting to piss me off. Apparently this 'restriction' is not being applied evenhandedly across the boards with other similar packaging tools. I am sure that Flash being integrated with Chrome isn't helping things either. But in Steve's world, it's his way or the highway. And then to invoke the Open Standards criticism of Flash becomes even more disingenuous that before. Open standards my a**, this is just plain and simple cutthroat competition. And the timing - the timing of this given the imminent release of CS5 - you'd think that if he was going to do this he should have done it a year or more ago. It's not like he didn't know that this capability was being developed. This smacks of anti-competitive practices and I for one hope something can (and will) be done about it. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Patrick Sent: Friday, April 09, 2010 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] With the latest eula agreement from Apple Will adobe punch back and file a law suit against apple? This is total crap. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
[flexcoders] Component Lifecycle Change in Flex4?
We are porting our project from Flex3 to Flex4. One of the common patterns we used for our components in Flex3, was to listen for the CreationComplete event, and then set some initial properties on that components children (defined in MXML). This worked fine in Flex3, however with the Flex4 SDK, these children are often still null in the creationComplete. Is there a better place to do this type of work now? -ctm
RE: [flexcoders] Disappearing item renderer
Thanks. With that addition, and a couple tweaks to re-register data binding (with bindSetter), the item renderers are not disappearing (or duplicating), for the moment. To: flexcoders@yahoogroups.com From: aha...@adobe.com Date: Fri, 9 Apr 2010 14:41:39 -0700 Subject: Re: [flexcoders] Disappearing item renderer Sorry, I just read this more carefully and saw that you are using Bitmap. The problem is that a renderer on the free list owns the bitmap. One possible solution is to make clones of the Bitmap. On 4/9/10 8:45 AM, Philip Smith loudj...@hotmail.com wrote: I tried that, the problem is still occurring. Any other possible solutions? Thanks. To: flexcoders@yahoogroups.com From: aha...@adobe.com Date: Thu, 8 Apr 2010 22:00:12 -0700 Subject: Re: [flexcoders] Disappearing item renderer Set a minWidth/height on the renderer. On 4/8/10 6:27 PM, method_air loudj...@hotmail.com http://hotmail.com wrote: Image component items in a HorizontalList, with the 'source' set to a Bitmap are disappearing when scrolled (appears to be related to item renderer recycling). This doesn't occur when the Image source is set to a string... Is there a workaround to stop this from occurring? Thanks, Philip -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui _ Got a cool Hotmail story? Tell us now http://clk.atdmt.com/UKM/go/195013117/direct/01/
[flexcoders] Can someone rewrite this...
Can someone rewrite this as a switch/case? I tried, but it didn't seem to work. Problem I am running into is the multiple conditions in the case. Thanks! private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } }
[flexcoders] Youtube API and Air 1.5.3! (Flex builder 4)
So I am just trying to play a video in Flex 4 using the built in spark videoplayer. I have the url for the video already but when I try to create the youtube video player my application won't let me allow the youtube.com domain!! So I can't create an instance of the player. I also tried loading the video into a SWFLoader to no avail... anyone have any suggestions? Is there a nice example of someone using AIR and the youtube player or just playing a youtube video anywhere?? Thanks for the help :)
[flexcoders] Re: Can someone rewrite this...
it curious but a person who are 2000 years old, with your implementation it's group 1 run this code: package { import flash.display.Sprite; public class test extends Sprite { public function test() { trace(this.getAgeGroup(2000)); } private function getAgeGroup(age:Number):int { if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } } } } maybe you want to do this: private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age=0age3) {//Birth to 2 return 1; } else if (age =3 age 6) {//3 to 5 return 2; } else if (age =6 age 9) {//6 to 8 return 3; } else if (age =9 age 13) {//9 to 12 return 4; } else if (age =13 age 16) {//13 to 15 return 5; } else if (age =16 age 19) {//16 to 18 return 6; } else {//Older or Adults return 0; } } see i changed yours with ??? HOWEVER, a switch implementation is like this: private function getAgeGroup(birthday:Date):int { var age:int=getAge(birthday); switch (age) { case 0 : case 1 : case 2 : return 1; break; case 3 : case 4 : case 5 : return 2; break; case 6 : case 7 : case 8 : return 3; break; case 9 : case 10 : case 11 : case 12 : return 4; break; case 13 : case 14 : case 15 : return 5; break; case 16 : case 17 : case 18 : return 6; break; default : return 0; break; } } Point for testing! :D greetings from Chile!, Latin America
Re: [flexcoders] Re: Performance feedback PLEASE
27 FPS - MacBook Pro 13 / OsX 10.6 - Core2 Duo 2.53GHz... On 9 Apr 2010, at 14:50, Jeff wrote: 60 fps Intel Core2 Duo 2.67GHz 4 GB RAM 64-bit Windows 7 --- In flexcoders@yahoogroups.com, Allan Pichler dreamc...@... wrote: I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! Allan Pichler RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@... Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype: apichler Yahoo: allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler
[flexcoders] Accordion - Opaque / transparent background
Hi All. I have been trying to make the accordion's background opaque / transparent. So it's see through. The 'backgroundAlpha' property does not work. Wondering if anyone has any tips here? Using Flash Builder 4, project is an AIR application using 'Wireframe' theme. Code: mx:Accordion backgroundAlpha=0.0 width=200 right=0 top=0 bottom=0 creationComplete=initAc() id=testAc s:NavigatorContent label=Accordion Pane 1 width=100% height=100% backgroundAlpha=.25 /s:NavigatorContent /mx:Accordion Regards Karim Beyrouti
[flexcoders] Re: Runtime shared libraries compiler option changed between 3.3.0 and 3.5.0
Well, I created a solution/workaround for this. Apparently, there's a bug in the COMPC and MXMLC tags in the flexTasks.jar provided by Adobe. http://www.fusioncube.net/index.php/flex-runtime-shared-library-path-solution --- In flexcoders@yahoogroups.com, orbwave steven.brown...@... wrote: Been using RSLs for a while now with Flex build 3.3.0. Downloaded 3.5.0 today and tried to compile and got this message from the compiler. [mxmlc] command line: Error: configuration variable 'runtime-shared-library-path' requires a value for 'rsl-url' I cannot find anywhere on the Adobe site or Google on how this configuration has changed in 3.5.0. Here's a snippet from my Ant build file that works in 3.3.0. runtime-shared-library-path path-element=${FLEX_HOME}/frameworks/libs/framework.swc url rsl-url=${web.root.dir}/lib/flex/${flex.build.number}/framework_${flex.\ build.number}.swz / url policy-file-url=${web.root.dir}/cross-domain.xml / url rsl-url=${web.root.dir}/lib/flex/${flex.build.number}/framework_${flex.\ build.number}.swf / url policy-file-url=${web.root.dir}/cross-domain.xml //runtime-shared-library-path If anyone has been able to successfully get an RSLs working, via an Ant build script, in 3.5.0, I would immensely appreciate a second pair of eyes on this.
[flexcoders] Re: Runtime shared libraries compiler option changed between 3.3.0 and 3.5.0
Hey Oleg. Thanks for the response. Tell me a little more about this additional configuration you mentioned. Is that a workaround? What do you put in that file? --- In flexcoders@yahoogroups.com, Oleg Sivokon olegsivo...@... wrote: Hi, I think it's a known bug, however, cannot find it in JIRA atm. I couldn't make antTask understand this option no matter what, so, I resumed to making an additional configuration XML and load-config filename=additional-config.xml/. But it is also possible I haven't tried enough :) Best. Oleg
Re: [flexcoders] Can someone rewrite this...
it curious but a person who are 2000 years old, with your implementation it's group 1 run this code: package { import flash.display.Sprite; public class test extends Sprite { public function test() { trace(this.getAgeGroup(2000)); } private function getAgeGroup(age:Number):int { if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } } } } maybe you want to do this: private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age=0age3) {//Birth to 2 return 1; } else if (age =3 age 6) {//3 to 5 return 2; } else if (age =6 age 9) {//6 to 8 return 3; } else if (age =9 age 13) {//9 to 12 return 4; } else if (age =13 age 16) {//13 to 15 return 5; } else if (age =16 age 19) {//16 to 18 return 6; } else {//Older or Adults return 0; } } see i changed yours with ??? HOWEVER, a switch implementation is like this: private function getAgeGroup(birthday:Date):int { var age:int=getAge(birthday); switch (age) { case 0 : case 1 : case 2 : return 1; break; case 3 : case 4 : case 5 : return 2; break; case 6 : case 7 : case 8 : return 3; break; case 9 : case 10 : case 11 : case 12 : return 4; break; case 13 : case 14 : case 15 : return 5; break; case 16 : case 17 : case 18 : return 6; break; default : return 0; break; } } Point for testing! :D greetings from Chile!, Latin America 2010/4/9 Wally Kolcz wko...@isavepets.com Can someone rewrite this as a switch/case? I tried, but it didn't seem to work. Problem I am running into is the multiple conditions in the case. Thanks! private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } }
Re: [flexcoders] Can someone rewrite this...
This is off the top of my head in email so there may be some errors but something like this should work var category:Number; switch (true){ case(age 18): category = 0; break; case(age 15): category = 6; break; case(age 12): category = 5; break; case(age 8): category = 4; break; case(age 5): category = 3; break; case(age 2): category = 2; break; default: category = 1; } return category; hth, Rob On 9-Apr-10, at 10:45 PM, Wally Kolcz wrote: Can someone rewrite this as a switch/case? I tried, but it didn't seem to work. Problem I am running into is the multiple conditions in the case. Thanks! private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } }
[flexcoders] Loading component at runtime with out compile time linking
Hai, I wanted to create module at run time using the below code var cls:Class = getDefinitionByName(mx.controls.Button) as Class; var comp:UIComponent = new cls(); Right now this is not possible unless I declare a dummy variable of a Button class in my program to get the compile time linking. My question is, when I use Flex 3 framework cache, is it still required to link the components in compile time ? Will these components wont be available in Flex framework swz/swf ? How can I resolve this ? -Gireesh
[flexcoders] Re: Issue with ModuleManager
Hai Jeff Roberts, This worked, Thank you very much. Thanks Gireesh --- In flexcoders@yahoogroups.com, jeff_roberts jeff_robe...@... wrote: Gireesh, I believe the problem you are having is because the ModuleInfo instance that is being created is going out of scope before the module get loaded. Borrowing from your code snippet shown below: var minfo:IModuleInfo = ModuleManager.getModule(obj.url); minfo.addEventListener(ModuleEvent.READY, onModuleReady); minfo.load(); minfo is a local variable and as soon as the function executes, it's out of scope. Instead, try making that variable an instance variable or have an array of ModuleInfo instances that you cache until the ready event is handled and then you can remove the ModuleInfo from the cache. Thank you, Jeff Roberts --- In flexcoders@yahoogroups.com, Gireesh Kumar gireeshkumar.g@ wrote: Hi All, I am trying to create a small application using 'ModuleManager.getModule' to load modules. but for some reason ready event is not getting fired first time, But it works fine if I invoke the method again. any idea why ? I have attached the sample program I am using. Thanks Gireesh
Re: [flexcoders] Performance feedback PLEASE
34 - 38 Xp sp2 Intel Core2 Duo 2.19 GHz (lots of applications opened and many days after last restart... (using hibernate for months in the laptop)) Pedro On Fri, Apr 9, 2010 at 9:51 AM, Allan Pichler dreamc...@gmail.com wrote: I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! *Allan Pichler* RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@gmail.com Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype:apichler Yahoo:allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler
RE: [flexcoders] Performance feedback PLEASE
Hi, 63-65 FPS ProcessorIntel(R) Core(TM)2 Duo CPU E6850 @ 3.00GHz, 3000 Mhz, 2 Core(s), 2 Logical Processor(s) From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Allan Pichler Sent: Παρασκευή, 9 Απριλίου 2010 11:52 To: flexcoders@yahoogroups.com Subject: [flexcoders] Performance feedback PLEASE I was wondering if anyone could take a quick glance at my AS3 3d renderer http://api.pluton.webhouse.dk/pool3d/pool3d.html and reply what FPS they get on their gear. If you could also provide your CPU info that would be extremely helpful. For the curious the engine sports the following features: Subpixel positioning (1/4 pixel on both x y) Antialiasing Ambient light Specular light Best regards and have a wonderful day! Allan Pichler RIA Architect - ColdFusion/Flex/Ajax/UI Email: dreamc...@gmail.com Phone DK: +45 22 68 08 88 Phone US: +1 (415) 683 0313 Skype:apichler Yahoo:allan_pichler Facebook: www.facebook.com/apichler LinkedIn: www.linkedin.com/in/apichler image001.jpgimage002.jpg
[flexcoders] AuthorizeNet image and script inclusion in Flex
I would like to include the AuthorizeNet, GeoTrust, and AlertSite type images and functionality in my Flex application. Seems like the ExternalInterface call is falling short on this task. Can anyone give me some advice on how this might be done? I need not only the images but the functionality that goes along with it. Thanks
Re: [flexcoders] Re: Positioning / Scrolling problem with Flex popup
try it: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute height=100% width=100% mx:Script ![CDATA[ import mx.core.UITextField; import mx.containers.TitleWindow; import mx.managers.PopUpManager; private function clickeroo(event:MouseEvent): void { var popup:TitleWindow = new TitleWindow(); popup.width = 250; popup.height = 300; popup.title = Example; var tf:UITextField = new UITextField(); tf.wordWrap = true; tf.width = popup.width - 30; tf.text = This window stays put and doesn't scroll when the hbox is scrolled (even with using the hbox as parent in the addPopUp method), I need the popup to be local to the HBox.; popup.addChild(tf); PopUpManager.addPopUp(popup, DisplayObject(Application.application), false); //I think this instead of DisplayObject(Application.application) will work too. } ]] /mx:Script mx:HBox width=100% height=2000 id=hbox mx:Button label=Click Me click=clickeroo(event)/ /mx:HBox /mx:Application João Augusto Zaratine blog.joaoaugusto.com.br (in portuguese) 2010/4/9 turbo_vb timh...@aol.com You'll want to create a method that does something like this: var target:Point = localToGlobal( new Point( hbox.x, hbox.y ) ); popup.move( target.x, target.y ); Call the method after you add the popup and when the container is scrolled. In some cases localToContent is more appropriate. -TH --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, s_grollins s.groll...@... wrote: Hi all, I'm trying to work out a specific problem I'm having with positioning in Flex using the PopUpManager. Basically I'm wanting to create a popup which will scroll with the parent container - this is necessary because the parent container is large and if the user's browser window isn't large enough (this will be the case the majority of the time) - they will have to use the scrollbar of the container to scroll down. The problem is that the popup is positioned relative to another component, and it needs to stay by that component. (also sorry if the code below isn't formatted right, but I pasted it right from Eclipse). ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute mx:Script ![CDATA[ import mx.core.UITextField; import mx.containers.TitleWindow; import mx.managers.PopUpManager; private function clickeroo(event:MouseEvent):void { var popup:TitleWindow = new TitleWindow(); popup.width = 250; popup.height = 300; popup.title = Example; var tf:UITextField = new UITextField(); tf.wordWrap = true; tf.width = popup.width - 30; tf.text = This window stays put and doesn't scroll when the hbox is scrolled (even with using the hbox as parent in the addPopUp method), I need the popup to be local to the HBox.; popup.addChild(tf); PopUpManager.addPopUp(popup, hbox, false); } ]] /mx:Script mx:HBox width=100% height=2000 id=hbox mx:Button label=Click Me click=clickeroo(event)/ /mx:HBox /mx:Application -- João Augusto Zaratine blog.joaoaugusto.com.br
Re: [flexcoders] Re: With the latest eula agreement from Apple
Jeffry, it is related to iPhoneOS 4. http://news.ycombinator.com/item?id=1250595 It is against Android/Java and Flash/ActionScript, but also touch C#/.NET, and any other language like Ruby... This also bans apps compiled using MonoTouch - a tool that compiles C# and .NET apps to the iPhone. It's unclear what this means for tools like Titanium and PhoneGap, which let developers write JavaScript code that runs in WebKit inside a native iPhone app wrapper. Alex. -- From: Jeffry Houser j...@dot-com-it.com Sent: Friday, April 09, 2010 4:01 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: With the latest eula agreement from Apple I'd love to see a source other than something that someone said in a comment on a blog post; about Unity3D being excluded. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... wrote: The source may be hearsay, but is referenced in this blog post: http://whydoeseverythingsuck.com/2010/04/steve-jobs-has-just-gone-mad.html Reportedly Unity 3D was told that this new EULA would not apply to them, yet on the face of it, it should. -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jeffry Houser Sent: Friday, April 09, 2010 1:53 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: With the latest eula agreement from Apple Can you provide a source for the restrictions not being applied evenhandedly? As far as I know, Apple has changed their developer agreement for iPhone / iPad / iPod Touch. They have not attempted to enforce the new restriction on anyone, Adobe or otherwise. --- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battershall@ wrote: I love my MacBook Pro, and related Apple products, but Steve Jobs is really starting to piss me off. Apparently this 'restriction' is not being applied evenhandedly across the boards with other similar packaging tools. I am sure that Flash being integrated with Chrome isn't helping things either. But in Steve's world, it's his way or the highway. And then to invoke the Open Standards criticism of Flash becomes even more disingenuous that before. Open standards my a**, this is just plain and simple cutthroat competition. And the timing - the timing of this given the imminent release of CS5 - you'd think that if he was going to do this he should have done it a year or more ago. It's not like he didn't know that this capability was being developed. This smacks of anti-competitive practices and I for one hope something can (and will) be done about it. Jeff -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Patrick Sent: Friday, April 09, 2010 10:02 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] With the latest eula agreement from Apple Will adobe punch back and file a law suit against apple? This is total crap. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
Re: [flexcoders] Can someone rewrite this...
Thanks for the try, but all ages are 18 so the first condition would be met on all of them. I need the multiple conditions on the case to be preserved. :) On 4/9/2010 11:45 PM, Rob Romanek wrote: This is off the top of my head in email so there may be some errors but something like this should work var category:Number; switch (true){ case(age 18): category = 0; break; case(age 15): category = 6; break; case(age 12): category = 5; break; case(age 8): category = 4; break; case(age 5): category = 3; break; case(age 2): category = 2; break; default: category = 1; } return category; hth, Rob On 9-Apr-10, at 10:45 PM, Wally Kolcz wrote: Can someone rewrite this as a switch/case? I tried, but it didn't seem to work. Problem I am running into is the multiple conditions in the case. Thanks! private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } }
Re: [flexcoders] Re: Can someone rewrite this...
Thanks for the catch on the GT. Haven't tried to run it yet. Just wrote is and hoped there would be a switch/case that is easier than having to case out each age.. On 4/9/2010 11:43 PM, Joe wrote: it curious but a person who are 2000 years old, with your implementation it's group 1 run this code: package { import flash.display.Sprite; public class test extends Sprite { public function test() { trace(this.getAgeGroup(2000)); } private function getAgeGroup(age:Number):int { if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } } } } maybe you want to do this: private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age=0age3) {//Birth to 2 return 1; } else if (age =3 age 6) {//3 to 5 return 2; } else if (age =6 age 9) {//6 to 8 return 3; } else if (age =9 age 13) {//9 to 12 return 4; } else if (age =13 age 16) {//13 to 15 return 5; } else if (age =16 age 19) {//16 to 18 return 6; } else {//Older or Adults return 0; } } see i changed yours with ??? HOWEVER, a switch implementation is like this: private function getAgeGroup(birthday:Date):int { var age:int=getAge(birthday); switch (age) { case 0 : case 1 : case 2 : return 1; break; case 3 : case 4 : case 5 : return 2; break; case 6 : case 7 : case 8 : return 3; break; case 9 : case 10 : case 11 : case 12 : return 4; break; case 13 : case 14 : case 15 : return 5; break; case 16 : case 17 : case 18 : return 6; break; default : return 0; break; } } Point for testing! :D greetings from Chile!, Latin America _
Re: [flexcoders] Can someone rewrite this...
Sorry, you're right. Tired and just can't seem to get my GT and LT's correct. :D On 4/9/2010 11:54 PM, Wally Kolcz wrote: Thanks for the try, but all ages are 18 so the first condition would be met on all of them. I need the multiple conditions on the case to be preserved. :) On 4/9/2010 11:45 PM, Rob Romanek wrote: This is off the top of my head in email so there may be some errors but something like this should work var category:Number; switch (true){ case(age 18): category = 0; break; case(age 15): category = 6; break; case(age 12): category = 5; break; case(age 8): category = 4; break; case(age 5): category = 3; break; case(age 2): category = 2; break; default: category = 1; } return category; hth, Rob On 9-Apr-10, at 10:45 PM, Wally Kolcz wrote: Can someone rewrite this as a switch/case? I tried, but it didn't seem to work. Problem I am running into is the multiple conditions in the case. Thanks! private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } }
Re: [flexcoders] Can someone rewrite this...
y did not understand, but i hope i help you 2010/4/9 Wally Kolcz wko...@isavepets.com Thanks for the try, but all ages are 18 so the first condition would be met on all of them. I need the multiple conditions on the case to be preserved. :) On 4/9/2010 11:45 PM, Rob Romanek wrote: This is off the top of my head in email so there may be some errors but something like this should work var category:Number; switch (true){ case(age 18): category = 0; break; case(age 15): category = 6; break; case(age 12): category = 5; break; case(age 8): category = 4; break; case(age 5): category = 3; break; case(age 2): category = 2; break; default: category = 1; } return category; hth, Rob On 9-Apr-10, at 10:45 PM, Wally Kolcz wrote: Can someone rewrite this as a switch/case? I tried, but it didn't seem to work. Problem I am running into is the multiple conditions in the case. Thanks! private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } }
Re: [flexcoders] Loading component at runtime with out compile time linking
There are a couple ways of doing this. You could try RSLs or Modules. Here is a link that talks about doing exactly what you are talking about. http://flexinonroids.wordpress.com/2009/05/27/flex-3-dynamically-loading-components-at-runtime/ On Fri, Apr 9, 2010 at 3:39 AM, Gireesh gireeshkuma...@gmail.com wrote: Hai, I wanted to create module at run time using the below code var cls:Class = getDefinitionByName(mx.controls.Button) as Class; var comp:UIComponent = new cls(); Right now this is not possible unless I declare a dummy variable of a Button class in my program to get the compile time linking. My question is, when I use Flex 3 framework cache, is it still required to link the components in compile time ? Will these components wont be available in Flex framework swz/swf ? How can I resolve this ? -Gireesh
Re: [flexcoders] Component Lifecycle Change in Flex4?
Can you make a simple test case where the children are null at creationComplete? On 4/9/10 4:38 PM, Christopher McArthur cmcart...@riotgames.com wrote: We are porting our project from Flex3 to Flex4. One of the common patterns we used for our components in Flex3, was to listen for the CreationComplete event, and then set some initial properties on that components children (defined in MXML). This worked fine in Flex3, however with the Flex4 SDK, these children are often still null in the creationComplete. Is there a better place to do this type of work now? -ctm -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Can someone rewrite this...
FWIW, if you are worried about performance, I would test the efficiency of using a map, especially if age is an int and not a Number. Even if it is a Number I might still test out a map with a Math.floor on the age. Var agemap:Object { 0 : 1, 1: 1, 2: 1, 3: 2, 4: 2, 5: 2, 6: 3, 7: 3, 8: 3... 19: 6 } Function get AgeGroup(age:Number):int { var intAge:int = Math.floor(age); // if needed return int(ageMap[intAge); } On 4/9/10 9:03 PM, Joe Cabezas joe.cabe...@gmail.com wrote: y did not understand, but i hope i help you 2010/4/9 Wally Kolcz wko...@isavepets.com Thanks for the try, but all ages are 18 so the first condition would be met on all of them. I need the multiple conditions on the case to be preserved. :) On 4/9/2010 11:45 PM, Rob Romanek wrote: This is off the top of my head in email so there may be some errors but something like this should work var category:Number; switch (true){ case(age 18): category = 0; break; case(age 15): category = 6; break; case(age 12): category = 5; break; case(age 8): category = 4; break; case(age 5): category = 3; break; case(age 2): category = 2; break; default: category = 1; } return category; hth, Rob On 9-Apr-10, at 10:45 PM, Wally Kolcz wrote: Can someone rewrite this as a switch/case? I tried, but it didn't seem to work. Problem I am running into is the multiple conditions in the case. Thanks! private function getAgeGroup(birthday:Date):int { var age:int = getAge(birthday); if (age = 0 age 3){ //Birth to 2 return 1; }else if (age =3 age 6){ //3 to 5 return 2; }else if (age =6 age 9){ //6 to 8 return 3; }else if (age =9 age 13){ //9 to 12 return 4; }else if (age =13 age 16){ //13 to 15 return 5; }else if (age =16 age 19){ //16 to 18 return 6; }else { //Older or Adults return 0; } } -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui