[flexcoders] Weird font issues
Hi there I'm experiencing a strange issue where when compiling running my project with FlexBuilder, text in a custom implementation of Flex's new text-layout control periodically disappears and re-appears, or just doesn't display at all. I put this build (debug or release) up for my collegues to test and it runs fine for them. Also, if they check the project out of svn debug / compile it, it works fine. Previously before installing Snow Leopard I was running Leopard and had a similar issue, where my font for this particular control was smaller and bolder on my computer than it actually was / had been designed to be - on everyone else's computer it was not bold was bigger even though I created all the build releases. I assume the issue I'm having now is related because I create the release builds don't see the font, but everyone else can. I have done a clean reinstall of Snow Leopard ... so it's very unlikely that there are any cached settings that were responsible for my initial issue. Cheers Tracy
[flexcoders] Re: Special characters (eg. Cyrillic) TextArea
Thanks Andriy for your help I've managed to track down the issue (but not explain it) One of our team - also using Mac OSX - built his project using a manually updated version of Flex 3.2 sdk (versus updating to flexbuilder 3.0.2, which automatically udpates to the 3.2 sdk) If I build the exact same project (same checked-out items from SVN), cyrillic in a release build works fine. Since then he has upgraded to Flexbuilder 3.0.2, so theoretically he should have the same environment as me. He has since built new swc versions of his component and we still get issues with typing cyrillic in a textarea. For now at least there is the work around that I can build a version of his component to be used in my project and cyrillic / special characters will always work. It is strange that with his updated environment which is the same as mine, there is some incompatibility that is causing special characters not to display properly (now this occurs in release as well as debug builds) Cheers Tracy --- In flexcoders@yahoogroups.com, Andriy Panas a.pa...@... wrote: Hi Tracy, Are you using Safari browser under Mac OS 10.6? If yes, then probably you are victim of the following bug Can't enter cyrillic symbols https://bugs.adobe.com/jira/browse/FP-3213 http://www.openradar.appspot.com/7395808 -- Best regards, Andriy Panas 2009/12/1 Andriy Panas a.pa...@...: Hi Tracy, I am afraid your code sample is too generic and will not help me to isolate your issue. Me as a native speaker that uses Cyrillic alphabet had never seen any problems with displaying Cyrillic alphabet symbols in mx:TextArea, but this remain valid only for Windows OS, never tried Mac OS. I see that you're running Flash Player at Mac and had created the issue https://bugs.adobe.com/jira/browse/FB-24484 at Adobe JIRA bug-base, let move the discussion over this issue to Adobe JIRA. You should try as many Flash player dot versions as possible to test this issue, e.g 9.0.115, 9.0.246, 10.0.32.18 etc because we are talking here not about Flex SDK, but about Flash player features. -- Best regards, Andriy Panas 2009/12/1 polestar11 polesta...@... Hi there It is the mx:TextArea: mx:TextArea width=200 y=20 x=20 / Here is a code snippet: mx:Box width=100% height=100% horizontalAlign=center verticalAlign=middle mx:ViewStack id=viewStack width=100% height=100% selectedIndex=1 component:MainPanel id=mainPanel width=100% height=100% /-- mx:VBox width=100% id=progressView height=100% horizontalAlign=center verticalAlign=middle mx:ProgressBar height=15 indeterminate=true label=Initializing ChessCube ... fontSize=14 / /mx:VBox /mx:ViewStack /mx:Box mx:TextArea width=200 y=20 x=20 / The textarea works for special characters in debug mode, but not in release build mode. I've tried replicating / isolating the issue using different applications / projects but haven't found anything close to a solution yet, other than sometimes my tests fail for special characters even in debug mode (I think because I haven't cleaned the project properly) Cheers Tracy --- In flexcoders@yahoogroups.com, Gordon Smith gosmith@ wrote: BTW, are you are talking about the old MX TextArea or the or new Spark TextArea? Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Andriy Panas Sent: Monday, November 30, 2009 10:49 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Special characters (eg. Cyrillic) TextArea Hi polestar11, Simple code sample will definitely help to understand your issue. -- Best regards, Andriy Panas 2009/11/30 polestar11 polestar11@mailto:polestar11@ Hi there I have a problem where I am not able to paste special characters (eg. cyrillic arabic) into a flex TextArea component. This occasionally happens in a debug version of my app and always happens in a release build. I created a test application in the same project to try isolate the issue. I intermittently am not able to paste special characters into a textarea. I also created a different project entirely and never experience the issue. My guess is that the compiler is misbehaving getting stuck. Any help MUCH appreciated Cheers Tracy ,___
[flexcoders] Re: Special characters (eg. Cyrillic) TextArea
Hi there It is the mx:TextArea: mx:TextArea width=200 y=20 x=20 / Here is a code snippet: mx:Box width=100% height=100% horizontalAlign=center verticalAlign=middle mx:ViewStack id=viewStack width=100% height=100% selectedIndex=1 component:MainPanel id=mainPanel width=100% height=100% /-- mx:VBox width=100% id=progressView height=100% horizontalAlign=center verticalAlign=middle mx:ProgressBar height=15 indeterminate=true label=Initializing ChessCube ... fontSize=14 / /mx:VBox /mx:ViewStack /mx:Box mx:TextArea width=200 y=20 x=20 / The textarea works for special characters in debug mode, but not in release build mode. I've tried replicating / isolating the issue using different applications / projects but haven't found anything close to a solution yet, other than sometimes my tests fail for special characters even in debug mode (I think because I haven't cleaned the project properly) Cheers Tracy --- In flexcoders@yahoogroups.com, Gordon Smith gosm...@... wrote: BTW, are you are talking about the old MX TextArea or the or new Spark TextArea? Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Andriy Panas Sent: Monday, November 30, 2009 10:49 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Special characters (eg. Cyrillic) TextArea Hi polestar11, Simple code sample will definitely help to understand your issue. -- Best regards, Andriy Panas 2009/11/30 polestar11 polesta...@...mailto:polesta...@... Hi there I have a problem where I am not able to paste special characters (eg. cyrillic arabic) into a flex TextArea component. This occasionally happens in a debug version of my app and always happens in a release build. I created a test application in the same project to try isolate the issue. I intermittently am not able to paste special characters into a textarea. I also created a different project entirely and never experience the issue. My guess is that the compiler is misbehaving getting stuck. Any help MUCH appreciated Cheers Tracy
[flexcoders] Special characters (eg. Cyrillic) TextArea
Hi there I have a problem where I am not able to paste special characters (eg. cyrillic arabic) into a flex TextArea component. This occasionally happens in a debug version of my app and always happens in a release build. I created a test application in the same project to try isolate the issue. I intermittently am not able to paste special characters into a textarea. I also created a different project entirely and never experience the issue. My guess is that the compiler is misbehaving getting stuck. Any help MUCH appreciated Cheers Tracy
[flexcoders] FlexBuilder - Release Build - Cannot type Cyrillic foreign characters
Hi there All of a sudden when creating a release build of my application, users are not able to type Cyrillic other foreign characters into textareas. If I test on a debug version I am able to enter in these characters, but not if I make a release build. This is strange because I have made hundreds of release builds before and never come across this problem. The last successful release build I made where it definitely worked was 19 Nov 09. Cheers Tracy
[flexcoders] Re: Flex Debug Problem
Hi there I managed to find a solution to the problem. It has to do with outdated app xml config files (which I think don't get committed into source control) So after importing my project from source control, I create a new application (eg. Test) and run / debug it, which works fine. Compare the 2 app xml config files. In the new file at the top you will see a line: application xmlns=http://ns.adobe.com/air/application/1.5; In the old file I had: application xmlns=http://ns.adobe.com/air/application/1; I actually copied all the data over from my original app to the test app, but if you replace just that line of xml, the original project should run fine. Cheers Tracy
[flexcoders] Re: FB3 Debug: Launch Failed: Invalid argument
Have you tried debugging your app with FireFox? I'm also on a mac but have never tried debugging using Safari Cheers Tracy --- In flexcoders@yahoogroups.com, Stephen Downs st...@... wrote: I've having an extremely agonizing time dealing with mysterious alert messages when trying to debug my Flex Builder 3 project. Debugging begins, the status bar reads Launching project: (91%), the application loads in the browser and displays, but back in Flex it hangs with an error message: Launch Failed Invalid argument This error message could be more informative. As is, no details, no line number given. Fixes I've tried, in combination and alone, to no avail: ) Clean Project. ) Strip mxml down to single bare Application tag. ) Delete build folder. Install details: Mac OS X 10.6.1 Safari 4.0.3 (6531.9) Flex Builder 3.0.2 Flash Player 10.0.32.18 content debugger Any insight would be terrific. Thanks, Steve
[flexcoders] Re: Wondering about buttons..
I would do the same, where these public properties update the style information of the button (icon labelPlacement) I would also probably do this as an mxml component (with the code inside a mx:Script tag) --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: If I were going to do this, I would create a new class that extended button with a couple of public properties - one to set the icon side and one to set the icon type. --- In flexcoders@yahoogroups.com, tchredeemed apthorp@ wrote: I have always wondered what the best way to do this was: I need to create a reusable button, but this button will sometimes have an arrow on the right side, an 'x' on the right side, or nothing on the right side. There might be the possibility to have these on the left side too. I have attempted this before, but I have never really come up with an elegant solution. Just wondering what the best/cleanest way to do this would be? Thanks!
[flexcoders] Re: How can I populate the data in PopUpMenuButton?
I have never worked with an AdvancedDataGrid, but for a regular DataGrid I would do the following: - create a new component that will be the item-renderer (possibly extend DataGridItemRenderer) - this new component would contain a popup-menu component - at this component level you have access to the 'data' property of that item, which would hold any information, such as urls / links At this point I'm not clear with what u are trying to do, but you have various events / options open to you. Such as ListEvent, where you can set up a listener on your DataGrid. For example, itemClick: myDataGrid.addEventListener(ListEvent.ITEM_CLICK, onDataGridItemClick); private function onDataGridItemClick(e:ListEvent):void { trace(e.itemRenderer.data); // here you have a handle to either the component itself (e.itemRenderer), or the actual data } Cheers Tracy --- In flexcoders@yahoogroups.com, thomas_13s thomas_...@... wrote: Hi , I have an advanced data grid , with 8 columns one of the columns i want the 8 th column as a POPUPMenu Button, and when I click on the menu item it should navigate to a url value which is in the Array dArr. Array ddArr has 2 values ,how can i do this I have tried many things. Array ddArr has the values [dd.label,dd.url] and some valuses in the array has more than one occurence, I mean [dd.label1,dd.url1],[dd.label2,dd.url2]. The values to be populated in the POPUPMenuButton , i have in an array dArr.After doing this I see only the popupButton but no data from ddArr . please help me out. ?xml version=1.0? !-- Dashboard Main Service Summary table -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; width=100% height=100% backgroundColor=#FF initialize=initApp(); creationComplete=onCreationComplete(); mx:Style .hStyle { fontWeight:bold; fontFamily:Verdana; fontSize:12; align:center; } /mx:Style mx:Script ![CDATA[ var ddArr:ArrayCollection = new ArrayCollection(); var dp:ArrayCollection = new ArrayCollection(); var ddLabel:String=; var ddUrl:String=; var ddData:String=; var ddRest:String=; var popUpB:PopUpMenuButton; ddData= xd[9]; ddRest=ddData; var ddidx:int = ddData.indexOf(|); // var dObj:Object=new Object(); while ( ddidx 0 ) { ddLabel= ddRest.substring( 0, ddidx ); ddRest= ddRest.substring(ddidx + 1 ); ddidx = ddRest.indexOf(|); if( ddidx 0) { // ddUrl= ddRest.substring(ddidx + 1 ); ddUrl= ddRest.substring(0, ddidx ); ddRest= ddRest.substring(ddidx + 1 ); ddidx = ddRest.indexOf(|); } dObj.label= ddLabel; dObj.url=ddUrl; ddArr.addItem(dObj); } popUpB=new PopUpMenuButton(); myMenu = new Menu(); myMenu.labelField = Action; myMenu.showRoot = true; myMenu.width = popUpB.width; myMenu.selectedIndex = 0; myMenu.dataProvider = ddArr; // myMenu.addEventListener(itemClick, itemClickHandler); popUpB.popUp = myMenu; dp.addItem( { Index:xd[0], Service:xd[1], Priority:xd[2], Current SLA:xd[3],Health:xd[4], Quality:xd[5], Risk:xd[6], Avail:xd[7], OpMode:xd[8], dd:popUpB} ); dp = dpSrv; gc.source=dp; gc.refresh(); ]] /mx:Script mx:HTTPService id=sst resultFormat=text result=onJSONLoad(event) url={sURL} fault=onFaultLoad(event)/ mx:Panel title={cTitle} width=100% height=100% titleStyleName=hStyle headerColors=[0xC5DFF9,0xEFF6FF] mx:AdvancedDataGrid id=srvTable width=100% height=100% color=0x323232 dragEnabled=true dropEnabled=true enabled=true showHeaders=true displayItemsExpanded=true variableRowHeight=true wordWrap=false initialize=gc.refresh(); mx:dataProvider mx:GroupingCollection id=gc source ={dpSrv} mx:grouping mx:Grouping !-- mx:GroupingField name=PService / -- mx:GroupingField name=Service / /mx:Grouping /mx:grouping /mx:GroupingCollection !-- mx:HierarchicalData id=gc source={dpSrv}/ -- /mx:dataProvider mx:columns mx:AdvancedDataGridColumn id =ddcol dataField=dd headerText= Drill-down width=200 textAlign=left /mx:AdvancedDataGridColumn
[flexcoders] Re: Create Flex Ajax Bridge menu option - Crashes FlexBuilder
FlexBuilder 3 --- In flexcoders@yahoogroups.com, Tom Chiverton tom.chiver...@... wrote: On Friday 05 Dec 2008, polestar11 wrote: So often I have accidentally clicked the 'Create Ajax Bridge' menu option which is located just above the SVN 'Team' menu option. I then click cancel and ... wallah ... Flex Builder has crashed. Builder standalone or plugin ? -- Tom Chiverton Helping to authoritatively benchmark visionary sexy action-items
[flexcoders] Create Flex Ajax Bridge menu option - Crashes FlexBuilder
rant So often I have accidentally clicked the 'Create Ajax Bridge' menu option which is located just above the SVN 'Team' menu option. I then click cancel and ... wallah ... Flex Builder has crashed. /rant
[flexcoders] Re: Custom Components - updateDisplay results in ghost children drawn
Well what do u know. I moved my component from my test sandbox to my production environment and the problem went away - no strange graphics lingering behind. Very strange, but at least it works. --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: I don't think updateDisplayList is the right place to be doing drawing into graphics, although I may be wrong. I usually do it on the render or updatecomplete event, but that might not be optimal either. Alex would know :) If you want to link to a zip of a test project I might get a chance to poke around inside and see what it's doing wrong. -Josh -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] Re: Performance, Event Listeners and removedFromStage
Is there any other way / event to completely remove events instead of using the removedFromStage event? --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Weak refs work. You can rely on them, but not count on when an object will finally go away. removedFromStage probably happens when we re-parent to move a child into a scrollable sub-container.
[flexcoders] Re: Custom Components - updateDisplay results in ghost children drawn
Thanks Josh This example was a simple case. What I actually want to is have my component behave like a container where it centres its child items. In retrospect I would have to extend from the Container class. The absoulte size would fix the problem (in that the item re-draws would occur underneath each other would not be visible). I was just worried that I was getting a lot of outdated screen objects that aren't being cleaned up when drawing underneath each other. But I suppose it's only 1 graphics layer. Cheers Tracy --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: Components don't set explicitWidth and explicitHeight on themselves, they're (optionally) set by the container, and actual sizing is set by the container through setActualSize(). Override measure(), and set measuredWidth and measuredHeight to match your label, and your problems may go away. Also in updateDisplayList you want to set the actual size of the label to the minimu of it's measured size and unscaledWidth x unscaledHeight. -Josh
[flexcoders] Re: Custom Components - updateDisplay results in ghost children drawn
; nameContainer.y = progress.height + padding; } numberContainer.y = nameContainer.y + nameHeight; nameLabel.y = nameContainer.y + nameHeight/2 - nameLabel.measuredHeight/2 - 2; numberLabel.y = numberContainer.y + ratingHeight/2 - numberLabel.measuredHeight/2; } public function setDetails(nameText:String, numberText:String):void { if(progress == null image == null) { // loaded for the 1st time progress = addChild(new Sprite()) as Sprite; progress.addChild(new Assets.processingAni()); } _nameText = nameText; _numberText = numberText; invalidateProperties(); } --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Thanks Josh This example was a simple case. What I actually want to is have my component behave like a container where it centres its child items. In retrospect I would have to extend from the Container class. The absoulte size would fix the problem (in that the item re-draws would occur underneath each other would not be visible). I was just worried that I was getting a lot of outdated screen objects that aren't being cleaned up when drawing underneath each other. But I suppose it's only 1 graphics layer. Cheers Tracy --- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ wrote: Components don't set explicitWidth and explicitHeight on themselves, they're (optionally) set by the container, and actual sizing is set by the container through setActualSize(). Override measure(), and set measuredWidth and measuredHeight to match your label, and your problems may go away. Also in updateDisplayList you want to set the actual size of the label to the minimu of it's measured size and unscaledWidth x unscaledHeight. -Josh
[flexcoders] Re: Custom Components - updateDisplay results in ghost children drawn
; nameContainer.y = progress.height + padding; } numberContainer.y = nameContainer.y + nameHeight; nameLabel.y = nameContainer.y + nameHeight/2 - nameLabel.measuredHeight/2 - 2; numberLabel.y = numberContainer.y + ratingHeight/2 - numberLabel.measuredHeight/2; } public function setDetails(nameText:String, numberText:String):void { if(progress == null image == null) { // loaded for the 1st time progress = addChild(new Sprite()) as Sprite; progress.addChild(new Assets.processingAni()); } _nameText = nameText; _numberText = numberText; invalidateProperties(); } --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Thanks Josh This example was a simple case. What I actually want to is have my component behave like a container where it centres its child items. In retrospect I would have to extend from the Container class. The absoulte size would fix the problem (in that the item re-draws would occur underneath each other would not be visible). I was just worried that I was getting a lot of outdated screen objects that aren't being cleaned up when drawing underneath each other. But I suppose it's only 1 graphics layer. Cheers Tracy --- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ wrote: Components don't set explicitWidth and explicitHeight on themselves, they're (optionally) set by the container, and actual sizing is set by the container through setActualSize(). Override measure(), and set measuredWidth and measuredHeight to match your label, and your problems may go away. Also in updateDisplayList you want to set the actual size of the label to the minimu of it's measured size and unscaledWidth x unscaledHeight. -Josh
[flexcoders] Re: Fast String concatenation
Hi Alex Thanks for the reference. I found the following related technique: http://blogs.adobe.com/pfarland/2007/10/avoiding_string_concatenation.html --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: For building up strings out of little pieces, we use fromCharCode From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of polestar11 Sent: Friday, July 11, 2008 5:54 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Fast String concatenation Hi there I wanted to check if there are any tricks one can do to improve the speed on concatenating strings. I know in Java there is a StringBuilder class which is faster than the '+' operator. I havent seen an equivallent for Actionscript, so is var mystring:String = 'string1' + 'string2' the fastest way to concatenate strings? CHeers tracy
[flexcoders] Performance, Event Listeners and removedFromStage
Hi I know it's good practise to clean up event listeners to improve on performance. I see 2 ways of doing this: - Explicitly clean up listeners (using removeEventListener(...)) - Specify 'useWeakRefrerences = true' when adding the event listener (addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true)) I usually implement both, explicitly removing events where I can. I also don't trust the latter to be as effective as explicitly removing listeners - is it as effective? I have a bunch of item-renderers that have at least 4 event listeners. I set up these events to use weak references. To be 100% safe I also want to explicitly remove the listeners. So I listen for the 'removedFromStage' event, where I explicitly remove the listeners. Enter problem ... The 'removedFromStage' event is called when an item is initialized. Flex does some weird drawing initialization which ends firing 'removedFromStage' when the components initially load up. This results in my event listeners being removed even before the component has loaded and my item-renderers no longer work. So, what is the solution? - Can I rely on the 'useWeakRef' attribute to clean up the listeners(I have 100s of item-renderers)? - Where could I explicitly remove the listeners if this is the correct way of doing things? - Why is 'removedFromStage' called at such an illogical point in the creation of components? Cheers Tracy
[flexcoders] Custom Components - updateDisplay results in ghost children drawn
Hi I've been working with custom components only just noticed a strange re-drawing issue where I get ghost versions of the children in my component appearing. I've only just noticed this since I set the child's position relative to unscaledWidth, which changes and so allows me to see N different older versions of the child. This is quite worrying because this means in my other versions where I the child position is static there are possibly N occurances of my child component. Why would this ghosting be happening and is there anything one can do to purge older instances? Here's a screenshot of the ghosting: http://img395.imageshack.us/img395/7826/ghostredrawingpq9.jpg Here's the code: import mx.controls.Label; import mx.core.UIComponent; public class TestComponent extends UIComponent { private var label:Label; public function TestComponent() { super(); } override protected function createChildren() : void { super.createChildren(); if(!label) { label = new Label(); label.text = A LABEL; addChild(label); } explicitWidth = 200; explicitHeight = 200; } override protected function updateDisplayList( unscaledWidth:Number, unscaledHeight:Number ):void { super.updateDisplayList(unscaledWidth, unscaledHeight); label.setActualSize(label.measuredWidth, label.measuredHeight); } }
[flexcoders] Fast String concatenation
Hi there I wanted to check if there are any tricks one can do to improve the speed on concatenating strings. I know in Java there is a StringBuilder class which is faster than the '+' operator. I havent seen an equivallent for Actionscript, so is var mystring:String = 'string1' + 'string2' the fastest way to concatenate strings? CHeers tracy
[flexcoders] Re: Fast String concatenation
The only appendText function I found was on a TextField object. I need something for Strings. I tried the string.concat method and got the following for the following tests: test1: 500ms test2: 2200ms private function test1():void { var i:int = -1; var s:String = var app:String = append; var time:int = getTimer(); while(++i 100) { s += A; } val1 = getTimer() - time; callLater(test2); } private function test2():void { var i:int = -1; var s:String = var app:String = append; var time:int = getTimer(); while(++i 100) { s.concat(A); } val2 = getTimer() - time; callLater(showResult); } --- In flexcoders@yahoogroups.com, Simon Bailey [EMAIL PROTECTED] wrote: Try the much faster appendText() method :) Cheers, Simon On 11 Jul 2008, at 13:53, polestar11 wrote: Hi there I wanted to check if there are any tricks one can do to improve the speed on concatenating strings. I know in Java there is a StringBuilder class which is faster than the '+' operator. I havent seen an equivallent for Actionscript, so is var mystring:String = 'string1' + 'string2' the fastest way to concatenate strings? CHeers tracy
[flexcoders] Interesting XML performance discovery
Hi there I'm busy crunching through xml data, stripping out nodes that don't have children. Perhaps its not the best way to do things, but I use a for loop that checks and deletes any item with no children. I've always found XML delete tricky and to do this I reference the parent which finds the child index and deletes the child. On a file of 1+ items execution time is 600ms without the delete. With the delete execution time is 52919ms! I'm off to find another delete function ... for each(span in body.span) { if(span.children().length() == 0) { delete span.parent().children()[span.childIndex()]; } else { [EMAIL PROTECTED] = SPAN_PREFIX + id++; [EMAIL PROTECTED] = itemClicked('[EMAIL PROTECTED]', AIR.itemSelected); [EMAIL PROTECTED] = span.attribute(class); } }
[flexcoders] Re: Interesting XML performance discovery
... just discovered how terribly unoptimized code can be. Changed the delete code snippet from the below example to the following: delete body.children()[count]; // takes 53636ms and then the following: delete spans[count]; // takes 852ms Obviously constructing a child array each time in the loop on a large list of children is hugely inefficient. --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi there I'm busy crunching through xml data, stripping out nodes that don't have children. Perhaps its not the best way to do things, but I use a for loop that checks and deletes any item with no children. I've always found XML delete tricky and to do this I reference the parent which finds the child index and deletes the child. On a file of 1+ items execution time is 600ms without the delete. With the delete execution time is 52919ms! I'm off to find another delete function ... for each(span in body.span) { if(span.children().length() == 0) { delete span.parent().children()[span.childIndex()]; } else { [EMAIL PROTECTED] = SPAN_PREFIX + id++; [EMAIL PROTECTED] = itemClicked('[EMAIL PROTECTED]', AIR.itemSelected); [EMAIL PROTECTED] = span.attribute(class); } }
[flexcoders] AIR HTML component - html tag / text selection
Hi there I'm trying to access selected html text from an HTML component in an AIR app. I'm able to get selected text that excludes html tags by calling a JS function: window.getSelection(). This excludes the HTML tags though. I've tried using my HTML component's textSnapshot property this has a charCount of zero. Does anyone have good suggestions on how to get: a) the parent tag or id of a selected piece of text either via AIR or JS b) how to get the raw text of a selection (that includes tags) via AIR or JS Thanks Tracy
[flexcoders] Skinning in Flex - What a nightmare!!!
Please help There is virtually no documentation on Flex skinning. I am really struggling with border sizes and content sizes with custom skins, in particular Panel skins using the borderSkin property. I'm currently trying to skin an Alert box. I have the following properties set: Alert { color:#ff; borderSkin: Embed(source=flex_skins.swf, symbol=Panel_popupSkin2); headerHeight: 30; paddingTop: 20; paddingBottom: 4; } My content only just fits, after much pixel pushing. It is still not perfect as it is all squashed in. I have tried various things, that have had no effect such as: - tweaking the scale-9 borders in the .fla symbol - setting verticalGap in the style - setting borderThickness in the style This is very frustrating as there only seems to be 1 definitive document on skinning[1] which doesn't cover detailed concepts like how to structure the .fla symbols. [1] http://www.adobe.com/devnet/flex/articles/flex_skins.html (also documented in Flex Help) Where could I find out more information on skinning? Regards Tracy
[flexcoders] Re: Skinning in Flex - What a nightmare!!!
Thanks Maxime There's some good resources there, I'll definitely check them out. I also found this Flex 3 bug in teh meantime: https://bugs.adobe.com/jira/browse/SDK-15131 http://bugs.adobe.com/jira/browse/SDK-14806 Cheers Tracy --- In flexcoders@yahoogroups.com, maximecowez [EMAIL PROTECTED] wrote: I've been doing my own first steps in skinning lately. I found the ScaleNine blog http://www.scalenine.com/to be very helpfull. And are you using the Flex Skin Design extensions https://www.adobe.com/cfusion/entitlement/index.cfm?e=flex%5Fskins already? (you need an Adobe account to download) They really make life easier. But I have to say: I'm still having trouble with Panel skins too. --- In flexcoders@yahoogroups.com, polestar11 polestar11@ wrote: Please help There is virtually no documentation on Flex skinning. I am really struggling with border sizes and content sizes with custom skins, in particular Panel skins using the borderSkin property. I'm currently trying to skin an Alert box. I have the following properties set: Alert { color:#ff; borderSkin: Embed(source=flex_skins.swf, symbol=Panel_popupSkin2); headerHeight: 30; paddingTop: 20; paddingBottom: 4; } My content only just fits, after much pixel pushing. It is still not perfect as it is all squashed in. I have tried various things, that have had no effect such as: - tweaking the scale-9 borders in the .fla symbol - setting verticalGap in the style - setting borderThickness in the style This is very frustrating as there only seems to be 1 definitive document on skinning[1] which doesn't cover detailed concepts like how to structure the .fla symbols. [1] http://www.adobe.com/devnet/flex/articles/flex_skins.html (also documented in Flex Help) Where could I find out more information on skinning? Regards Tracy
[flexcoders] Is this a performance gain?
Hi there Is the follwing actually slightly faster or is it pretty much the same when referencing object functions in a loop? var f:Function = obj.getValue; // bring function to this level var val:Number; for(var i:int=0; i1; i++) { val = f(i); } VERSUS var val:Number; for(var i:int=0; i1; i++) { val = obj.getValue(i); }
[flexcoders] Re: Custom skinning and strokes
Anyone??? --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi there I have a question about implementing a custom skin for a panel, and components in general. How does using strokes affect the layout of the skins? I'm having trouble getting my custom skins (eg. Panel with ControlBar) to line up exactly. I suspect it might have something to do with using strokes in the skin asset. Reading up on skinning, they say it's best practice to snap to integers for width heights of assets. But lines are sometimes not a pixel thick, so how does one offset these - particularly for the case of scale-9 (where I'm experiencing the lining up issues) Cheers Tracy PS Using the latest Flex 3.
[flexcoders] Custom skinning and strokes
Hi there I have a question about implementing a custom skin for a panel, and components in general. How does using strokes affect the layout of the skins? I'm having trouble getting my custom skins (eg. Panel with ControlBar) to line up exactly. I suspect it might have something to do with using strokes in the skin asset. Reading up on skinning, they say it's best practice to snap to integers for width heights of assets. But lines are sometimes not a pixel thick, so how does one offset these - particularly for the case of scale-9 (where I'm experiencing the lining up issues) Cheers Tracy PS Using the latest Flex 3.
[flexcoders] UIComponent children, preventing scale on parent scale
Hi there I have a UIComponent that has a collection of Bitmap children. I want parts of these children to not scale when the parent container scales (i.e. scale-9 for these children). I have set scale-9 for each child instance, but they still scale when the parent. I can simulate this scenario using a Canvas with linkbuttons as children, where the linkbutton icon is the bitmap that shouldn't scale. I could do it this way, but I rather want to have this at a lower level - on a UIComponent level. Cheers Tracy
[flexcoders] Creating a constantly pressed button - reptative firing of Mouse_Down event?
Hi there How would one set up events on a button so that a function can be called while it is in the pressed state? For example, I want an item on the stage to scale while I hold down the Scale button. Mouse_Down is only called once. I tried setting up Mouse_Over events in the mouseDownHandler, but this didnt do anything. Any suggestions? Tracy
[flexcoders] Re: Creating a constantly pressed button - reptative firing of Mouse_Down event?
--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: autoRepeat=true, and listen for buttonDown, not mouseDown THANKS!
[flexcoders] Container scaling and child icons
Hi there I have a set of linkbuttons within a container. These linkbuttons have icon images that I want to maintain their size when the container scales. Is there any way to easily do this? Cheers Tracy
[flexcoders] Re: Container scaling and child icons
--- In flexcoders@yahoogroups.com, Sherif Abdou [EMAIL PROTECTED] wrote: set the width and height property on them I do already set the width height of the linkbuttons, but they would still automatically scale when being included in a parent container that scales. There seems to be no icon width / height properties to set.
[flexcoders] NetStream - any way to play bytes
Hi Is there any way that a Netstream class can play bytes in memory, rather than referencing a filename? Cheers Tracy
[flexcoders] VideoDisplay over RTMP - Not possible?
Hi I've run into a seemingly common problem of setting videoDisplay source to an rtmp stream. I get the following exception as soon as the video-display's play is triggered: ArgumentError: Error #2126: NetConnection object must be connected. at flash.net::NetStream/construct() at flash.net::NetStream() at VideoPlayerNetStream()[E:\dev\flex_3_beta3\sdk\frameworks\projects\framework\src\mx\controls\videoClasses\VideoPlayer.as:2882] I found the following URL that refers to a race condition: http://www.jlacivita.com/2007/11/14/race-conditions-in-flex-videodisplay/ I tried their monkey patch, but was still not able to get around the problem. Tracing through the Flex code I found a very interesting snippet of code in NCManagerConnectClient.onBWDone which invokes an onConnected method passing a net-connection object that is not actually connected. This continues to the VideoPlayer.ncConnected method which tries to connect the stream on the net-connection object that is not actually connected. Possible Solution: Dont use VideoDisplay for RTMP, build your own? Cheers tracy
[flexcoders] VideoDisplay.totalTime is 0
Hi there With Flex3B3 I am trying to init a slider bar to have a max value of a videoDisplay.totalTime value. I have bound it to the value, but it always returns 0. It looks like the value only gets initialized once the video has played through once, even though i only do the init on progress load complete. Event tracing the value out in a plahead-update event renders 0 until the end: trace(videoPlayer.playheadTime, videoPlayer.totalTime) 0.285 0 0.534 0 0.847 0 1.108 0 1.355 0 ... 180.885 0 181.11 0 181.435 0 181.715 0 181.974 0 182.1 182.1 0 182.1 How could I get this value without playing through the video once?
[flexcoders] Flex 3 Dynamic Button Width - No longer supported?
Hi I posted this before, but am trying again for a response: After upgrading to Flex3Beta3, Button labels get truncated in the over state. The only way around this seems to be by setting explicit button width. Tweaking padding doesnt have any effect. Does Flex no longer support dynamic button widths? Tracy
[flexcoders] Re: Flex 3 Dynamic Button Width - No longer supported?
- Solved! Looks like it was a scale-9 skinning issue, where I had exactly the same sized/placed symbol for the up over states, but the horizontal scale-9 was slightly different. Solution: Duplicate the over-skin symbol replace the new symbol with the up-skin rename the new symbol appropriately, deleting the old one. Result is a new symbol, with the exact same scale-9 values. --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi I posted this before, but am trying again for a response: After upgrading to Flex3Beta3, Button labels get truncated in the over state. The only way around this seems to be by setting explicit button width. Tweaking padding doesnt have any effect. Does Flex no longer support dynamic button widths? Tracy
[flexcoders] Re: LinkButton textSelectedUpColor ???
Hi Kevin I ran into the same problem managed to get around it with the following hack. Basically having 2 style declarations for the selected unselected states dynamically determining the stylename: mx:LinkButton id=viewLibrary label=LIBRARY styleName={(viewLibrary.selected) ? 'linkSelected' : 'link'} toggle=true / Tracy --- In flexcoders@yahoogroups.com, Kevin [EMAIL PROTECTED] wrote: I have a link button set to toggle and I would like to set the text color to be different when it has been selected. I can set textSelectedColor, but that only shows when the mouse is down. It seems like I need a textSelectedUpColor and textSelectedOverColor in the same way there is a selectedUpIcon and a selectedOverIcon. Am I missing something here? - Kevin
[flexcoders] Flex Binding Issues
Hi there I've run into binding issues with Flex 3B3. I have the following setup: - TitleWindow with a singleton TitleWindowController that gets initilaized in TitleWindow.onInitialize() - DetailsWindow which sits inside TitleWindow and has a getter / setter of 'controller' for TitleWindowController. It also contains a Text component whose text value is bound to TitleWindowController.instance.currentItem.title. Binding is set throughout the chain of references. I have this exact same setup 1 level higher, which works fine. Setting a breakpoint in DetailsWindow at the line: mx:Text id=titleField text={controller.currentItem.title} / confirms that controller.currentItem.title has been set. For some reason the Text.text is not updating. I have tried various methods like myDetailsWindow.validateNow() and .invalidateProperties() once I have set currentItem, but nothing happens. Tracy
[flexcoders] Re: Flex Binding Issues
... one more note ... If I explicitly bind the properties using BindingUtils in the DetailsWindow.onCreationComplete event like: private function onCreationComplete():void { BindingUtils.bindProperty(this, controller, TitleWindowController.instance.view, controller); } ... binding works Strange --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi there I've run into binding issues with Flex 3B3. I have the following setup: - TitleWindow with a singleton TitleWindowController that gets initilaized in TitleWindow.onInitialize() - DetailsWindow which sits inside TitleWindow and has a getter / setter of 'controller' for TitleWindowController. It also contains a Text component whose text value is bound to TitleWindowController.instance.currentItem.title. Binding is set throughout the chain of references. I have this exact same setup 1 level higher, which works fine. Setting a breakpoint in DetailsWindow at the line: mx:Text id=titleField text={controller.currentItem.title} / confirms that controller.currentItem.title has been set. For some reason the Text.text is not updating. I have tried various methods like myDetailsWindow.validateNow() and .invalidateProperties() once I have set currentItem, but nothing happens. Tracy
[flexcoders] Flex 3Beta3 and Button width
After upgrading to Flex3Beta3 I'm finding that Button labels get truncated in the over state. I have changed the padding left right properties, but this seems to have no effect. After reading this post: http://butterfliesandbugs.wordpress.com/2007/06/12/flex-3-and-backwards-compatibility-bugs-and-how-to/#comment-1125 ... I found only way I can get around this problem is by explicitly setting the button width. It's going to be a big job trawling through the code setting the width seems un-intuitive. Any suggestions? Tracy
[flexcoders] Preloader - only shows after app has loaded
Hi I have an app that's approx. 2MB big was using the default Flex preloader, which has suddenly stopped working. I have confirmed this by throttling my app with Charles. While my app loads, there is a blank screen. Once the swf has loaded, the preloader displays for a short few seconds then my app displays. I made a custom preloader, hooking into the various events. This had exactly the same effect. It only displayed after the swf had loaded. I am using Flex 3 Beta 3. Cheers Tracy
[flexcoders] Re: Preloader - only shows after app has loaded
Hi again There's no distinct version at which it stopped working, so rolling back could be a very long ardious process. At some point I did some changes to initialization of various classes / loading configs, in the initialization stage. I'm not sure if this can affect the pre-loader? Clearing the browser cache results in the same behavior --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Monday 21 Jan 2008, polestar11 wrote: preloader, which has suddenly stopped working. What had you just changed ? Roll back in your version control and trya some older versions. Does clearing the browser cache help at all ? -- Tom Chiverton Helping to seamlessly innovate unique customers on: http://thefalken.livejournal.com 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. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. 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.
[flexcoders] AIR - notifyUser ... expected behaviour?
Hi I have an AIR app that minimizes to the system-tray, displaying an icon. When calling stage.nativeWindow.notifyUser(NotificationType.INFORMATIONAL); ... I expect the icon to do something exciting, but it stays exactly the same. Debugging the app confirms that the function is being called. Is there anything else I need to do to trigger an effect on the icon, and what would the effect be? I have also tried setting multiple icons in the bitmap array. Cheers Tracy
[flexcoders] Re: AIR app wrapper - Strange UI behaviour
Ok ... solved the problem The exceptions prevented parts of the from initializing, including the MenuBar. I still have the styling issues - it looks like AIR overwrites some of the Flex app's skin / styles. Also, is there a way to get around the SecuritySandbox violation when loading a remote SWF file with an AIR app? --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi I'm using an AIR app to wrap an existing Flex app. I do this via loading the Flex app swf with SWFLoader. I'm finding the following issues: 1) Some styles / custom skins do not appear (only some, which is strange) 2) I have a large amount of padding around my app content, despite setting all padding to 0 3) My MenuBar control is no longer visible 4) Some click actions don't fire (this could be due to an exception blocking them from being hooked up) What could be causing the 1st 3 points, especially point 3 with the MenuBar? Also, I read that there were security sandbox issues with loading a SWF file remotely via an AIR app. Is this currently possible? Cheers Tracy
[flexcoders] AIR app wrapper - Strange UI behaviour
Hi I'm using an AIR app to wrap an existing Flex app. I do this via loading the Flex app swf with SWFLoader. I'm finding the following issues: 1) Some styles / custom skins do not appear (only some, which is strange) 2) I have a large amount of padding around my app content, despite setting all padding to 0 3) My MenuBar control is no longer visible 4) Some click actions don't fire (this could be due to an exception blocking them from being hooked up) What could be causing the 1st 3 points, especially point 3 with the MenuBar? Also, I read that there were security sandbox issues with loading a SWF file remotely via an AIR app. Is this currently possible? Cheers Tracy
[flexcoders] Local Shared Object alternative?
Hi there What do you do if your users want to avoid detection and update their Flash Player settings and set Local Storage to 0, making any user-based information stored as a LSO not possible? Are there any alternatives to LSO's? Cheers Tracy
[flexcoders] Re: Local Shared Object alternative?
We check which users are coming from a certain PC. This helps us detect multiple user accounts and potential cheaters. It's not 100% failproof, but coupled with other information it gives us a pretty good idea. Are there any alternatives to LSO's for storing session information on a PC? --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Wednesday 16 Jan 2008, polestar11 wrote: What do you do if your users want to avoid detection and update their Flash Player settings and set Local Storage to 0, What sort of detection does this avoid, and why don't your users trust you (something must have made them go and change the default settings, in a place normal users wont encounter often) ? -- Tom Chiverton Helping to competently mesh virtual eyeballs on: http://thefalken.livejournal.com 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. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. 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.
[flexcoders] FlexBuilder 3 Beta 3 - Overstate causes resizing effect
Hi there I upgraded from FlexBuilder 3 Beta 2 to Beta 3 and am suddenly getting some strange rendering / sizing issues, particularly for over states of buttons and scrollbars. Buttons: In some cases my over-state for buttons results in the label to move slightly to the left the button size shrinks slightly, resulting in any other relatively placed component to move left. Scrollbars: When moving from down back to over-state (over - press - release - over), the scrollbar moves slightly to the left. Also, the thumb-track from up to over state moves down quite a bit. I've tried all sorts of things with tweaking the scrollbar .fla symbols (not much to do other than check size, position and scale-9). This used to work perfectly and suddenly broke with Beta 3, so it must be a framework issue? Please help! Tracy
[flexcoders] Re: How does scale-9 placement affect the size of a border-skin?
How is it coded - what are the simple rules to follow when using scale-9? Is there any reference? --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Yeah, that's the way it is coded right now. It might change before Flex 3 ships, but don't count on it From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of polestar11 Sent: Wednesday, January 09, 2008 5:51 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] How does scale-9 placement affect the size of a border-skin? Hi there I've created some custom skins for various components, eg. Canvas.borderSkin myTabStyleName.upSkin. I find that the placement of the scale-9 grid lines affects the size of the way the component renders the skin and sometimes even the component size. For example ... if I place the scale-9 horizontal lines of the swf resource for 'myTabStyleName' upSkin very close together in the centre, it doubles the size of my tab button. Similarly, for a canvas, when setting the borderSkin style, there might be a small bit of the skin asset stretching over the component size, or sometimes doesnt fill it completely, depending on where the scale-9 lines are placed. I have manged to tweak the various skins so that the scale-9 grid placement results in the correct rendering, but this is a very tedious process. And I have had to do this all over again, after upgrading to the new Flex 3 Beta 3. It would really help to know how scale-9 placement affects border calculations. Does anyone know anything more about this, or if there are any in-depth resources on this topic? Cheers Tracy
[flexcoders] Re: FlexBuilder 3 Beta 3 - Overstate causes resizing effect
I managed to solve my scrollbar problem, by tweaking the .fla symbols. I put the scale-9 outside the vertical areas for all resources. I'm still struggling with my buttons though. I tried setting the padding amounts, which worked in 1 area, but not in others Any suggestions? --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi there I upgraded from FlexBuilder 3 Beta 2 to Beta 3 and am suddenly getting some strange rendering / sizing issues, particularly for over states of buttons and scrollbars. Buttons: In some cases my over-state for buttons results in the label to move slightly to the left the button size shrinks slightly, resulting in any other relatively placed component to move left. Scrollbars: When moving from down back to over-state (over - press - release - over), the scrollbar moves slightly to the left. Also, the thumb-track from up to over state moves down quite a bit. I've tried all sorts of things with tweaking the scrollbar .fla symbols (not much to do other than check size, position and scale-9). This used to work perfectly and suddenly broke with Beta 3, so it must be a framework issue? Please help! Tracy
[flexcoders] How does scale-9 placement affect the size of a border-skin?
Hi there I've created some custom skins for various components, eg. Canvas.borderSkin myTabStyleName.upSkin. I find that the placement of the scale-9 grid lines affects the size of the way the component renders the skin and sometimes even the component size. For example ... if I place the scale-9 horizontal lines of the swf resource for 'myTabStyleName' upSkin very close together in the centre, it doubles the size of my tab button. Similarly, for a canvas, when setting the borderSkin style, there might be a small bit of the skin asset stretching over the component size, or sometimes doesnt fill it completely, depending on where the scale-9 lines are placed. I have manged to tweak the various skins so that the scale-9 grid placement results in the correct rendering, but this is a very tedious process. And I have had to do this all over again, after upgrading to the new Flex 3 Beta 3. It would really help to know how scale-9 placement affects border calculations. Does anyone know anything more about this, or if there are any in-depth resources on this topic? Cheers Tracy
[flexcoders] Re: FlexBuilder 3 Beta 2 charting and license
Hi there We purchased FlexBuilder 2 with Charting used the serial number for FlexBuilder 3. This removed the watermark. Now we are running a later build version of FlexBuilder 3 and the watermark has re-appeared. Is there anything we can do to get rid of this? Cheers Tracy B --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: I've applied my Flex 2.0 charting license key to Flex 3.0 beta2 and still see the watermark on the AdvancedDataGrid. Is this expected behavior?
[flexcoders] Re: Any way to cast a string reference of a class name to its Class equivallent
Thanks! --- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote: There is a getDefinitionByName() function (not method) in the flash.utils package which will give you a Class reference if you give it a fully qualified class name like mx.controls.Button. However, if the class doesn't actually exist in your application or in the Player, it will return null. So you must ensure that classes you want to look up by name actually get linked in. A common way to do that is to declare a static var of that type, even if you don't use this var. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of polestar11 Sent: Wednesday, December 19, 2007 4:05 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Any way to cast a string reference of a class name to its Class equivallent Hi there I have a list of class names stored as strings in an xml file. Is there any way to cast them to actual class items programatically once the file has loaded. Eg. item classname=aClass/ // in code myComponent.setStyle(icon, Class([EMAIL PROTECTED])); Cheers Tracy
[flexcoders] Any way to cast a string reference of a class name to its Class equivallent
Hi there I have a list of class names stored as strings in an xml file. Is there any way to cast them to actual class items programatically once the file has loaded. Eg. item classname=aClass/ // in code myComponent.setStyle(icon, Class([EMAIL PROTECTED])); Cheers Tracy
[flexcoders] Re: Scale 9 not being picked up
Hi Juan Our ScrollBar arrow turned out to be a Bitmap, so you were right about scale-9 not being picked up for Bitmaps. Changing that to a vector fixed it. The scale-9 issue seems to only be a problem for ComboBoxes. Our ComboBox arrows are vectors and we are developing in FlexBuilder 3 Beta 2. Is it possible that the Flex 2 bug still exists for some cases in FlexBuilder 3? I use the same arrow now for our scroll-bar, which works fine in the ScrollBar case, but not the ComboBox. Cheers Tracy --- In flexcoders@yahoogroups.com, scalenine [EMAIL PROTECTED] wrote: Are you using bitmaps as skins in your Flash file? If so, I don't believe scale-9 will punch through to those bitmaps in either scenario. You would have to pull those bitmaps out of the Flash file as separate assets. Regarding the arrow getting stretched, are you using Flex 2? The reason I ask is because in Flex 2 the arrow icon has to be part of the ComboBox, thus it will stretch even with scale-9 applied to it. You could try to change this by setting both vertical scale grids above o below the arrow. However, if you are using rounded corner those would end up getting stretched. Other wise you might have to create different skins for ComboBoxes with different heights. I believe the issue is being resolved in Flex 3 with a new property called arrowIcon making the icon separate from the skin so the skin scales separately from the arrowIcon. I'm not sure about the ScrollBars. I've found that sometime adjusting the scale grids on the ScrollBar arrow skins can fix the issue. HTH, Juan
[flexcoders] Re: Scale 9 not being picked up
Eureka!! I found a fix to our ComboBox problem, after reading about this bug: https://bugs.adobe.com/jira/browse/SDK-12803 Our ComboBox symbol comprised of the arrow button symbol used in the editable ComboBox skin. For the non-editable ComboBox skin I took out this reference by creating a new symbol for the arrow button (just by breaking the symbol apart, rendering it in the same raw state as for the editable ComboBox arrow) and wallah, it works! --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi Juan Our ScrollBar arrow turned out to be a Bitmap, so you were right about scale-9 not being picked up for Bitmaps. Changing that to a vector fixed it. The scale-9 issue seems to only be a problem for ComboBoxes. Our ComboBox arrows are vectors and we are developing in FlexBuilder 3 Beta 2. Is it possible that the Flex 2 bug still exists for some cases in FlexBuilder 3? I use the same arrow now for our scroll-bar, which works fine in the ScrollBar case, but not the ComboBox. Cheers Tracy
[flexcoders] Scale 9 not being picked up
Hi There Does anyone have any idea why flash symbols for skinned controls with scale-9 would not be picked up? Specifically arrows for the ComboBoxes and Scrollbars. Scaling the resources in Flash also results in the arrow symbols being scaled incorrectly with no scale-9. Cheers Tracy
[flexcoders] Scale 9 Issues
Hi there We are trying to skin our app and have added skins for ComboBoxes and Scrollbars. We have scale-9 set on the skin symbols for the arrow buttons but for some reason it is not being picked up in our Flex app. I have looked at the default AeonGraphical theme seen that the right side scale-9 for the ComboBoxArrow_editableUpSkin is set far to the right, completely off the button. I've tried various cases of scale-9, like in the AeonGraphical theme how scale-9 should work, setting the scale area to exclude the arrow portion of the drop-down button. I have also tried explicitly setting the scale-9 in the .css, also to no avail. Cheers Tracy
[flexcoders] Re: Actionscript: Copy an Object or Dictionary
Hi Tom That wouldn't work because item is the assigned object in the dictionary not the key, so what you would actually be saying is: newDict[item]=myDict[item], where item would be the key reference in newDict, while myDic[item] is undefined. I eventually gave up trying to iterate through a dictionary assign its child values. The other alternative was to create an array of keys, iterate those assign the dictionary values to the new dictionary. Cheers Tracy --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Friday 30 Nov 2007, polestar11 wrote: for each(item in myDictionary) { newDict[?] = item; } newDict[item]=myDict[item];
[flexcoders] Re: Flex Preloader, not displaying immediately
--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Do you have a custom preloader? If too much code is brought in by the preloader, it will delay it. Hi Alex No, we are using the standard Flex preloader. It seems that the bulk of the flex app / swf is loading before the preloader is displayed. Tracy
[flexcoders] Tab Width Issues when Extending TabBar for TabNavigator
Hi There I am extending the TabNavigator (actually SuperTabNavigator) class and have the corresponding children classes that extend TabBar and Tab (SuperTabBar and SuperTab). What I want to do is include a 2nd text field in my custom tab that is displayed next to the existing textField. I'm getting issues with the Tab width, which seems to be set somewhere outside of measure, where my custom text field's width is not included in the calculation gets cut off. I have managed to get past this problem by including the 'width' property when overriding measure: override protected function measure():void{ super.measure(); width = measuredMinWidth = measuredWidth = measuredWidth + customField.textWidth; invalidateSize(); } Now I'm having the issue of the TabBar size not updating the tabs scroll along the top because they are too large for the parent container. My questions are: a) Is this the correct way in going about updating the tab width, or is there a better way of doing it? b) How would one get the parent containers width to update accordingly. Regards Tracy
[flexcoders] Flex Preloader, not displaying immediately
Hi There I'm experiencing some issues with the default Flex preloader. It used to display immediately in our application but now recently as the app loads there is a blank white screen for the bulk of of the upload the preloader displays for a short instance just before the app load completes. I used Charles to simulate a slow download speed - although not sure how accurate an experience it will present - and it shows a white screen while downloading the bulk of the main swf. I have tried initializing adding the main view to the stage in the onComplete event, but there isnt much difference. Our app is quite large (2mb+) and there are a lot of data connections being made in the app's initialize event. The only things that have changed since we noticed the preloader not appearing immediately is upgrading to FlexBuilder 3 beta 2 and our app getting slightly bigger. Any suggestions? Cheers Tracy
[flexcoders] Actionscript: Copy an Object or Dictionary
Hi there Does anyone know how to iterate through an Object / Dictionary copy child items. I've tried ObjectUtil, but it only copies over object values, not exact values. cheers tracy
[flexcoders] Re: Actionscript: Copy an Object or Dictionary
--- In flexcoders@yahoogroups.com, ben.clinkinbeard [EMAIL PROTECTED] wrote: it only copies over object values, not exact values. Huh? @Tom How would one bind the keys to the new dictionary children? var newDict:Dictionary = new Dictionary(); var item:Class for each(item in myDictionary) { newDict[?] = item; } @ben If I have an object containing types (in my case a collection of Class types referenced by a key string). Using the ObjectProxy.copy(), the new object will contain child objects with the same keys as the original, but the child types are Object types, not Class types.
[flexcoders] Initializing Conainer's children properties
Is there any way to force the initialization of a container's children without adding it to the stage. I have set show hide style effects on children, but these only get initialized if I add them to the stage. I can add then remove the parent container to force these properties to be activated, the only problem with that is it jaggers my application loadup animations because the children are very big. Cheers Tracy
[flexcoders] Re: Overriding inherited skin style
I tried that, but I get the following exception: TypeError: Error #1034: Type Coercion failed: cannot convert null to Class. at mx.core::Container/isBorderNeeded()[E:\dev\flex_3_beta2\sdk\frameworks\projects\framework\src\mx\core\Container.as:4054] --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: borderSkin: null didn't work?
[flexcoders] Re: Overriding inherited skin style
Bingo! The solution was to set the style back to the default, Halo theme: borderSkin: ClassReference(mx.skins.halo.HaloBorder); Thanks Tom --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Wednesday 14 Nov 2007, polestar11 wrote: I tried that, but I get the following exception: borderSkin: ? Or look at the source and see what the default is, and set it back to that. -- Tom Chiverton Helping to collaboratively unleash professional e-tailers on: http://thefalken.livejournal.com
[flexcoders] Overriding inherited skin style
Hi there I have a global Panel style defined, which contains a border-skin swf. I want to be able to turn this off for specific panels. There seems to be no explicit way to turn this off (Eg. boder-skin:none) the only way I have managed so far is to reference a transparent / blank swf as the skin. The problem with this though is background colour is then ignored I get a transparent panel, which I cannot really style. Another alternative is to create the global panel style as a styleName reference it in each component in question. But there are more components using this style than not, so it makes more sense to switch it off for special cases. Here's the code: Panel { borderSkin: Embed(source=flex_skins.swf, symbol=Panel_borderSkin); } CustomPanel { borderSkin: Embed(source=empty.swf, symbol=Panel_titleBackgroundSkin); /*None of the following styles are implemented*/ backgroundColor: #1b2c36; border-alpha:0; border-thickness:0; border-style:none; } Cheers Tracy
[flexcoders] FLV Recorded stream contains strange additional blank space / frames
Hi there We're recorded a series of flv files using getCamera() Red5. Some of our recorded flv's have a chunk of dead video space at the begining. Using RichFLV to analyze the timeline, one can see a few key frames, then a huge chunk of blank space spanning for about 1 minute, then continuing key-frames that follow on from the initial keyframes. This throws out our cue-point calculations because it offsets the video playback time. Help! Tracy
[flexcoders] Re: What do you do when you're waiting for moxie to build?
My Flexbuilder slowness has reached a new record high. After thinking that 3mins was completely unbearable, the new record is approaching 8minutes. This is with all possible attempts / options of setting FB up for optimal build time. I am working with a library project which i build then copy over to my main project which I then build manually, which then takes its record breaking 8mins, even for a small line of code change. Next I debug the project. And of course the whole process has to start over if there was a compiler or runtime error. So, apart from complaining dismally about it, here are the various attempts I have made to improve on build time 1) Uncheck the following Flex Compiler options - Copy non-embedded files to output directory - Verify digests - Enable integration with browser navigation (deeplinking) 2) Turn of 'Build Project Automatically' 3) Reference only SWC's of external library projects, not the projects themselves 4) Make sure un-used projects are closed 5) Build main project manually before debugging it 6) Clear the .metadata folder - this occurs about 3x week, when FB becomes confused unusable 7) Restart FB, restart my computer, delete my files in my Temp folder - this is more out of frustration, no difference has ever come out of these. Is there anything else can I do ... up the memory used by eclipse? Recently my FB has started crashing, a symptom of insufficient memory. I'm running a 2GHz 2GB RAM processor, my library project is 500k, while my main project is 1.8k. Recently there are a lot of fonts being embedded (660k) which brought on this record-breaking time. I have tried using the StyleManager.loadStyleDeclarations to try improve on compilation time, but this brings it's own set of troubles, like my app not loading properly. So what do u do while waiting for moxie to build? Write a long-winded complaintive post about its slowness. I cant wait for the next release!!! Tracy
[flexcoders] [Bindable] not binding
Hi there I've used the [Bindabe] meta-tag 100's of times, but for some reason it seems to have stopped working. I have a very straight-forward setup with a controller, properties and a view. I have a bindable reference to the controller in the view, while the controller has a bindable 'title' property. Setting breakpoints at various steps of the code I can confirm that the 'title' property is bound to the label in the view (titleText.text = My Title), yet it is not displayed. I even tried view.validateNow(); to try force validation / displaying of the label. What could I be doing wrong, is there possibly a bug in the new Flash Player that isnt updating bound properties correctly? This is the 2nd time I've come across this in 3 days. Here is a summary of my code: View.mxml - [Bindable] public var controller: QController; mx:Label id=titleText text={controller.title} fontWeight=bold / QController.as -- [Bindable] public function get title():String { return _title; } public function set title(value: String):void { _title = value; _view.validateNow(); }
[flexcoders] Re: [Bindable] not binding
I instantiate the controller in the controller class, in the view's onCreationComplete event: public function QController():void { _view.addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete); } private function onCreationComplete(e: FlexEvent):void { _view.removeEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete); _view.controller = this; } --- In flexcoders@yahoogroups.com, Sean Sell [EMAIL PROTECTED] wrote: It doesn't look like you instantiate the controller, are you doing that somewhere else in your code? public var controller: QController = new QController(); - Original Message From: polestar11 [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Thursday, September 13, 2007 6:20:12 AM Subject: [flexcoders] [Bindable] not binding Hi there I've used the [Bindabe] meta-tag 100's of times, but for some reason it seems to have stopped working. I have a very straight-forward setup with a controller, properties and a view. I have a bindable reference to the controller in the view, while the controller has a bindable 'title' property. Setting breakpoints at various steps of the code I can confirm that the 'title' property is bound to the label in the view (titleText.text = My Title), yet it is not displayed. I even tried view.validateNow( ); to try force validation / displaying of the label. What could I be doing wrong, is there possibly a bug in the new Flash Player that isnt updating bound properties correctly? This is the 2nd time I've come across this in 3 days. Here is a summary of my code: View.mxml - [Bindable] public var controller: QController; mx:Label id=titleText text={controller. title} fontWeight= bold / QController. as -- [Bindable] public function get title():String { return _title; } public function set title(value: String):void { _title = value; _view.validateNow( ); } !-- #ygrp-mkp{ border:1px solid #d8d8d8;font-family:Arial;margin:14px 0px;padding:0px 14px;} #ygrp-mkp hr{ border:1px solid #d8d8d8;} #ygrp-mkp #hd{ color:#628c2a;font-size:85%;font-weight:bold;line-height:122%;margin:10px 0px;} #ygrp-mkp #ads{ margin-bottom:10px;} #ygrp-mkp .ad{ padding:0 0;} #ygrp-mkp .ad a{ color:#ff;text-decoration:none;} -- !-- #ygrp-sponsor #ygrp-lc{ font-family:Arial;} #ygrp-sponsor #ygrp-lc #hd{ margin:10px 0px;font-weight:bold;font-size:78%;line-height:122%;} #ygrp-sponsor #ygrp-lc .ad{ margin-bottom:10px;padding:0 0;} -- !-- #ygrp-mlmsg {font-size:13px;font-family:arial, helvetica, clean, sans-serif;} #ygrp-mlmsg table {font-size:inherit;font:100%;} #ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean, sans-serif;} #ygrp-mlmsg pre, code {font:115% monospace;} #ygrp-mlmsg * {line-height:1.22em;} #ygrp-text{ font-family:Georgia; } #ygrp-text p{ margin:0 0 1em 0;} #ygrp-tpmsgs{ font-family:Arial; clear:both;} #ygrp-vitnav{ padding-top:10px;font-family:Verdana;font-size:77%;margin:0;} #ygrp-vitnav a{ padding:0 1px;} #ygrp-actbar{ clear:both;margin:25px 0;white-space:nowrap;color:#666;text-align:right;} #ygrp-actbar .left{ float:left;white-space:nowrap;} .bld{font-weight:bold;} #ygrp-grft{ font-family:Verdana;font-size:77%;padding:15px 0;} #ygrp-ft{ font-family:verdana;font-size:77%;border-top:1px solid #666; padding:5px 0; } #ygrp-mlmsg #logo{ padding-bottom:10px;} #ygrp-vital{ background-color:#e0ecee;margin-bottom:20px;padding:2px 0 8px 8px;} #ygrp-vital #vithd{ font-size:77%;font-family:Verdana;font-weight:bold;color:#333;text-transform:uppercase;} #ygrp-vital ul{ padding:0;margin:2px 0;} #ygrp-vital ul li{ list-style-type:none;clear:both;border:1px solid #e0ecee; } #ygrp-vital ul li .ct{ font-weight:bold;color:#ff7900;float:right;width:2em;text-align:right;padding-right:.5em;} #ygrp-vital ul li .cat{ font-weight:bold;} #ygrp-vital a{ text-decoration:none;} #ygrp-vital a:hover{ text-decoration:underline;} #ygrp-sponsor #hd{ color:#999;font-size:77%;} #ygrp-sponsor #ov{ padding:6px 13px;background-color:#e0ecee;margin-bottom:20px;} #ygrp-sponsor #ov ul{ padding:0 0 0 8px;margin:0;} #ygrp-sponsor #ov li{ list-style-type:square;padding:6px 0;font-size:77%;} #ygrp-sponsor #ov li a{ text-decoration:none;font-size:130%;} #ygrp-sponsor #nc{ background-color:#eee;margin-bottom:20px;padding:0 8px;} #ygrp-sponsor .ad{ padding:8px 0;} #ygrp-sponsor .ad #hd1{ font-family:Arial;font-weight:bold;color:#628c2a;font-size:100%;line-height:122%;} #ygrp-sponsor .ad a{ text-decoration:none;} #ygrp-sponsor .ad a:hover{ text-decoration:underline;} #ygrp-sponsor .ad p{ margin:0;} o{font-size:0;} .MsoNormal{ margin:0 0 0 0;} #ygrp
[flexcoders] Re: [Bindable] not binding
--- Sean wrote: Event better would be to do it like cairngorm and create your controller before the view then your view objects well be correctly bound from the beginning. - Me: Modified the code slightly so that the controller is created before the view. Still no luck --- Jon wrote: Shot in the dark and this might be a dumb question, but, are you sure you have the bold weight of the font in your CSS defined? - Me: I thought it might be this, so tried both bold un-bold and still no text ... After all of that, found the problem - My label was in an HBox that was 30px high. Above the label was a linkbutton, also 30px high, so it was all working, you just couldnt see the label *blush* Thanks for the help! Tracy
[flexcoders] Re: @Embed directive in mx:source tag not working for swfs
I have experienced something similar think it is to do with the different paths for design view vs runtime view. Runtime uses the assets in the bin folder while compilation design view use the assets relative to the project folder. Just check that assets are found in both. Alternatively you could change the file path to /resources/flashcs3/PhotoAppTheme.swf' - which should indicate the root folder. I have found this not to always work though. Cheers Tracy --- In flexcoders@yahoogroups.com, tdf0wler [EMAIL PROTECTED] wrote: Does anyone have any insight or a workaround for a problem regarding embedding external swf symbols in mxml files and being able to view said symbols in the design view? We have code like the following: mx:Image height=20 right=6 width=20 top=6 id=columnViewActivate mx:source@Embed(source='../resources/flashcs3/PhotoAppTheme.swf', symbol='ColumnViewActivateButton')/mx:source /mx:Image When we view the mxml in design view the symbol doesn't appear. Has anyone run into a similar problem? Thanks, Thomas
[flexcoders] Flex Fonts: How to implement the Bitmap text (no anti-alias) effect in Flex
Hi there Flash 8 and up provide an option in the property panel for textfields, Bitmap text (no anti-alias). I can use this with embedded fonts to get clear text without depending on the user having the font installed. How do I do this with the Flex compiler? From what I can see, I can only set which of the two anti-alias methods I want to use; I can't seem to say 'don't anti-alias it, but use the embedded font please'! Tracy
[flexcoders] Re: Datagrid auto sorting. Has anyone done this?
Thanks Alex My sort was pretty simple straight-forward, but I was doing something wrong. So eventually I ended up sub-classing the header renderer like you suggested got it to work well. I actually used your Custom Header Renderer example to get me started: http://blogs.adobe.com/aharui/CheckBoxHeader/dg.swf Cheers Tracy --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: In theory, the sortArrow will show if the dataProvider has a valid sort property with a single sortField that describes the sorted column. If you did a more complex sort, you might be better off drawing custom header renderers that better depicts the complex sort.
[flexcoders] Re: Datagrid auto sorting. Has anyone done this?
Hi there I tried exactly that in various different ways, but wasnt able to get it to work. I have an array, which I convert to an array collection, on which I sort and refresh, after which I set as a dataProvider for my DataGrid. Still no sort arrow is shown. I then tried extending the DataGrid class, but that opened up another can of worms Help, anyone?? Tracy --- In flexcoders@yahoogroups.com, Manish Jethani [EMAIL PROTECTED] wrote: On 4/28/07, Mark Piller [EMAIL PROTECTED] wrote: Do you know how to configure a datagrid to automatically sort in a particular column before the data is rendered? Basically you just set the sort on the collection, and the DataGrid will appropriately display a sort arrow on the header. So it's the collection you need to sort. You can see an example of how to sort a collection here: http://www.adobe.com/livedocs/flex/2/langref/mx/collections/Sort.html
[flexcoders] Detect focusOut on Application / Stage
Hi there I would like to detect a user entering and exiting a Flex app. My initial assumption was to use FocusIn/Out on either the generic stage / application objects: stage.addEventListener( FocusEvent.FOCUS_IN, onFocusIn ); stage.addEventListener( FocusEvent.FOCUS_OUT, onFocusOut ); This appeared to work initially, but actually the events are triggered when focus changes within components on the stage. The only other option I can think of is the mouseLeave event for stage. The only problem with this is that it is too broad. I'm specifically looking for focus in / out the app, not a mouse leaveing the app, while the app still has focus. Any help much appreciated Cheers Tracy
[flexcoders] Error 2025 with images
Hi there This question was previously asked on Flexcoders and not addressed: http://tech.groups.yahoo.com/group/flexcoders/message/64576 I have dug futher into the problem know what may be causing it. Here is a description of the problem: I load html text into a textarea. I then edit the text try to set a new htmlText value to the textarea, which results in the following exception: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.text::TextField/set htmlText() This only happens if my htmlText contains an 'img' tag. What I think is happening is that the player is struggling to delete the old image object that was created thought the 'img' tag, possibly because it isnt an explicit child of the textarea. The only way that I have found to get around it is by dynamically creating deleting a textarea: http://www.actionscript.org/forums/showthread.php3?t=85011 This solution is not ideal since my textarea is quite intricately defined in my MXML markup. Does anyone know of a better cleaner solution? Cheers Tracy
[flexcoders] Re: Auto-expand Treenodes - ValidateNow - THANKS!!
I've also been having serious problems with tree nodes: auto-expanding child nodes and setting (highlighting) a selected node. MyTree.validateNow() was the answer to getting all of this working. What I did to get it working was: 1) Search my dataProvider for a particular item (returning an XMLList) Eg: var selectedNode:XMLList = MyTree.dataProvider.descendants().(attribute(title) == [EMAIL PROTECTED]) 2) MyTree.selectedItem = selectedNode 3) MyTree.validateNow() 4) MyTree.expandItem( MyTree.selectedItem, true ) Cheers Tracy --- In flexcoders@yahoogroups.com, codemonkey666 [EMAIL PROTECTED] wrote: validateNow Thank you very much Jonas! I have been trying to get this (auto-expand) working for a while now, and there was a timing issue. The key is Tree.validateNow(). Ahh
[flexcoders] Re: Error 2025 with images?
--- In flexcoders@yahoogroups.com, John Wilker [EMAIL PROTECTED] wrote: I'm working on a quicky little RSS Reader and having some trouble. I've got a DG on one side, which then populates a textArea on the other side. Here's the feed (mine) http://www.red-omega.com/blog/rss.cfm?mode=full When I hit the entry Blogito Ergo Sum when I click to entry in the DG I get the below. It seems to happen when entries have images linked from other sites. [SWF] Users:johnwilker:Documents:Flex Builder 2:360FlexRSS:bin: main-debug.swf - 972,300 bytes after decompression getting the feed: http://www.red-omega.com/blog/rss.cfm?mode=full You Selected index: 7 You Selected index: 8 ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.text::TextField/set htmlText() at mx.core::UITextField/sethtmlText()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UITextField.as:319] at mx.controls::TextArea/mx.controls:TextArea::commitProperties ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\TextArea.as:1841] at mx.core::UIComponent/validateProperties ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent.as:5300] at mx.managers::LayoutManager/mx.managers:LayoutManager::validateProperties ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\managers\LayoutManager.as:517] at mx.managers::LayoutManager/mx.managers:LayoutManager::doPhasedInstantiation ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\managers\LayoutManager.as:667] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher2 ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent.as:7909] at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher ()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent.as:7852] at flash.utils::Timer/flash.utils:Timer::_timerDispatch() at flash.utils::Timer/flash.utils:Timer::tick() I am getting the same error. It happens when I dynamically set my htmlText property the 2nd time round. The 1st time round it displays the images and doesnt throw an error.
[flexcoders] Tree labelField and hiding leaf nodes
Hi there I have a Tree component that I feed in XML as its dataProvider. I clean up this XML data before passing it too the tree by adding a new attribute @nodeName to nodes that should be displayed. My assumption is that nodes without this field would not be displayed, but what actually happens is that the text for that [leaf] node is displayed instead. The only other option I can think of to hide a node is to delete it. This is not an option since I would still like to have a reference to it when I select its parent, I just dont want it to appear in the tree view. Any ideas? Tracy
[flexcoders] HDividedBox - on-release-outside + updateAfterEvent problems
Hi there I have an HDividedBox control that divides 2 children that resize with dragging. There are 2 issues that I am having with this control: 1) the updates to the child container sizes dont occur simultaneously, resulting in visual errors of size position (which are fixed when dragging stops) 2) when I release my mouse outside of the application, the drag control of the HDividedBox still has focus, leading to incorrect sizing when the mouse moves back into the app. I managed to solve the 1st issue by setting a MOUSE_MOVE event on the divider and calling updateAfterEvent() I tried to address the 2nd by adding MOUSE_UP and MOUSE_DOWN events to capture the 'on-release-outside' state, which they do, but the divider still has focus. I went a step further and dispatched a DividerEvent.DIVIDER_RELEASE event from teh MOUSE_UP state, which is caught by the divider, however, the state of the divider still doesn't change it still has focus ... Any advice?? Thanks Tracy
[flexcoders] Bitmap or BitmapData used for backgroundImage
Hi there I want to know if its possible to use Bitmap or BitmapData for the backgroundImage style property of a Flex Container component. My reason for this is that I store all my styling assets in a swf file have a method that extracts them as MovieClips transforms them into Bitmaps. An alternative would be to call the graphics.beginBitmapFill method on that component redraw it accordingly when the component resize, which seems like too long a way round. Any ideas? Tracy
[flexcoders] Re: Importing mx packages into AS3 project
Hi Gordon The components I'm using are: - Button - Combobox - Accordion - Label The Flex project contains the exact same code as the AS3 project, with an additional custom component that uses the above-mentioned controls. The AS3 project is 162KB The Flex project size is 485KB I think the bloat is due to the Flex project itself requiring the Flex framework. Unfortunately I didnt get the external project referencing working for an AS3 to refrence a Flex project so that I could extract only the neccessary controls outside of the framework. Cheers Tracy --- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote: This is a surprising amount of bloat. Do you have a list of the framework components that you're using? - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of polestar11 Sent: Friday, February 02, 2007 1:07 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Importing mx packages into AS3 project Thanks Gordon I eventually ended up converting to an mx project, which bloated my app from 162K to 480K. At the moment size isnt an issue and I have gone for the ease of development over size. Customizing the flex component code is an option I havent considered yet, thinking that my only hopes were either to re-invent the wheel or wait for the flash 9 compontents to come out. So I'll enjoy the simplicity of Flex while I can :) Cheers Tracy --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Gordon Smith gosmith@ wrote: It sounds like you want components which are both very rich and very lightweight. If we knew how to do that, we'd write the Flex components that way. : ) Seriously, athough we've tried to balance these concerns in the Flex framework components, we realize that they don't meet everyone's needs. Iff you're extending Button, then you're bringing in significant chunks of the Flex framework, because even a lowly Button supports measurement, layout, CSS, skinnability, focus management, tooltips, etc. The source code for our components is freely available. You might want to consider starting with ours and trimming out the functionaliry you don't need rather than starting from scratch. - Gordon
[flexcoders] Re: Importing mx packages into AS3 project
To the best of my knowledege this is done through: Project-Properties-Flex Compiler-Additional compiler arguments: -debug=false I have done this for both projects. Debug files are still created for both despite this option being specified. My Flex project is reduced to 440KB (vs 485KB), which is still pretty big Cheers Tracy --- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote: On Saturday 03 Feb 2007, Gordon Smith wrote: This is a surprising amount of bloat. Do you have a list of the framework components that you're using? And the debug flag turned off ? -- Tom Chiverton Helping to ambassadorially maintain 24/7 e-markets
[flexcoders] Re: Importing mx packages into AS3 project
Thanks Gordon I eventually ended up converting to an mx project, which bloated my app from 162K to 480K. At the moment size isnt an issue and I have gone for the ease of development over size. Customizing the flex component code is an option I havent considered yet, thinking that my only hopes were either to re-invent the wheel or wait for the flash 9 compontents to come out. So I'll enjoy the simplicity of Flex while I can :) Cheers Tracy --- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote: It sounds like you want components which are both very rich and very lightweight. If we knew how to do that, we'd write the Flex components that way. : ) Seriously, athough we've tried to balance these concerns in the Flex framework components, we realize that they don't meet everyone's needs. Iff you're extending Button, then you're bringing in significant chunks of the Flex framework, because even a lowly Button supports measurement, layout, CSS, skinnability, focus management, tooltips, etc. The source code for our components is freely available. You might want to consider starting with ours and trimming out the functionaliry you don't need rather than starting from scratch. - Gordon
[flexcoders] Importing mx packages into AS3 project
Hi there I have an AS3 project want to use the rich Flex components (since AS3 components are non-existant and I dont feel like re-inventing the wheel). I recently discovered that u can only use these in a Flex project. The reasons why I wanted an AS3 project was to leave out all the heavy stuff that a Flex project brings along. So I thought that I could cheat, but it looks like it isnt working ... I created a new Flex project, where I created a FlexButton AS3 class that extends mx.controls.Button. I referenced this project in my pure AS3 project, in the hopes of it loading the button compontents all its useful functionality. It looks like this isnt going to work, getting the error in my Flex project: The definition of base class Button was not found. Can anyone confirm that this is not possible. Has anyone found a solution to rich widget controls for pure AS3 projects? Cheers Tracy
[flexcoders] Re: TextField.embedFont strange behavior
--- In flexcoders@yahoogroups.com, Daniel Freiman [EMAIL PROTECTED] wrote: I hate to ask a stupid question, but are you sure the entire font (or at least the Latin characters) is embedded? How are you embedding the font? Hi Daniel I wasnt embedding the font at all other than specifying the embed property, since I assumed that it was done automatically through the compiler. There was another part in my app where I was manually embedding Verdana letters A-H. So it turns out that one has to manually specify font embedding, typically via an embed tag: [Embed(source=C:/WINDOWS/Fonts/Verdana.ttf, fontFamily=Verdana)] Googling this I also found a lot more on the topic, and of course (rtfm) the help files :) http://www.tink.ws/blog/embedding-fonts-in-as3/ http://www.db75.com/new_blog/?p=114 Cheers Tracy
[flexcoders] TextField.embedFont strange behavior
Hi there I'm getting a strange error when dynamically adding a TF and turning on the embedFonts property. Without the property turned on, all the text is displayed, but with embedFonts set to true I only see the text up to 'ABCDEFGH'. This is very odd behavior, am I missing something blatantly obvious? Code: var fmt:TextFormat = new TextFormat() fmt.font = Verdana fmt.color = 0x99 var toc:TextField = new TextField() toc.antiAliasType = AntiAliasType.NORMAL toc.autoSize = TextFieldAutoSize.LEFT toc.selectable = false toc.multiline = true toc.defaultTextFormat = fmt toc.embedFonts = true Tracy
[flexcoders] Re: Multiple classes per package
Thanks, Claus That's exactly what I was looking for. Tracy -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: Multiple classes per package
--- In flexcoders@yahoogroups.com, Claus Wahlers [EMAIL PROTECTED] wrote: Use the 'internal' access modifier: // File mypackage/MainClass.as package mypackage { public class MainClass { // .. } } // File mypackage/HelperClass.as package mypackage { internal class HelperClass { // .. } } Thanks Claus I was meaning more whether it is possible to put 2 classes in 1 .as file, within a single package definition. So far, it looks like this is not possible. Regards Tracy -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Multiple classes per package
Hi there Does anyone know if Actionscript 3 and Flexbuilder2 support multiple classes per package, where only 1 class is declared as public, while the remaining classes are only available inside the package? Eg. package mypackage { public class MainClass { public function MainClass() {} } class HelperClass { public function HelperClass() {} } } Tracy -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Embed an image for a Sprite
Hi there How does one attach an image to a sprite class? I have tried the following example, but nothing gets displayed on the screen: package { import flash.display.Bitmap; import flash.display.Sprite; public class MySprite extends Sprite{ [Embed(source='/assets/board.png')] public var MyPhoto:Class; function MySprite() { var pic:Bitmap = new MyPhoto(); this.addChild(pic); } } } Thanks Tracy -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: Embed an image for a Sprite
Ok, I managed to figure out what the problem was from a previous post - one cannot add a sprite directly to a container, one has to first add it to a UIComponent type. Anyone with more info / experience with this? Cheers Tracy --- In flexcoders@yahoogroups.com, polestar11 [EMAIL PROTECTED] wrote: Hi there How does one attach an image to a sprite class? I have tried the following example, but nothing gets displayed on the screen: package { import flash.display.Bitmap; import flash.display.Sprite; public class MySprite extends Sprite{ [Embed(source='/assets/board.png')] public var MyPhoto:Class; function MySprite() { var pic:Bitmap = new MyPhoto(); this.addChild(pic); } } } Thanks Tracy -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Event listeners: Removing a listener prevents future added listeners
Hi there I'm struggling with a series of KeyboardEvents. Here is the scenario: - I have mouse-down and mouse-up event listeners for my UIComponent. - In the mouse-down event I add a new listener for key-up(so that I can capture mouse-down + a key pressed) - I remove the key-up listener in the mouse-up event The functionality works fine for the 1st time I have my mouse-down - i.e. the key-up event fires when I hold my mouse down and press a key It doesn't work the 2nd time, once I have un-pressed my mouse (firing the mouse-up event removing the key listener) and pressing my mouse again (firing the mouse-down event, adding the key listener) It does however work if I explicitly dispatch a KeyboardEvent.KEY_UP Any expertise on this? Thanks -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Overlying UIComponent prevents click event
Hi there I have an Image control that sits ontop of a button. I am trying to capture the click event of the underlying button, but it looks like the overlaying image is blocking access to the button. How can I disable this behaviour? The actual setup is slightly more complex: parent canvas: - button container (Canvas) -- button items (Button's) - image container (Canvas) -- image items (Image's) --- image item button or hit area (Button) Thanks Tracy -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/