[flexcoders] Wondering about buttons..
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] Performance Question
Basically, Our users have a group of Individuals (com.gladhandle.IndividualVO) and in one part of the application they can search the individuals. However, one of our milestones is that they are able to search and the results are refreshed on keyup of a textinput. Seeing as this could and would cause problems with the application if I hit the back end with an AMF call every key up, I was considering loading all of their individuals at startup. The majority of our users will have relatively small number of individuals (50 to 100 or so). Some will have a lot (500 to 1000) and VERY FEW will have more than that. Which path would be better, searching and filtering by making an AMF call which would make a subsequent database call and roundtrip the information back to me, or take the initial hit to load them all at startup? Thanks!
[flexcoders] Re: Custom Alert - When I add more than one, the only one I can close is the top
bump
[flexcoders] Custom Alert - When I add more than one, the only one I can close is the top.
This is what my code looks like: --- private static var _alertUI:GHAlertUI = new GHAlertUI(); public static const CUSTOM_EVENT:String = GHAlertEvent; public function GHAlert(){ } public static function show( message:String, title:String=null, buttons:Array=null, closeHandler:Function=null ):void { _alertUI = GHAlertUI( PopUpManager.createPopUp( Application.application as DisplayObject, GHAlertUI, true ) ); PopUpManager.centerPopUp( _alertUI ); if( closeHandler != null ) _alertUI.addEventListener( CUSTOM_EVENT, closeHandler ); //Buttons var button:GHAlertButton; if( !buttons || buttons.length == 0 ){ button = new GHAlertButton(); button.labelText = 'OK'; button.addEventListener( MouseEvent.CLICK, buttonClickHandler ); _alertUI.buttons.addChild( button ); } else { for( var i:int=0; ibuttons.length;i++){ button = new GHAlertButton(); button.labelText = buttons[i].toString().toUpperCase(); button.addEventListener( MouseEvent.CLICK, buttonClickHandler ); _alertUI.buttons.addChildAt( button, 0 ); } } } private static function buttonClickHandler( event:MouseEvent ):void { _alertUI.dispatchEvent( new GHAlertEvent( CUSTOM_EVENT, event.currentTarget.labelText ) ); PopUpManager.removePopUp( _alertUI ); } --- So basically if I do GHAlert.show() it works fine, however, if I do GHAlert.show() twice, the only one that works is the top, so if I close the top the buttons don't work on the bottom, almost like the events aren't firing. Thanks for any help!
[flexcoders] flex 4 gumbo and setStyle()
For some reason, when using flex 4, setStyle() is not working. Is this method deprecated in gumbo? The code I am using mx:Button label=test id=testButton borderColor=0x00 click=testButton.setStyle('borderColor', 0xff); / It does not work for some reason, but it worked fine in flex 3. Any help would be appreciated!
[flexcoders] Re: flex 4 gumbo and setStyle()
actually, it seems setStyle( 'backgroundColor', value ); works fine. I am not sure what does and doesn't work, but how else would I set the border color from actionscript in flex gumbo?
[flexcoders] Shared Virtual Objects in multiple flex applications
I have multiple applications, and they all have to use SOME of the virtual objects I have created as they all need to update our database through rubyamf in one way or another. I was wondering what the best way to create classes / etc that multiple projects can use. What would be the best way to do this?
[flexcoders] Horizontal and Vertical gradients?
Basically, I have an arrow that I draw graphically, it has a vertical gradient from the top to the bottom. I want it to fade in from left to right, so I was wanting to put a horizontal gradient on it too... I am not sure if it is possible to do this, or if this can be done a different way. Here is the arrow: http://www.andrewthorp.com/green-arrow.png I could just do an inner drop shadow - but the background behind the arrows is changing, so a black drop shadow would look pretty weird... Halp!
[flexcoders] Re: Flex error (URLRequest) using Ruby on Rails
still looking for a clue! --- In flexcoders@yahoogroups.com, tchredeemed apth...@... wrote: bump! --- In flexcoders@yahoogroups.com, tchredeemed apthorp@ wrote: Basically, I have an action upload_attachment in a controller handle_data In flex I call navigateToURL( new URLRequest( serverURL+'handle_data/upload_attachment/?profile_id=46' ) ); This seems to work fine in the following browsers: IE, safari It does not work in: Firefox( mac and pc), google chrome I am not sure why, but if I watch the production.log files from rails, firefox/chrome are never actually requesting this action, and giving me a 2038 Error, but IE/safari do request the action, and work fine. Why I think it might be a rails problem: This error does not occur if I boot the server up via localhost, but when I move the app to a different server with SSL installed, it does not work. Any help would be greatly appreciated!
[flexcoders] Re: Flex error (URLRequest) using Ruby on Rails
Hm, I am not sure that does the trick.. I have researched the problem and it seems that firefox does not send session information and that is what is causing the error... Anyone know any workarounds? Mind you I am using ruby on rails for the back end... Please help, I am drowning here! Thanks!
[flexcoders] Re: Flex error (URLRequest) using Ruby on Rails
bump! --- In flexcoders@yahoogroups.com, tchredeemed apth...@... wrote: Basically, I have an action upload_attachment in a controller handle_data In flex I call navigateToURL( new URLRequest( serverURL+'handle_data/upload_attachment/?profile_id=46' ) ); This seems to work fine in the following browsers: IE, safari It does not work in: Firefox( mac and pc), google chrome I am not sure why, but if I watch the production.log files from rails, firefox/chrome are never actually requesting this action, and giving me a 2038 Error, but IE/safari do request the action, and work fine. Why I think it might be a rails problem: This error does not occur if I boot the server up via localhost, but when I move the app to a different server with SSL installed, it does not work. Any help would be greatly appreciated!
[flexcoders] Flex error (URLRequest) using Ruby on Rails
Basically, I have an action upload_attachment in a controller handle_data In flex I call navigateToURL( new URLRequest( serverURL+'handle_data/upload_attachment/?profile_id=46' ) ); This seems to work fine in the following browsers: IE, safari It does not work in: Firefox( mac and pc), google chrome I am not sure why, but if I watch the production.log files from rails, firefox/chrome are never actually requesting this action, and giving me a 2038 Error, but IE/safari do request the action, and work fine. Why I think it might be a rails problem: This error does not occur if I boot the server up via localhost, but when I move the app to a different server with SSL installed, it does not work. Any help would be greatly appreciated!
[flexcoders] How to do images inside of a textarea using htmlText?
Basically, I was wondering how I would just put an image inside of the textarea like it was a piece of text... Example: http://www.andrewthorp.com/image-text-area.jpg Functional Equivalent of: Dear [First Name], Begin typing your message here. Thanks! Instead of the text [First Name], I want the image placed there... any ideas? Thanks!
[flexcoders] Architecture / Design question...
I have a situation in which I am currently using a very ugly set up to get the job done, but I want to change this (will explain) and I am looking for some insight. The process is this. A user gets to a piece of our app and they are presented with some options. The options are very different depending on which route they take to get there. For instance, they might see a checkbox about saving a piece of their file as a note. They might see a set of radio buttons to order different quantities (in this case the price can change depending on which radio button is selected [the price is on the same screen]). They might see a mailing address or an email address, depending on the medium of the item they are purchasing. Basically, the options vary greatly, so I currently have a different custom component depending on which they are using. I want to be able to use one component and have different options on that component, but I am not sure of an efficient way to do it. I know this is random and probably not easily answered without a specific understanding of the system, but I thought I would ask :)
[flexcoders] Re: file.upload() works fine on mac os x, does not work on a PC
bump! is it a headers issue? --- In flexcoders@yahoogroups.com, sunild99 sunilbd...@... wrote: Are you doing this w/an account that does not have the local admin privilege on the Windows workstation? Or does it work when you use HTTP? Just a guess, Sunil --- In flexcoders@yahoogroups.com, tchredeemed apthorp@ wrote: I tried this in all browsers on my mac (firefox, safari, camino), and it uploaded fine. I tried this on all browsers on my pc (firefox, ie6, ie7), and it did not. file.upload( new URLRequest( _appGlobals.serverURL+data/attachment/?order_id=+_appGlobals.order.id ) ); serverURL = https://www.oursite.com/ order_id is set for some reason, it is faulting! any ideas why?
[flexcoders] file.upload() works fine on mac os x, does not work on a PC
I tried this in all browsers on my mac (firefox, safari, camino), and it uploaded fine. I tried this on all browsers on my pc (firefox, ie6, ie7), and it did not. file.upload( new URLRequest( _appGlobals.serverURL+data/attachment/?order_id=+_appGlobals.order.id ) ); serverURL = https://www.oursite.com/ order_id is set for some reason, it is faulting! any ideas why?
[flexcoders] Re: file.upload() works fine on mac os x, does not work on a PC
I am uploading using Rails (Ruby on rails) PC is getting a 406 Not Acceptable error. any help would be awesome!
[flexcoders] Re: file.upload() works fine on mac os x, does not work on a PC
Anyone else run into this problem? --- In flexcoders@yahoogroups.com, tchredeemed apth...@... wrote: I am uploading using Rails (Ruby on rails) PC is getting a 406 Not Acceptable error. any help would be awesome!
[flexcoders] Does this work / Does this have problems?
I have a custom component named RemovableText, it looks like this mx:HBox buttons:RemoveButton / mx:Text / /mx:HBox The HBox is the root of the RemovableText. When I create and add a removable text, I am doing this: var text:RemovableText = new RemovableText(); text.name = 'removableText'; text.addEventListener( GHEvent.REMOVE_BUTTON_CLICKED, removeButtonClickHandler ); // Parsestyles is my function that gets me the textformat for the current block var tf:TextFormat = parseStyles(tag); text.setStyle( 'fontFamily', tf.font ); text.setStyle( 'fontSize', tf.size ); ... etc ... // My question is this, If I set styles on the root (RemovableText), will all of the styles be set for the mx:Text / child of the Component? Is this a safe way to do it? Thanks!
[flexcoders] [Inspectable]
Can someone tell me when I would want to use certain parts of Inspectable and what they do for me? The only one I have really found useful is 'enumeration'... For instance, what is the difference between - [Bindable] public var arrowDirection:String = 'right'; - AND - [Inspectable(defaultValue=right)] [Bindable] public var arrowDirection:String = 'right'; - What benefit do you get from the rest of them as well? Thanks for any help!
[flexcoders] problem with services-config.xml in multiple work environments..
Basically.. We develop on localhost:3000, we test on http://dev.oursite.com, and we go live on https://www.oursite.com. I need 3 different environments, one for each environment. Right now I have to recompile the SWF everytime I want to create it for a new environment. Obviously, when we have multiple people using it on localhost, I have to create these swf's too often. I was hoping there is a way that I can set up services-config.xml to point to the right url... I would almost like to set up a daisy chain or something, it tries www, if it can't get that, it tries dev, if it cant get that, it tries localhost. Any help would really be greatly appreciated...
[flexcoders] Re: problem with services-config.xml in multiple work environments..
Yeah, I can do that, no big deal, it doesn't really fix the issue because I have to use SecureAMFendpoint when its live and AMFEndpoint when it is not. I dont have an SSL Cert on localhost, but we have SSL on www. I like the way you think though! --- In flexcoders@yahoogroups.com, Anthony DeBonis anth...@... wrote: What is the service type? If you talking AMF be sure to use {server.name} and not hard code the name... this is the default for most of the services in the config... did you have to change yours? Example - channel-definition id=my-amf class=mx.messaging.channels.AMFChannel endpoint url=http://{server.name}:{server.port}/{context.root}/messagebroker/a mf class=flex.messaging.endpoints.AMFEndpoint/ properties polling-enabledfalse/polling-enabled /properties /channel-definition --- In flexcoders@yahoogroups.com, tchredeemed apthorp@ wrote: Basically.. We develop on localhost:3000, we test on http://dev.oursite.com, and we go live on https://www.oursite.com. I need 3 different environments, one for each environment. Right now I have to recompile the SWF everytime I want to create it for a new environment. Obviously, when we have multiple people using it on localhost, I have to create these swf's too often. I was hoping there is a way that I can set up services-config.xml to point to the right url... I would almost like to set up a daisy chain or something, it tries www, if it can't get that, it tries dev, if it cant get that, it tries localhost. Any help would really be greatly appreciated...
[flexcoders] Re: ColorPicker - without the picker!
Yes! That is exactly what I am looking for!
[flexcoders] Re: ColorPicker - without the picker!
Yeah, I was under the impression he was waiting to see if that's what I was looking for... Hopefully he won't mind sharing his code :)
[flexcoders] Re: ColorPicker - without the picker!
http://andrewthorp.com/flex/colorpicker.png That is a picture of what I am looking for... Somehow where I can get the swatch panel without going through the click on the top piece. Any ideas?
[flexcoders] Re: ColorPicker - without the picker!
I'd rather just know how to implement that SwatchPanel component if that is possible... :)
[flexcoders] ColorPicker - without the picker!
I was wondering if I could build a flex app that has the SwatchPanel by default, instead of having to click on the icon to have it drop down. Yes/No?
[flexcoders] mx:Text maxWidth
Question: When I set the maxWidth on a text, it does not force to a new line (like when you explicitly set the width). Is there any way to set it so that it will force it to a new line if it exceeds the maxWidth, without having to reserve the space using width?
[flexcoders] Re: services-config.xml question
bump!
[flexcoders] Re: mx:Text maxWidth
What I want it to do is to allow it to grow to the maxWidth, and wrap the text if it hits the max, right now it just cuts off the text after the maxWidth... halp! :) --- In flexcoders@yahoogroups.com, tchredeemed apth...@... wrote: Question: When I set the maxWidth on a text, it does not force to a new line (like when you explicitly set the width). Is there any way to set it so that it will force it to a new line if it exceeds the maxWidth, without having to reserve the space using width?
[flexcoders] Re: services-config.xml question
I am not sure that really solves the problem... as I still have to type the server in. Anyone know any better solutions?
[flexcoders] FileReference.upload
Hello, I am using RubyAMF to save information to the database. The FileReference.upload method is causing some issues because logically I would like to pass the File information with other information rather than just using upload(). That being said, is there any way to convert FileReference data to Base64, I am assuming all file types are able to be encoded in base64, is that correct? Any help would be appreciated! If not base64, any other way to do it would be great, just need some way that I dont have to use FileRef.upload! thanks!
[flexcoders] Re: FileReference.upload
Type was not found: File. Hmm!? --- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote: Hi, One way is to use File instead of FileReference. You can get the ByteArray that way and pass that to your service. the only caveat is that you won't be able to track the upload progress; unless you do something custom with your service. private var fileToUpload:File; private var pptFiles:FileFilter = new FileFilter(PowerPoint Files (*.ppt), *.ppt); private var fileTypes:Array = new Array(pptFiles); public function browseFiles():void { fileToUpload = new File(); fileToUpload.addEventListener( Event.SELECT, uploadFile ); fileToUpload.browseForOpen(Open, fileTypes); } public function uploadFile( event:Event ):void { fileToUpload = event.target as File; var fileData:ByteArray = new ByteArray(); var stream:FileStream = new FileStream(); stream.open(fileToUpload, FileMode.READ); stream.readBytes(fileData, 0, stream.bytesAvailable); stream.close(); // fileData will now contain the ByteArray for the file to upload. // You can use mx.utils.Base64Encoder.encodeBytes();, or send the data as is.} -TH --- In flexcoders@yahoogroups.com, tchredeemed apthorp@ wrote: Hello, I am using RubyAMF to save information to the database. The FileReference.upload method is causing some issues because logically I would like to pass the File information with other information rather than just using upload(). That being said, is there any way to convert FileReference data to Base64, I am assuming all file types are able to be encoded in base64, is that correct? Any help would be appreciated! If not base64, any other way to do it would be great, just need some way that I dont have to use FileRef.upload! thanks!
[flexcoders] Re: FileReference.upload
I don't have flash.filesystem when I do import flash.fi the only thing is filters.. hmm!! :)
[flexcoders] flex color pickers
does anyone know of any flex color pickers (kinda like photoshop color selection tool) that I can shamelessly rip off (open source, obviously =])? THANKS! :)
[flexcoders] Re: flex color pickers
Actually, I need one that is much more open then that... a 'millions of colors' color picker..!
[flexcoders] Re: flex color pickers
anyone know??
[flexcoders] Requesting images says its non secure?
I was wondering if anyone could help me here.. We have a site that is SSL encrypted, and I embed a flex app inside the html of it. When I launch the app, it gives a popup (only in IE) saying a secure site is requesting non secure information. However, the only images I request are requested by the url: https://www.oursite.com/files/. When I look at it in firebug, all requests are sent over https. Anyone know why this might be happening? /files/ is a symbolic link to http://files.gladhandle.com, which is not secure. However, in HTML, the popup is gone when we go to the symbolic link, it is still there in the flash.
[flexcoders] services-config.xml question
Basically, right now my setup looks like this: !-- SECURE -- !-- channel-definition id=rubyamf class=mx.messaging.channels.SecureAMFChannel -- !-- NOT SECURE -- channel-definition id=rubyamf class=mx.messaging.channels.AMFChannel !-- WWW -- !-- endpoint uri=https://www.gladhandle.com/rubyamf/gateway; class=flex.messaging.endpoints.SecureAMFEndpoint/ -- !-- endpoint uri=http://www.gladhandle.com:3000/rubyamf/gateway; class=flex.messaging.endpoints.AMFEndpoint/ -- !-- LOCAL -- endpoint uri=http://localhost:3000/rubyamf/gateway; class=flex.messaging.endpoints.AMFEndpoint/ /channel-definition Obviously, that is not the best way. I have to recompile this with the correct channel-definition/endpoint uncommented depending on if I am running it locally (development), off our dev server (testing), or on www (live). What would be a better way to approach this?
[flexcoders] Re: Font's not loading in IE?
Yes, I am sure. Or atleast... I thought I was sure... I converted all fonts to truetype and tested it, but it doesn't seem to be working correctly in some places. Is there any reason it would not display correctly on windows but it would display correctly on a mac? --- In flexcoders@yahoogroups.com, Rob Kunkle r...@... wrote: Are you sure your application is using fonts that are embedded in the application, and not drawing on fonts from the client system? Rob On Jan 20, 2009, at 7:32 PM, tchredeemed wrote: I have noticed that when I embed my fonts they load fine in Mac - Safari Firefox However, on a Windows machine - IE 6/7 Google Chrome Firefox The fonts do not load correctly. Anyone know why this happens? Even in some places, the fonts look fine, however in a lot of places they won't seem to load correctly... Odd behavior, not sure what the cause is...
[flexcoders] Re: Font's not loading in IE?
I am actually embedding them like this: I have a module BickhamPro.mxml: on creationComplete I call creationCompleteHandler(); [Embed(source='assets/Bickham Script Pro.ttf', fontFamily='Bickham Script Pro', fontName='Bickham Script Pro', fontWeight=normal, fontStyle=normal, mimeType=application/x-font-truetype)] private static var _bickhamScriptPro:Class; private function creationCompleteHandler():void { Font.registerFont( _bickhamScriptPro ); } When the app is loaded, I load the module into a moduleLoader and add it as a child to the main application. This seems to work on a mac but not on a pc... I do not believe that everyone who has tested this has the fonts installed, I could be wrong. Do you see anything wrong with the code or should I explore each computer for the fonts?
[flexcoders] Font's not loading in IE?
I have noticed that when I embed my fonts they load fine in Mac - Safari Firefox However, on a Windows machine - IE 6/7 Google Chrome Firefox The fonts do not load correctly. Anyone know why this happens? Even in some places, the fonts look fine, however in a lot of places they won't seem to load correctly... Odd behavior, not sure what the cause is...
[flexcoders] Memory leaks?
When I load different modules, I notice a large decrease in performance. The thing is, there are only 2 modules that get loaded, and the user can go back and forth. startup = module 1 click link to get to module 2 click 'back' button to get back to module 1 click link to get ot module 2 click 'back' to get to module 1 etc... I am actually loading the module everytime it is being clicked, instead of caching it, should I be caching it? Is there a better way to load the modules, rather than like this: private function loadModule( url:String ):void { moduleLoader.url = url; moduleLoader.loadModule(); } !-- MXML LOOKS LIKE THIS -- mx:ModuleLoader id=moduleLoader top=43 left=0 visible=false / lemme know!
[flexcoders] Re: Memory leaks?
does the module loading itself really effect performance?
[flexcoders] Peculiar Image Behavior!
I have noticed a peculiar problem with some images being rendered in flex. This image: is being rendered like this: I can navigate to the folder the image is in, and I assure you, it looks like the first. This only happens to some images, not all, in fact its the small minority that it does happen to. Has anyone ever had these issues before?
[flexcoders] Re: Peculiar Image Behavior!
It is a JPG, it loads fine in HTML, and it is being loaded into flex as the source of an Image Object... Eeep! :) --- In flexcoders@yahoogroups.com, oneworld95 oneworl...@... wrote: What's the image type? Does it load correctly if you create a simple HTML page with an img tag pointing to it? How is it being loaded into Flex (@Embed or just setting the source of an Image object)? -Alex --- In flexcoders@yahoogroups.com, tchredeemed apthorp@ wrote: I have noticed a peculiar problem with some images being rendered in flex. This image: is being rendered like this: I can navigate to the folder the image is in, and I assure you, it looks like the first. This only happens to some images, not all, in fact its the small minority that it does happen to. Has anyone ever had these issues before?
[flexcoders] Re: Peculiar Image Behavior!
I saved it out as Baseline(standard) just to be sure, same problem. --- In flexcoders@yahoogroups.com, Jim Hayes j...@... wrote: It almost looks as if it could be one of the early stages of one of those progressive type jpegs (they load in stages on a web page), possibly there's something about it that flex does not quite understand. I forget how you check for this, but it may be worth you finding out and having a look? -Original Message- From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of tchredeemed Sent: 07 January 2009 16:18 To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Peculiar Image Behavior! It is a JPG, it loads fine in HTML, and it is being loaded into flex as the source of an Image Object... Eeep! :) --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , oneworld95 oneworld95@ wrote: What's the image type? Does it load correctly if you create a simple HTML page with an img tag pointing to it? How is it being loaded into Flex (@Embed or just setting the source of an Image object)? -Alex --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , tchredeemed apthorp@ wrote: I have noticed a peculiar problem with some images being rendered in flex. This image: is being rendered like this: I can navigate to the folder the image is in, and I assure you, it looks like the first. This only happens to some images, not all, in fact its the small minority that it does happen to. Has anyone ever had these issues before? __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __
[flexcoders] Re: Resizing Images.
bump
[flexcoders] Re: Resizing Images.
To see what I am talking about... look at - http://www.andrewthorp.com/flexsmoothing/
[flexcoders] Resizing Images.
Hello! Our application needs the ability to take a logo (which gets uploaded in a different interface via rails) and resize it dynamically depending on which item they are purchasing. As of right now, I am using a Loader and when Event.COMPLETE is dispatched, I catch it, create a new width/height, call myMatrix.scale(newW,HewH), than bitmapFill on a UIComponent using the bitmapData and my matrix. Everything works, in that it does resize the image, but they quality is not very good, some of them are decent looking, and others do not handle aliasing well at all. Smoothing is set to true when I do the bitmapFill. Is there a better way to do this? Should I be creating a new image with the data rather than resizing the data dynamically? Halp! :( Thanks!
[flexcoders] Re: Resizing Images.
Has anyone done this?
[flexcoders] uploading a file with ruby
Anyone done this? This is how I try to do it: fileReference.upload( new URLRequest( http://localhost:3000/files/upload; ) ); however, I get Error #2038 File I/O error Anyone know why I am getting this error? can you not post to the localhost? Is there something else I have to do?
[flexcoders] Re: Embedding fonts dynamically...
Will this allow me to actually embed fonts dynamically? or to just use fonts that I have already embedded?
[flexcoders] Re: Embedding fonts dynamically...
I am concerned about the filesize if we embed all files. I think what Alex said might work, we could embed the font into a module, and only load a module as we need the font.
[flexcoders] Flex TextArea Limited by number of lines.
Has anyone ever done this? Seen any tutorials on this? It seems that a good amount of people would want something like this. I keep running into issues with it, and it is very frustrating!
[flexcoders] Embedding fonts dynamically...
Is there any way to do this? Basically, I only need some fonts and it will change depending on the situation.
[flexcoders] Re: Embedding fonts dynamically...
How would I do that? Also, do you know of any way to tell if the user has a font already, and I will only embed it if they need it (don't want to load a font that they already have...)
[flexcoders] Re: TextFormat being reset?
Anyone?? :) --- In flexcoders@yahoogroups.com, tchredeemed [EMAIL PROTECTED] wrote: I have created my own CanvasStack (to replace the viewstack) because viewstacks and models do not mix. ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=initApp() height=100% horizontalScrollPolicy=off verticalScrollPolicy=off mx:Metadata [Event(name=changeSelectedIndex,type=flash.events.Event)] /mx:Metadata mx:Script ![CDATA[ import com.gladhandle.AppGlobals; import com.gladhandle.handles.greeting_card.gcassets.Editor; [Bindable] private var _selectedIndex:int; public var dataProvider:Array; private function initApp():void { _selectedIndex = 0; addChild( dataProvider[_selectedIndex] ); } public function set selectedIndex( selectedIndex:int ):void { if( selectedIndex 0 || selectedIndex dataProvider.length ) { throw new Error( selectedIndex out of range ); return; } _selectedIndex = selectedIndex; dispatchEvent( new Event( changeSelectedIndex, false ) ); this.removeAllChildren(); this.addChild( dataProvider[_selectedIndex] ); } [Bindable] public function get selectedIndex():int { return _selectedIndex; } ]] /mx:Script /mx:Canvas --- This dataprovider is populated with custom components as well. When I change the selected index, it removes all the children (but they still exist in the dataprovider, so 'session' data should be saved), but when I navigate back to an index I have already visited, everything is still there, EXCEPT for the format of the text, it for some reason, is reset back to the original text, even though I have setTextFormat() and set the defaultTextFormat on the TextField. Any ideas?
[flexcoders] Re: TextFormat being reset?
I created a new Text class that extended Text. I then change the textField.defaultTextFormat and call textField.setTextFormat(). It works when I set it on creationComplete, but then when I remove and add the editor again (which cntains the new Text), it takes all the textFormat styles off. --- In flexcoders@yahoogroups.com, Keith Reinfeld [EMAIL PROTECTED] wrote: What TextField? Regards, -Keith http://keithreinfeld.home.comcast.net http://keithreinfeld.home.comcast.net/ _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tchredeemed Sent: Tuesday, November 18, 2008 8:17 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: TextFormat being reset? Anyone?? :) --- In [EMAIL PROTECTED] mailto:flexcoders%40yahoogroups.com ups.com, tchredeemed apthorp@ wrote: I have created my own CanvasStack (to replace the viewstack) because viewstacks and models do not mix. ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe. http://www.adobe.com/2006/mxml com/2006/mxml creationComplete=initApp() height=100% horizontalScrollPolicy=off verticalScrollPolicy=off mx:Metadata [Event(name=changeSelectedIndex,type=flash.events.Event)] /mx:Metadata mx:Script ![CDATA[ import com.gladhandle.AppGlobals; import com.gladhandle.handles.greeting_card.gcassets.Editor; [Bindable] private var _selectedIndex:int; public var dataProvider:Array; private function initApp():void { _selectedIndex = 0; addChild( dataProvider[_selectedIndex] ); } public function set selectedIndex( selectedIndex:int ):void { if( selectedIndex 0 || selectedIndex dataProvider.length ) { throw new Error( selectedIndex out of range ); return; } _selectedIndex = selectedIndex; dispatchEvent( new Event( changeSelectedIndex, false ) ); this.removeAllChildren(); this.addChild( dataProvider[_selectedIndex] ); } [Bindable] public function get selectedIndex():int { return _selectedIndex; } ]] /mx:Script /mx:Canvas --- This dataprovider is populated with custom components as well. When I change the selected index, it removes all the children (but they still exist in the dataprovider, so 'session' data should be saved), but when I navigate back to an index I have already visited, everything is still there, EXCEPT for the format of the text, it for some reason, is reset back to the original text, even though I have setTextFormat() and set the defaultTextFormat on the TextField. Any ideas?
[flexcoders] Dynamic Tags (more of an SQL question, but concerns parsing data in Flex)
Basically, when I query a database, if I get back a row that has contactType='contactInformation', I have to display all of the piece of contactInformation I have for a given user... Usually: Full Name Job Title Phone Phone Phone Address Email Website Here is the problem, I want to be able to dynamically change different pieces of the information (normally Full Name could be a little bit bigger + bold, and the website could be a different color) I can't just pull each piece out of the database separately, because some users could have 15 phone numbers, others might not have an address, etc... The table looks like this: field_type x_offset y_offset Any ideas on what I can add to the table to tell myself what styles to put on different pieces?
[flexcoders] TextField
How do you add a TextField to the screen? I tried using the same example from the dynamic help, but nothing is appearing... package assets { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; public class RMText extends Sprite { private var label:TextField; private var labelText:String = Hello world and welcome to the show.; public function RMText() { configureLabel(); setLabel(labelText); } public function setLabel(str:String):void { label.text = str; } private function configureLabel():void { label = new TextField(); label.autoSize = TextFieldAutoSize.LEFT; label.background = true; label.border = true; var format:TextFormat = new TextFormat(); format.align = 'left'; format.font = Verdana; format.color = 0xFF; format.size = 10; format.underline = true; label.defaultTextFormat = format; addChild(label); } } } This does not seem to do anything... For some reason when I add this to the screen I cannot see anything, but I am not sure why, as I copied it directly from dynamic help... Any ideas? (UITextField causes the same issue)...
[flexcoders] Regular Expressions?
If I have these two dynamic tags: name color=ff size=20 /address color=ff size=16 / How can I use a Regular Expression, or some other way, to first only get everything between name and /, than to parse each field for the value?
[flexcoders] Re: Regular Expressions?
Ok, I have figured out a way to get the tags... now I have one problem... I get the name properties, like this: var ptrn:RegExp = /name(.?*)\//; Now, is it possible to use a variable in there for name? Something like this: var field:String = 'name'; var ptrn:RegExp = /field(.?*)\//; Y/N?
[flexcoders] Re: Regular Expressions?
one problem: It comes back like this: name color=ff size=16 /address color=00 size=20 align=left /phone ... etc / So, how would I separate them by the node that I am currently working with?
[flexcoders] Re: Regular Expressions?
I do have this working, however... but I am facing 1 problem: var ptrn:RegExp = new RegExp(+tag+(.*?)\/); tag can be 'name', 'address', 'phone', etc... What I am having the problem with, is it is returning everything before and after the match too.. so for the previous example (name color=ff size=16 /address color=00 size=20 /), it works like this: tag = 'name'; // color=ff size=16 address color=00 size=20 / tag = 'address'; // name color=ff size=16 / color=00 size=20 So, what I need to do is not return anything before the tag or after the /...
[flexcoders] Re: Regular Expressions?
Well basically, I will get a string with multiple pieces name ... / address ... / phone ... / ETC.. Basically, I need to say var string:XML = currentpiece (name ... /, address ... /, etc).. So how can I (like how I pass tag in for the regexp) separate the address / tag or whatever, depending on which node (address, name, phone, etc) I am working with?
[flexcoders] TextFormat being reset?
I have created my own CanvasStack (to replace the viewstack) because viewstacks and models do not mix. ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=initApp() height=100% horizontalScrollPolicy=off verticalScrollPolicy=off mx:Metadata [Event(name=changeSelectedIndex,type=flash.events.Event)] /mx:Metadata mx:Script ![CDATA[ import com.gladhandle.AppGlobals; import com.gladhandle.handles.greeting_card.gcassets.Editor; [Bindable] private var _selectedIndex:int; public var dataProvider:Array; private function initApp():void { _selectedIndex = 0; addChild( dataProvider[_selectedIndex] ); } public function set selectedIndex( selectedIndex:int ):void { if( selectedIndex 0 || selectedIndex dataProvider.length ) { throw new Error( selectedIndex out of range ); return; } _selectedIndex = selectedIndex; dispatchEvent( new Event( changeSelectedIndex, false ) ); this.removeAllChildren(); this.addChild( dataProvider[_selectedIndex] ); } [Bindable] public function get selectedIndex():int { return _selectedIndex; } ]] /mx:Script /mx:Canvas --- This dataprovider is populated with custom components as well. When I change the selected index, it removes all the children (but they still exist in the dataprovider, so 'session' data should be saved), but when I navigate back to an index I have already visited, everything is still there, EXCEPT for the format of the text, it for some reason, is reset back to the original text, even though I have setTextFormat() and set the defaultTextFormat on the TextField. Any ideas?
[flexcoders] Help with Custom Text Area (Limited by lines)
This is my code: public class LimitedTextArea extends TextArea { private static const MAX_LINES:int = 10; private var storedInput:String; private var limitHit:Boolean = false; public function LimitedTextArea(){ this.addEventListener( KeyboardEvent.KEY_UP, keyUpHandler ); this.addEventListener( KeyboardEvent.KEY_DOWN, keyDownHandler ); this.addEventListener( Event.CHANGE, changeHandler ); } //-- // EVENT LISTENERS //-- protected override function keyDownHandler(event:KeyboardEvent):void { storedInput = this.text; var tf:TextField = TextField( this.textField ); if( tf.numLines MAX_LINES ) limitHit = true; } protected override function keyUpHandler(event:KeyboardEvent):void { if( limitHit ){ this.text = storedInput; limitHit = false; } } private function changeHandler( event:Event ):void { if( limitHit ){ this.text = storedInput; limitHit = false; } } //-- } If I just keep entering down and typing stuff in, it works and stops me from typing more... the problem is when I try to go back and edit what I have typed, the limit has been hit (10 lines)... I am not sure how to allow deleting or editing as long as it still does not go longer than allowed... Any ideas? ( I tried what you said Alex, but I couldn't get it to work properly )
[flexcoders] Re: Help with Custom Text Area (Limited by lines)
public class LimitedTextArea extends TextArea { private static const MAX_LINES:int = 10; private var textLength:int = 0; private var storedInput:String; private var limitHit:Boolean = false; public function LimitedTextArea(){ this.addEventListener( KeyboardEvent.KEY_UP, keyUpHandler ); this.addEventListener( KeyboardEvent.KEY_DOWN, keyDownHandler ); this.addEventListener( Event.CHANGE, changeHandler ); } //-- // EVENT LISTENERS //-- protected override function keyDownHandler(event:KeyboardEvent):void { storedInput = this.text; var tf:TextField = TextField( this.textField ); textLength = tf.length; if( tf.numLines MAX_LINES ) limitHit = true; } protected override function keyUpHandler(event:KeyboardEvent):void { var tf:TextField = TextField( this.textField ); if( limitHit tf.length textLength ){ this.text = storedInput; limitHit = false; } } private function changeHandler( event:Event ):void { var tf:TextField = TextField( this.textField ); if( limitHit tf.length textLength ){ this.text = storedInput; limitHit = false; } } //-- } This does work if I want to go back and change a letter to a different letter, but I guess another problem I am having is that I want to be able to keep typing as long as I do not go further than the line limit... For instance, let's say I hit my limit, but I hit it like this: a a a a a a a I should be able to go up in the first couple lines and keep typing, because it won't push the bottom line out any further...
[flexcoders] Re: Help with Custom Text Area (Limited by lines)
Yes, it would, and I think I just figured out how to do it... A few changes and I have come up with this: public class LimitedTextArea extends TextArea { private static const MAX_LINES:int = 10; private var allowMore:Boolean = true; public function LimitedTextArea(){ addEventListener(flash.events.TextEvent.TEXT_INPUT,textInputHandler ); } //-- // EVENT LISTENERS //-- override protected function keyDownHandler(event:KeyboardEvent):void { if( textField.numLines == MAX_LINES event.keyCode == 13 ) allowMore = false; else { if( textField.numLines MAX_LINES ) allowMore = false; else allowMore = true; } super.keyDownHandler(event); } override protected function keyUpHandler(event:KeyboardEvent):void { if( !allowMore text.charAt(text.length-1) == '\r' ){ text = text.substr(0,text.length-1); } super.keyUpHandler(event); } private function textInputHandler( event:TextEvent ):void { if( !allowMore ) event.preventDefault(); } //-- } Do you see any problems with this?
[flexcoders] textArea's that are limited by the amount of lines
Basically, I created a custom component that extends TextArea, and I created a getter that returns the super.textField. Right now, I am doing this: private var savedText:String; private var limitHit:Boolean = false; keyDown(){ savedText = textArea.text; var tf:TextField = TextField( (event.currentTarget as LimitedTextInput).textField ); if( tf.numLines 14 ) limitHit = true; } keyUp(){ if( limitHit ){ textArea.text = savedText; limitHit = false; } } change(){ if( limitHit ){ textArea.text = savedText; limitHit = false; } } the problem is, if I hit the limit, I cannot go back and edit the text, because limitHit is true and I need to know how to say If it is deleting or changing text that can fit, allow it Am I even doing this the correct way?
[flexcoders] mouseOver and mouseOut
code: mx:HBox mouseOver=moCanvas.visible=true; mouseOut=moCanvas.visible=false; mx:Text text=test / mx:Canvas id=moCanvas width=10 height=10 visible=false backgroundColor=0x00 / /mx:HBox Obviously simplified, basically I am interested in finding out why the mouseOut event is triggered when I mouse over different parts of the HBox. For instance, when I mouseOver the text, it shows the moCanvas, when I mouse off the text but stay in the HBox it hides the moCanvas... Any ideas?
[flexcoders] HTTPStatusEvent is always 0
Hi, I am using Firefox, and I have found (as I am sure most of you know) that the httpStatus Event on a SWFLoader is always 0, because Firefox does not pass the httpStatus to the flash player... No big deal, as long as there is SOME way to tell if an image loaded succesfully in flex? I can tell if it loads using the complete event, but I cannot tell if it errors, as far as I know, has anyone found any workarounds for this? thanks!
[flexcoders] HistoryManager
Type Coercion failed: cannot convert mx.managers::History Manager [EMAIL PROTECTED] to mx.managers.IHistoryManager. what would be causing this error? I am not explicitly referencing the HistoryManager in my app at all... wierd! :)
[flexcoders] Re: HistoryManager
2 Things. 1 - I misspelled weird! 2 - I use a ViewStack in one of my modules, and it only happens when I navigate away from said module to a new module! --- In flexcoders@yahoogroups.com, tchredeemed [EMAIL PROTECTED] wrote: Type Coercion failed: cannot convert mx.managers::History Manager [EMAIL PROTECTED] to mx.managers.IHistoryManager. what would be causing this error? I am not explicitly referencing the HistoryManager in my app at all... wierd! :)
[flexcoders] SWFLoader problems!
I have a .swf that I load into my flex app... like this: [Embed(source=swfloader.swf)] [Bindable] private var swfLoaderAnimation:Class; mx:SWFLoader id=loader source={swfLoaderAnimation} horizontalCenter=0 verticalCenter=0 / --- The problem(s): 1- Sometimes this swfloader is bigger than the actual swf, and if i scaleX and scaleY to 0.5, it is the appropriate size. Other times, however, it is the correct size, and scaling it makes it far too small... This even happens on the same custom component sometimes :( 2- I do not believe that flex actually knows how tall/wide this swf is, because the horizontalCenter and verticalCenter seem to center the top left pixel of the swf instead of the entire swf... if I put it inside of a hbox with a border, and center that, it shows that the swf runs off the bottom/right edges of the hbox... Any help? Thanks :)
[flexcoders] textArea.setFocus();
When I launch my application, if I do this: textArea.selectionBeginIndex=10; textArea.selectionEndIndex=20; textArea.setFocus(); Should it not put the cursor into the textArea and have the 10th through 20th characters selected? So that by default, if I put that in creationComplete, and they just start typing when the app loads, it starts to replace the 10th through 20th characters with what they type? As of right now, I do not see a cursor when I run. Any ideas?!
[flexcoders] Re: textArea.setFocus();
Thanks guys, now I guess my problem is how to give the application focus without clicking on it? parentApplication.systemManager.activate() ? Not sure exactly where to go :)
[flexcoders] Measuring a vbox after I add children to it
I add children, and only Text or Spacer, to a vbox. After I have added them, I want to get the height of the vbox. However, when I call vbox.height, it gives me 0. If I call the measure() method, same problem, measuredHeight, same problem. Any ideas?
[flexcoders] Re: Measuring a vbox after I add children to it
grrr! same problem! Let me give an example of what I am doing! Keep in mind I am typing this very fast, and it most likely will have spelling mistakes, but it should give you an idea! ?xml version=1.0 encoding=utf-8? mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=creationCompleteHandler(); mx:Script private function creationCompleteHandler():void { addText; addText; addSpacer; addText; addSpacer; addText; drawStripe(); } private function drawStripe():void { var g:Graphics = this.graphics; g.beginFill(0x00); g.drawRect( 0, 0, 5, height ); g.endFill(); } /mx:Script /mx:VBox
[flexcoders] Re: Measuring a vbox after I add children to it
one problem.. the children do not get added until I request for them to, via an eventListener that does not get dispatched until much after the creationComplete event... this is probably the problem :(
[flexcoders] Remove border from Button
I cant figure out how to remove the border from a button! mx:Button Any help!?
[flexcoders] need a flash developer / location of flash developers
Please help..! I need a flash developer or someone who can point me to their secret hangout!!!
[flexcoders] Re: need a flash developer / location of flash developers
nope, i mean flash
[flexcoders] Flash Loader needed ... indeterminate
I have an image, and I need someone to turn this image into a flash swf for me... I could try to describe it, but I figured it would be best to show a picture of it. and that is located here: http://img356.imageshack.us/img356/5438/loaderjh8.jpg http://img356.imageshack.us/img356/5438/loaderjh8.jpg I wanted to know if anyone could help me, I am willing to pay... If this is not a good place to ask for something like this, I would greatly appreciate anyone who can point me in the right direction!
[flexcoders] Re: Flash Loader needed ... indeterminate
Note: Basically that white bead just spins around the circle and never stops... essentially it shows up on top of each piece of the circle.. you all get it.
[flexcoders] drawing via actionscript
public class MyClass { public function MyClass(){ var drawingComponent:UIComponent = new UIComponent(); // draw on the drawingComponent; } } If I have that, and I do (in my flex) new MyClass() and add it to the mxml, it doesn't show up with what I draw on drawingComponent. How do I add the drawingComponent to the class, so that it will show up?
[flexcoders] I just ran software update on Mac OS X, now FB cannot locate the debugger
/Library/Internet Plug-Ins/Flash Player.plugin Flex Builder cannot locate the required debugger version of Flash Player. You might need to install the debugger version of Flash Player 9 or reinstall Flex Builder. Do you want to try to debug with the current version? I got this error before, and I had to create a new project and copy all of the files 1 at a time. I do not want to do that again. I just ran Software Update, and I am not sure what updates occured, but I believe Firefox might have. I really want to fix this issue, and know a good way to fix it that does not involve me copying code for 1 hour+. Please someone help me!
[flexcoders] Re: I just ran software update on Mac OS X, now FB cannot locate the debugger
Ok. 1) I went into Flex Builder and installed the flash player that comes in Flex Builder 3/Player/mac After I did this, the project would compile and run without giving me any errors, but it never updated (for instance, I changed the background color, and it would 'compile and run', but the background color never changed, i did it with multiple different variables, but it was as if it was not actually updating the swf) 2) I decided to just do what you said, so I ran the uninstall flash player 3) I installed Flash Player 10, and I am getting that error, as well as a new error that says /users/./public/bin/MyProject.swf The SWF application file does not contain required debugging Information. You might need to edit your project settings or recreate your project. It is so frustrating.
[flexcoders] Re: I just ran software update on Mac OS X, now FB cannot locate the debugger
For instance trace('testing'); in the creationCompleteHandler() does not trace testing... likewise, if I delete all function calls out of the creationCompleteHandler, it still calls them... --- In flexcoders@yahoogroups.com, tchredeemed [EMAIL PROTECTED] wrote: Ok. 1) I went into Flex Builder and installed the flash player that comes in Flex Builder 3/Player/mac After I did this, the project would compile and run without giving me any errors, but it never updated (for instance, I changed the background color, and it would 'compile and run', but the background color never changed, i did it with multiple different variables, but it was as if it was not actually updating the swf) 2) I decided to just do what you said, so I ran the uninstall flash player 3) I installed Flash Player 10, and I am getting that error, as well as a new error that says /users/./public/bin/MyProject.swf The SWF application file does not contain required debugging Information. You might need to edit your project settings or recreate your project. It is so frustrating.
[flexcoders] Re: I just ran software update on Mac OS X, now FB cannot locate the debugger
also it actually runs MyApp.swf?debug=true isnt it supposed to be MyApp-debug.swf ?
[flexcoders] floodFill and threshold methods with bitmapData
Ok, so I am working with bitmapData, using embedded jpgs. I need to be able to dynamically replace certain areas with a given branded color. I have got it where it will replace the majority, but it leaves a bunch of pixels around the edges when I use floodFill. I think this is where threshold comes in, but I cannot figure out how to use it. Any ideas? Am I using the correct method(s)? Is this possible?
[flexcoders] Masking Images?
If I have a bunch of images that need to be color-coded for a given color, how would I do this? Let's say I have a grid with 8 images, and all 8 of them have portions that need to have a 'branded color,' but the branded color is different depending on the user, and the images are different depending on the current setup. In other words, 100% dynamic masking?
[flexcoders] Re: Masking Images?
--- In flexcoders@yahoogroups.com, tchredeemed [EMAIL PROTECTED] wrote: If I have a bunch of images that need to be color-coded for a given color, how would I do this? Let's say I have a grid with 8 images, and all 8 of them have portions that need to have a 'branded color,' but the branded color is different depending on the user, and the images are different depending on the current setup. In other words, 100% dynamic masking? Now that I think about it, a mask might not be what I need. Should I just do a color replace? replace all pixels of the color x to the color y? How would I do that? Is that efficient?
[flexcoders] transform()
Hey, I need some help understanding the bitmapdata.transform() method. the bitmapdata has this color 0x00ffe4 and I need to replace that with 0xff. How would I go about doing this?
[flexcoders] Re: transform() -- WHOOPS I MEANT THRESHOLD! :)
--- In flexcoders@yahoogroups.com, tchredeemed [EMAIL PROTECTED] wrote: Hey, I need some help understanding the bitmapdata.transform() method. the bitmapdata has this color 0x00ffe4 and I need to replace that with 0xff. How would I go about doing this? I am sorry, I meant threshold, not transform!
[flexcoders] Best way to deliver data via Rails
I know its not through HTTPServices.. We were using SabreAMF when we were using PHP for the data... but we have changed to RoR, does anyone know what the best way to get data is?
[flexcoders] Embedded Flex
Is it easy to embed a flex application inside of an HTML page instead of the app being standalone? Any tutorials? Any help?
[flexcoders] resizable textArea
just wondering if anyone has done this, or if there is any documentation anywhere for it. I can catch the enter keydown, and increase height, but the delete doesn't work exactly the same. only if they are deleting a line should the box get smaller, any ideas?
[flexcoders] Gradient that is vertical and horizontal!
Heres the problem, I need to draw a gradient that goes from 0 opacity black to 100% opacity black from left to right. However, this also needs to fade out the further down you go. The gradient is 10 pixels wide, and about 400 pixels tall. So its essentially a horizontal gradient that fades as it goes down... any ideas?