[flexcoders] Determining byte size of RemotObject response value
Is there a profiling tool or technique that I could use to determine the size (in bytes) of the response that is sent back over the wire as the result of executing a method on a RemoteObject? I'm trying to make some architecture decisions about how much data my remote Java object should return such that it doesn't cause a poor user experience for people on slower connections. I don't need to be able to access this size info from within ActionScript necessarily...I just want to be able to see the size information in some way during my initial tests (log file? profiler? debugger?) Any ideas would be greatly appreciated. Thanks! Kris 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] ProgressBar and cached images problem
Hey guys and gals, I've stumbled upon a quirky behavior I'm hoping you can help me resolve. The ProgressBar component does not appear to work properly if the graphic asset being loaded is in the browser's cache. The simple example below illustrates this problem. The first time this app is displayed the ProgressBar properly tracks the loading of the image. But on subsequent browser refreshes, the image loads justfinebut the ProgressBar remains at 0%. If the browser cache is cleared and the app is reloaded the ProgressBar once again works properly. Is this a known issue? How do I work around this problem? Example ?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="doLoad()" mx:Script ![CDATA[ public function doLoad() { myImage.source = "http://somedomain.com/someImage.jpg"; } ]] /mx:Script mx:ProgressBar source="myImage" / mx:Image id="myImage" / /mx:Application Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.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 the Yahoo! Terms of Service.
[flexcoders] implementing init() in subclass
I'm trying to create an MXML component that is a subclass of mx:Canvas. I would like to provide my own implementation of mx.core.UIComponent's init() method so that I can set some default values for my custom component properties. However, when I try this (as illustrated below) I get the following odd error: line 52 The member name, init, may not be repeated more than once. line 85 The member name, init, may not be repeated more than once. My code looks like this... 51 public function init() :Void52 {53 super.init();54 // Use default property values if necessary.55 if (selected == undefined)56 {57 selected = false;58 }59 } Note, this code is all inline in my MXML file. My mx:Script block ends at line 62. Line 85 is in the middle of my MXML tags! What is really causing this error? How do I resolve it? Is overriding the init() method not the best approach for setting default property values? Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.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 the Yahoo! Terms of Service.
[flexcoders] XPath support in Flex?
Does Flex have any built-in support for XPath? I know Flash supports XPath expressions to a certain extent, but it isn't well documented (It's buried in the "Using Flash" documentation). Is there support in Flex? Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.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 the Yahoo! Terms of Service.
[flexcoders] Creating custom components with Flash
I want to know how to create a custom visual component in Flash that can be used in Flex. However, the extremely brief (and confusing), dead-endentry below is the only one I could find on thistopicin the documentation. Can someone point me to some more helpful information? = In Flex 1.0, you could create custom components for Flex in the Flash development environment. You modified the components in the flexforflash.zip file, and then exported them as SWC files for use in your Flex applications. This workflow has been deprecated for Flex 1.5. You can still create components for Flex using the Flash environment, but Macromedia supports only creating components using the functionality supported in Flash for Flex 1.0 (including Updaters 1 and 2). Do not create new components using the flexforflash.zip file for Flex 1.5 in Flash. This functionality has been deprecated. The flexforflash.zip file is provided for backward-compatibility only. = Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.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 the Yahoo! Terms of Service.
RE: [flexcoders] How to trace the Variables in Flex
Also, if you are using Flex Builder you can see your trace output without doing any special configuration or writing out to a log. Simply preview your file inside Flex Builderby pressing the "debug" button and then click the tab for the "Output Panel" to view any trace output as your app runs. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Abdul QabizSent: Wednesday, April 20, 2005 3:22 PMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] How to trace the Variables in Flex Yeah, you can do that...You need to use Flash debug player and configure it for tracing. All tracemessages would be logged to a log file.Look at following links on using trace(..) and configuring Flash DebugPlayer for the same:http://livedocs.macromedia.com/flex/15/flex_docs_en/0792.htmhttp://livedocs.macromedia.com/flex/15/flex_docs_en/0794.htm-abdul -Original Message-From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Sent: Thursday, April 21, 2005 12:29 AMTo: flexcoders@yahoogroups.comSubject: [flexcoders] How to trace the Variables in FlexHi all,I have script in my mxml file. i want to trace some variables, can i?Thanks RegardsPathy 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 the Yahoo! Terms of Service.
RE: [flexcoders] problem with TileList
Duccio, I think the problem is this line: img.load=data.thumb; You are using "load" as if it were a settable property, but it is actually a method of the the Image class and would therefore be used with the following syntax: img.load(data.thumb) Alternately, you could set the "source" property of the img object to achieve the same result: img.source = data.thumb Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of DuccioSent: Friday, April 15, 2005 8:01 AMTo: flexcoders@yahoogroups.comSubject: [flexcoders] problem with TileList Hi, iamstudying the Foto viewer example.I have a problem loading images in a TileList, seems like no image loads. If i use cellRenderer and dataProvider of TileList everything's ok.Here is the source code: Application intialize function initApp() {albumSrv.send(); } function albumSrvResult(event) {album=albumSrv.result.album;photoCount=album.photo.length;list.selectedIndex=0;currentPhoto=album.photo[list.selectedIndex];var thumb:Thumbnail; for (var i=0; iphotoCount; i++) {thumb=new Thumbnail();thumb.setValue(i, album.photo[i]); list.addItem(thumb); //the TileList }} ?xml version="1.0" encoding="utf-8"? Thumbnail.mxml mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml" vScrollPolicy="off" hScrollPolicy="off" borderStyle="none" horizontalAlign="center" mx:Script var data: Object; function setValue(str: String, item: Object) { if (data == item) return; if (item==undefined) { visible = false; return; } else { img.visible = false; data="">img.load=data.thumb;img.visible=true; visible=true;mx.core.Application.alert("data thumb :" +data.thumb); } }function setWidth(width: Number) {//mx.core.Application.alert("testProperty :" +width);img.width=width; } /mx:Script mx:Image id="img" / /mx:VBox 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 the Yahoo! Terms of Service.
[flexcoders] Forcing text to be anti-aliased
How can I force Flex to anti-alias the text of a Label (or any other text based component)? The documentation doesn't seem to be very forthcoming with this info. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.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 the Yahoo! Terms of Service.
RE: [flexcoders] Flex 1.5 price
OK. After all the chatter and speculation on the price of Flex changing on April 1st, did it ever really happen? I've been on vacation and upon returning I have not been able to find any official announcement on MM's site. Has pricing changed? Can some one point me to definitive proof? Thanks! Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.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 the Yahoo! Terms of Service.
RE: [flexcoders] flex and javascript
Well, the latest version of Macromedia Central has the ability to upload files natively[1]. And since Central uses the Flash Player as its runtime environment, one could speculate that the ability to upload files is already built into the latest version of the Flash Player, but it just hasn't been exposed to those of us using Flex, yet. Although I suppose there may be other mechanics at play here as well. [1] http://www.macromedia.com/software/central/productinfo/whatsnew/ Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com From: Matthew Shirey [mailto:[EMAIL PROTECTED] Sent: Thursday, April 07, 2005 3:18 PMTo: flexcoders@yahoogroups.comSubject: Re: [flexcoders] flex and _javascript_ To my knowledge Flash itself has no way to upload a file. 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 the Yahoo! Terms of Service.
RE: [flexcoders] Security Sandbox Violation when loading image
Well, I figured out why I was experiencing different behavior when pulling data in from an XML file vs. pulling it in via a remote object. My remote object method call was returning an Array of objects which on the Java side were instances of a simple data object class I had created called com.myclient.Product. These objects had three properties: label(String), imageId(String), and price(Double) which were accessible through appropriately named getter methods. When stepping through the debugger in Flex Builder, I could see these objects were coming through just fine with the appropriate property names and values, but when I tried to pass each object to my custom display component it was not displaying them, even when the same display component had no problem displaying similar data Objects if they were created in the AS code. So I went ahead and created an .as class called com.myclient.myapp.Product and associated it with the Java class using the following static variable invocation: static var regClass = Object.registerClass("com.myclient.Product", com.myclient.myapp.Product); After doing that, everything worked just fine. So my questions are, why did I have to create that ActionScript class to get things to work? Is there a way to pass back a generic AS Object from a remote object call? Would passing back objects of type java.util.Map be the answer? Which is the better practice, passing back a java.util.Map to be converted to an untyped Object or creating .as classes for each typed Object that can be retured from a remote object call. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com The weird thing I've discovered is that if my image paths are brought into my Flex app via an XML file, then I do get the errors above, but the images do load successfully. However, if my image paths come in as a result of a remote object call, I get the same errors and my images DON'T load successfully. I've double checked the exact path's that are being used in both situations by tracing out the path immediately before it is used as the value for the "source" property of the mx:Image tag and it is EXACTLY the same in both cases. Yahoo! Groups Sponsor ADVERTISEMENT 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 the Yahoo! Terms of Service.
RE: [flexcoders] Calling Java Servlet
Libby, You wouldn't typically call a method on a servlet through the RemoteObject mechanism. Instead, RemoteObject is there to let you call methods on plain old Java objects (pojos) or EJBs. So to modify your example a bit, if you had a Java class called "ItemDefFacade" (which *doesn't* subclass Servlet) that supported a method with the signature: public ArrayList getAllRecords() ...thenyou would set up your RemotObject tag like this: mx:RemoteObject id="remoteObj1"source="maintenance.ItemDefFacade" mx:method name="getAllRecords" result="handleGetAllRecordsResult(event.result)" / mx:RemoteObject Notice that you have to specify the methods that can be invoked on the remote object and you have to specify a handler to be triggered wheneach method returns a result (the event.result property contains the actual returned value). In this case we've pointed it to an ActionScript function called handleGetAllRecordsResult() which might look like this: mx:Script ![CDATA[ function handleGetAllRecordsResult(recordsList) { myDisplayGrid.dataProvider = recordsList; } ]]/mx:Script So to get the whole ball rolling, you need to trigger the method on the remote object. Here is a button that would do just that: mx:Button click="remoteObj1.getAllRecords()" / You'll find more thorough coverage of this topic in the Flex docs here: http://livedocs.macromedia.com/flex/15/flex_docs_en/2244.htm I hope that helps. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com From: Libby [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 2:51 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Calling Java Servlet Hello,I am evaluating Flex. We have flash Remoting calling some servletsrunning on Websphere 5.1, and for my eval I am trying to build asimiliar interface to them. So far I cannot find an example of how todo this (call a servlet with arguments) so I was hoping someone herecould show me a tiny example, or offer corrections to my code?Using flash, we call a controller servlet using one or more arguments.ItemDefServlet("getAllRecords"); -- like this in FlashIn Flex, this is what I have:mx:RemoteObject type="servlet" source="maintenance.ItemDefServlet"protocol="http" id="remoteobject1"/mx:RemoteObjectmx:DataGrid id="ItemDef_grd"dataProvider="{remoteobject2.getMessage.result}"../mx:DataGrid mx:ControlBar mx:Button label="Get All" click="remoteobject1.send()" / /mx:ControlBarthanks,Libby Yahoo! Groups Sponsor ADVERTISEMENT 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 the Yahoo! Terms of Service.
[flexcoders] Security Sandbox Violation when loading image
I'm trying to load some images from a different domain than the one my Flex app lives on. When I do, the debugger prints out a bunch of errors like this: *** Security Sandbox Violation *** SecurityDomain 'http://myserver.com/index.mxml?debug=true' tried to access incompatible context 'http://otherserver.com/someImage?wid=30' (Note, the image is dynamically generated and the URL should not include ".jpg") Despite the errors, my images still seem to load in successfully, both through the Flex Builder IDE and when viewed directly in IE. Or so I thought. The weird thing I've discovered is that if my image paths are brought into my Flex app via an XML file, then I do get the errors above, but the images do load successfully. However, if my image paths come in as a result of a remote object call, I get the same errors and my images DON'T load successfully. I've double checked the exact path's that are being used in both situations by tracing out the path immediately before it is used as the value for the "source" property of the mx:Image tag and it is EXACTLY the same in both cases. So I have questions. First, why do I get those error messages? Secondly, if there really is a security sandbox violation, why do the images load successfully under the conditions I mentioned above? And finally, how do I prevent these violations from occurring in the first place? Thanks for any insight you can provide. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com Yahoo! Groups Sponsor ADVERTISEMENT 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 the Yahoo! Terms of Service.
[flexcoders] Xamlon Flash Edition (was: Flex 1.5 price)
As quoted by Darron (third party quote): with something like this out on the market, buying Flex or Lazslo would be such a lame decision. What!? With what (very) few details are available about Xamlon, I could maybe see it being a direct competitor to the traditional Flash IDE, but a competitor to Flex/Lazlo!? I suppose if your definition of Flex is a way to create SWF files through programming then maybe a comparison can be made. But if that's your narrow perception of Flex I think you're missing the point of Flex. To me, the REAL purpose of Flex is to enable fast creation of robust, usable Web applications. This is something that just could not be accomplished efficiently before Flex. And from the details I've seen, it doesn't appear that Xamlon will offer any accomodations in regard to Web applications. In Xamlon, the programmer will still be responsible for all that ugly low-level, tedious, error-prone work that was required with Flash...managing loading/unloading/instantiation/destruction of assets, managing positioning and sizing of GUI, designing event frameworks, trying to support browser history nav, trying to support accessibility, etc. I'd be happy to be proven wrong, but let's just be careful not to crown a successor to Flex prematurely. Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.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/
RE: [flexcoders] Redraw problems with TileList and custom cell renderer
I was able to find a work around...kind of. Instead of relying on data binding in my custom cell renderer I now set the new "source" value for the Image inside the setValue() function (see the code below). This seems to fix the image disappearance problem. But now I have a new problem. I can't seem to find any way to get the image to fill the entire cell after a resize. It just remains the same size that it was rendered initially. I've tried a number of things and just can't get it to work. What am I doing wrong?? MyCustomCellRenderer.mxml ?xml version="1.0" encoding="utf-8"? mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml"horizontalAlign="center"verticalAlign="middle" mx:Script![CDATA[ function setValue(str:String, item:Object){image.source = item.imageUrl; }]] /mx:Script mx:Image id="image" scaleContent="true" width="100%" height="100%" //mx:VBox Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com I just tried a big number of things both documented and undocumented and couldnt get it to work correctly. I have no idea why since this is something I thought we tested (though maybe it was with embedded images and not dynamically loaded). Ill file a bug on this but I dont have any good suggestions right now. Everything Ive looked at makes it seem like it should do the right thing. Sorry! Matt Yahoo! Groups Sponsor ADVERTISEMENT 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 the Yahoo! Terms of Service.
RE: [flexcoders] Flex on .Net? Any progress?
I understand that .NET web services could be accessed easily enough, but how does that solve Pushkar's dilemma? Wouldn't his client still have to expand their infrastructure to support a J2EE app server? That could be expensive, not to mention a hard sell from if the client is doing their own admin. Am I missing something? Kris -- Kristopher Schultz Developer Resource Interactive p: 614.410.2123 www.resource.com From: Robert Stuttaford [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 12:30 PMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders] Flex on .Net? Any progress? You could use web services! Works like a bomb. If using cairngorm, a rewriteto Remote Objects when Flex 2.0 ships is a matter of changing Services.mxml.If you want remoting but don't want to wait for 2.0, you could use FlashORBRemoting .NET 1.5 in the mean time (or forever, possibly) Yahoo! Groups Sponsor ADVERTISEMENT 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 the Yahoo! Terms of Service.