Re: [flexcoders] Ant Task to Build Air Package
arg line=-storepass ${STOREPASS}/ works for me. Which does much the same thing. Are you sure your ${STOREPASS} property is correct/has valid data? Ian On Mon, Sep 28, 2009 at 8:18 PM, seanmcmonahan s...@seanmonahan.org wrote: I'm working on an Ant build script to build and package my Air application. So far it works pretty well except I cannot get the script to use the password for the signing certificate. ADT is invoked like this: java jar=${ADT.JAR} fork=true failonerror=true arg value=-package/ arg value=-storetype/ arg value=${STORETYPE}/ arg value=-keystore/ arg value=${KEYSTORE}/ arg value=-storepass/ arg value=${STOREPASS}/ arg value=${AIR_NAME}/ arg value=${BUILD_DIR}/temp-app.xml/ !-- Copy the main SWF -- arg value=-C/ arg value=${BUILD_DIR}/ arg value=${APP_ROOT_FILE}/ !-- Copy the assets -- arg value=-C/ arg value=${RELEASE_DIR}/ arg value=assets/ /java When I run the script from Flex Builder everything works fine until, I presume, it gets to the storepass. If I run this build from the Termninal on Mac OS I can manually type in the password when the build script gets to the storepass and then the script will complete the build. So my build script mostly works, anyone have any thoughts on how to get it to entirely work? Ideally I'd like to be able to run the script from Flex Builder, but using the Terminal or Command Prompt is fine as well, I just don't want to have to type the password in for the certificate. Thanks!
Re: [flexcoders] openGL overlayed on Flash
Try calling the updateAfterEvent() method of the MouseEvent you're using to track the mouse (probably in MOUSE_MOVE, I'm guessing). e.g. public function onMouseMove(ev:MouseEvent):void { _myCursor.x = stage.mouseX; _myCursor.y = stage.mouseY; ev.updateAfterEvent(); } HTH, Ian On Sat, Sep 26, 2009 at 12:02 AM, etaiweininger et...@hotmail.com wrote: Hello, Does anyone know how to overlay openGL on top of an Adobe AIR application? I have an animated cursor and I need it to refresh much faster than the Flash refresh rate. If I try to increase the global refresh rate, animation is way too choppy to support my cursor. Any thoughts? Thanks, Etai
Re: [flexcoders] Bringing application to front
If it's an AIR application, you can use the .orderToFront() method of your WindowedApplication. http://livedocs.adobe.com/flex/3/langref/mx/core/WindowedApplication.html#orderToFront%28%29 Ian On Tue, Sep 15, 2009 at 10:03 PM, nhid nhi...@gmail.com wrote: Hi, How should I go about implementing the following case: There's a timer on my application which will give an alert to the user 5 minutes before the session times out. It's working, but the problem is since the alert is a popup window, it appears inside the application and when the application is behind another application (browser, etc) or is minimized, the user won't see the alert and the applicaiton logs the user out because no action was taken. How can I bring the application to the front (to focus) or maximize it so the user will see the alert? Any suggestion is appreciated. Thank you!
Re: [flexcoders] Use Outline fonts in Flex AIR app?
Tracy, You can get a pretty good approximation by using a GlowFilter on a font, setting the quality to medium or high, the size to 2 or more and the strength to 1000. HTH, Ian On Sun, Sep 13, 2009 at 4:38 PM, Tracy Spratt tr...@nts3rd.com wrote: We need to display numbers on a screen with a busy background and the designers want to use an “outline” font. By this they mean a character that has an outline around it. Googling shows that the word “outline’ is used with font technical description/formatting, but that is not the same as a visual outline around the character. One post (from 2006) says that Flex/Flash does not directly support outline fonts and that one should create the characters in Flash. Worst case, we can do that but it means a lot of work, especially to support multiple sizes, and to provide runtime styling of the colors of the outline, and the interior. Any suggestions? Tracy Spratt, Lariat Services, development services available
Re: [flexcoders] Use Outline fonts in Flex AIR app?
Sorry, setting the filter on a text display object of some sort, not on a font! Ian On Sun, Sep 13, 2009 at 4:50 PM, Ian Thomas i...@eirias.net wrote: Tracy, You can get a pretty good approximation by using a GlowFilter on a font, setting the quality to medium or high, the size to 2 or more and the strength to 1000. HTH, Ian On Sun, Sep 13, 2009 at 4:38 PM, Tracy Spratt tr...@nts3rd.com wrote: We need to display numbers on a screen with a busy background and the designers want to use an “outline” font. By this they mean a character that has an outline around it. Googling shows that the word “outline’ is used with font technical description/formatting, but that is not the same as a visual outline around the character. One post (from 2006) says that Flex/Flash does not directly support outline fonts and that one should create the characters in Flash. Worst case, we can do that but it means a lot of work, especially to support multiple sizes, and to provide runtime styling of the colors of the outline, and the interior. Any suggestions? Tracy Spratt, Lariat Services, development services available
Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field
Take a look at flash.text.TextField.getCharBoundaries() (and other TextField methods). HTH, Ian On Mon, Aug 31, 2009 at 8:53 PM, Bazli...@thinkloop.com wrote: Anyone know how to get the X/Y coordinates of a specific character/letter in a text field or text input? Thanks!
Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field
Oh - sorry, should have said - you'll need to get at the .textField property of (for example) your mx.controls.Text object, which will give you back the raw flash.text.TextField for you to then call getCharBoundaries() on it. Unfortunately, .textField is a protected property of mx.controls.Text, so can't be seen from outside the class. The simplest way to get at it is to extend mx.controls.Text - build your own component that inherits from Text. That will give you access to the .textField property you need; then you can call methods on it as appropriate. HTH, Ian On Mon, Aug 31, 2009 at 9:19 PM, Ian Thomasi...@eirias.net wrote: Take a look at flash.text.TextField.getCharBoundaries() (and other TextField methods). HTH, Ian On Mon, Aug 31, 2009 at 8:53 PM, Bazli...@thinkloop.com wrote: Anyone know how to get the X/Y coordinates of a specific character/letter in a text field or text input? Thanks!
Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field
The mx.controls.TextInput component has the .textField property that I mentioned in my second email. Are you using spark.components.TextInput instead? In which case I don't know, I'm afraid - haven't delved that deep into Spark yet. Sorry! Ian On Mon, Aug 31, 2009 at 9:29 PM, Bazli...@thinkloop.com wrote: Hey Thanks Ian, I was just looking at that actually but TextInput doesn't seem to have it (Flex 4). I read that you can use: import mx.core.mx_internal; use namespace mx_internal; to access TextField and then getCharBoundaries() but that doesn't seem to work in Flex 4. Any ideas? Thanks, Baz On Mon, Aug 31, 2009 at 1:19 PM, Ian Thomas i...@eirias.net wrote: Take a look at flash.text.TextField.getCharBoundaries() (and other TextField methods). HTH, Ian On Mon, Aug 31, 2009 at 8:53 PM, Bazli...@thinkloop.com wrote: Anyone know how to get the X/Y coordinates of a specific character/letter in a text field or text input? Thanks!
Re: [flexcoders] Create a directory
Use a server-side language of some sort to do the processing - e.g. PHP, ASP or similar. Ian On Fri, Aug 28, 2009 at 3:01 PM, christophe_jacquelinchristophe_jacque...@yahoo.fr wrote: Hello, How to create a directory (and see if it exists) on the server from a flex application ? Thank you, Christopher,
Re: [flexcoders] Re: How to run another air application from air application
On Thu, Aug 13, 2009 at 11:07 AM, vladakg85vladak...@yahoo.com wrote: Hi, you help me a lot, but now I have some strange problem: This application cannot be installed because this installer has been mis-configured. Please contact the application author for assistance. If you're having trouble rolling your own updater, perhaps you should consider using the Air Update Framework which is supplied with the Flex SDK? There's information here: http://www.adobe.com/devnet/air/articles/air_update_framework.html http://blog.everythingflex.com/2008/08/01/air-update-framework/ HTH, Ian
Re: [flexcoders] Re: How to run another air application from air application
On Thu, Aug 13, 2009 at 11:44 AM, vladakg85vladak...@yahoo.com wrote: Yes, but I don;t want to use framework. I have to make manual update. I have methods that check if there is new version on server,manually download new version from server, and manually run installer, but I recived this message. This application cannot be installed because this installer has been mis-configured. Please contact the application author for assistance. Does the 0.2 .air file on the _server_ actually work properly when you try to manually install it? If no, there's your problem right there. :-) Does the 0.2 downloaded .air file actually work properly when you try to manually install it? If not, the download has gone wrong (nothing to do with the update framework). It the second case is true, try looking at the .air file contents in a text editor - does it just contain some HTTP or PHP error data or something? If a text editor doesn't reveal the answer, try a HTTP monitor such as Charles to see if anything odd is going on with the request/response. And try a byte-editor compare between your server .air file and the downloaded .air file. If the downloaded file _does_ work properly when manually installed, then I'm afraid I don't know what's going on - would need more context/test files. HTH, Ian
Re: [flexcoders] This mailing list vs the forum.
On Thu, Aug 13, 2009 at 10:26 AM, Andriy Panasa.pa...@gmail.com wrote: Forums in general are way superior to mailing lists to exchange the knowledge on the Internet. My main issue with that is: Mailing lists are push. Forums are pull. I'm on 6 or 7 different mailing lists. There's no way I'd get round to visiting 6 or 7 different forums to see what's updated several times a day; therefore I wouldn't ever read anything or answer anyone. Ian
Re: [flexcoders] RegExpValidator Not working with code-behind
Geoff, Try: public var validIPExpression:RegExp = /^(([01]?[0-9]\{1,2\}|2[0-4][0-9]|25[0-5])\.)\{3\}([01]?[0-9]\{1,2\}|2[0-4][0-9]|25[0-5])$/; instead. Could be because by directly specifying the expression, the MXML-AS parser correctly decides to treat it as a RegExp. But when directly binding to the value, binding sees it just as a String. HTH, Ian On Thu, Aug 13, 2009 at 5:17 PM, Geoffreygtb...@yahoo.com wrote: We use the code-behind technique to attach AS to MXML. Doing this has caused an interesting issue with RegExpValidator. If the regular expression is defined in the AS file and contains a quantifier, it causes validation to act funky. In the following example, if you type about 20 zeroes into the IP field it goes from invalid, to valid, and back to invalid. Obviously it should be invalid after the first zero is typed and stay that way unless a proper IP is entered. However, if you take the same regExp string and put it in the MXML file it works as expected. Note that escaping or not escaping the { or } characters while the string is in the AS file has no effect on the validation. Test.mxml - mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:local=* minWidth=800 minHeight=600 local:MyComp/ /mx:Application MyComp.mxml --- ?xml version=1.0 encoding=utf-8? custom:MyCompScript xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:custom=* mx:FormItem id=fiIPAddress label=IP Address: required=true mx:TextInput id=tiIPAddress/ /mx:FormItem mx:RegExpValidator id=ipValidator expression={validIPExpression} source={tiIPAddress} property=text trigger={tiIPAddress} triggerEvent=change noMatchError=Invalid IP Address Format./ !-- works if you use expression=^(([01]?[0-9]\{1,2\}|2[0-4][0-9]|25[0-5])\.)\{3\}([01]?[0-9]\{1,2\}|2[0-4][0-9]|25[0-5])$-- /custom:MyCompScript MyCompScript.as --- package { import mx.containers.Form; public class MyCompScript extends Form { [Bindable] public var validIPExpression:String = ^(([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}([01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])$; //public var validIPExpression:String = ^(([01]?[0-9]\{1,2\}|2[0-4][0-9]|25[0-5])\.)\{3\}([01]?[0-9]\{1,2\}|2[0-4][0-9]|25[0-5])$; // Neither of the above work public function MyCompScript() { super(); } } } Does this seem like a bug, or just a limitation introduced by using the code-behind technique? Thanks, Geoff p.s. Don't know what code-behind is? http://learn.adobe.com/wiki/display/Flex/Code+Behind
Re: [flexcoders] How to run another air application from air application
Take a look at the flash.desktop.Update class - call the update() method on the AIR file in question rather than using URLLoader(). There's a code snippet that does what you want here: http://livedocs.adobe.com/flex/3/html/help.html?content=updating_apps_1.html HTH, Ian On Wed, Aug 12, 2009 at 8:24 AM, vladakg85vladak...@yahoo.com wrote: I have one air application. Now I want to make custom update (no default, I want my component) and I made it to download new application version to my app folder now I need to install it, but I don't know how to invoke newVersion.air from action script code??? I try with this but doesn't work: var req:URLRequest = new URLRequest(file:///c:\Documents and Settings\vvucetic.newVersion.air); var rld:URLLoader = new URLLoader(); rld.load(req); fscommand(exec, file:///c:\Documents and Settings\vvucetic.newVersion.air);
Re: [flexcoders] Strange type-coercion error message! Ideas?
Looks like your objects belong to different ApplicationDomains. By which I mean - object 1 is created from a class called Tools.dal.dataObjects.dataInvestmentAllocation defined by module 1, and object 2 is created from a class called Tools.dal.dataObjects.dataInvestmentAllocation defined by module 2. As far as Flex knows, they are _different classes_, because they are defined in different ApplicationDomains. To fix this, make sure your module loading code passes ApplicationDomain.currentDomain, so the modules all share the same definition space. Hope that helps, Ian On Wed, Aug 12, 2009 at 9:49 AM, nwebbneilw...@gmail.com wrote: TypeError: Error #1034: Type Coercion failed: cannot convert Tools.dal.dataObjects::datainvestmentallocat...@2d28301 to Tools.dal.dataObjects.dataInvestmentAllocation. This one has me a little stumped! The client's project is modular, and has a 'global' array of data objects. They access them a bit like this: var dataIA:dataInvestmentAllocation = Application.application._dataCollection.DataObjectGet(investmentAllocation); Every other object works in the same way without issues. In fact I'm fetching two data objects without issues directly before this. The object I'm getting is in the array of objects, is of type dataInvestmentAllocation (excuse the casing!) and there is only one in the array, yet the error message seems to append an instance id to the type (?!). The only difference I can see is that with this object, it was created and added to the collection in the previous module (but as I said, it's there in the array, and it's put there way before I try to access it in the next module) Can anyone shed any light on this?
Re: [flexcoders]Is it possible to write a googletalk client in AIR
I believe GoogleTalk uses the open XMPP format. There's an AS3 library for XMPP here: http://code.google.com/p/as3xmpp/ HTH, Ian On Wed, Aug 12, 2009 at 9:16 PM, dorkie dork from dorktowndorkiedorkfromdorkt...@gmail.com wrote: If so can you provide some guidance before hand? Thanks!
Re: [flexcoders] Adobe Air: open file with associated application
If you use flash.net.navigateToURL(someLocalFileURL), it will open via your default browser. If the browser is configured correctly it will open the documents in their appropriate applications. HTH, Ian On Tue, Aug 4, 2009 at 4:24 AM, Everson Alvesjho...@eversonalves.com.br wrote: Hello, Is there a way to make an Air application to open a file, let's say a *.doc or *.ppt with their associated applications? -- Jhonny Everson
Re: [flexcoders] Re: AIR app, need MouseMove events NOT bounded by screen
Tracy, Can't you take a different approach? This is for panning the map, yes? How about, every frame: - if the mouseX is less than a certain amount (e.g. is in the left third of the screen), pan your map left. - if the mouseX is greater than a certain amount (e.g. the right third of the screen), pan your map right. You could add more complication than that - the further it is to the edge of the screen, the higher the move acceleration or whatever. That should get around your problem - not sure if it'll give you the user experience you desire, but it could be worth trying. HTH, Ian On Fri, Jul 31, 2009 at 2:26 PM, Tracy Spratttr...@nts3rd.com wrote: Once the mouse pointer position hits a screen border, further attempts to move in that direction do not generate mouseMove events. For example, put the pointer in the top left corner, and once you get (0,0), no more events are generated. If you put the pointer on a border and wiggle it along that border, the changes in the other axis do generate events, but that doesn’t really help me. I do not know what is happening at the AIR runtime/OS/driver level, but the mouse and joystick have the same behavior at the application level. Tracy Spratt, Lariat Services, development services available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Alex Harui Sent: Thursday, July 30, 2009 2:58 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: AIR app, need MouseMove events NOT bounded by screen If the app is fullscreen, how can you miss any mousemoves? Does the joystick continue to send events the AIR and the mouseMove doesn’t get sent or is it that the mouseMove doesn’t have different coordinates? Alex Harui Flex SDK Developer Adobe Systems Inc. Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Wednesday, July 29, 2009 9:31 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: AIR app, need MouseMove events NOT bounded by screen Thanks, but my issue is that the AIR app is full screen. And AIR does not provide any way to set the system cursor(mouse pointer) position. I think I have an interim solution that notes when the mouse position reaches a boundary and sends a message to the socket server which calls an OS level program to reset the cursor position. As hoped, AIR recognizes this action and the next mouse move begins at the reset position. I still have some wrinkles to work out but I think this will keep us going until we figure out something better. Tracy Spratt, Lariat Services, development services available From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Adrian Resa Jones Sent: Wednesday, July 29, 2009 1:04 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AIR app, need MouseMove events NOT bounded by screen Do I understand correctly that you want to track when the mouse cursor/joystick leaves the Air App window? I don't see why you shouldn't be able to reset the x y coordinates when they go off of the main application window. Not that logic always has anything to do with it. This is another one of those things that should be a given. Maybe this will help: http://nexus.zteo.com/2008/11/02/flex-how-i-worked-around-mouse_outs-inefficiencies/ --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: This AIR app is to be embedded in a consumer electronics product. It is a transparent UI that indirectly controls an underlying map application by sending messages via sockets. The product actually has a joystick and not a mouse and one requirement is that moving the joystick will cause the map to pan. In development, using a real mouse, when the mouse pointer hits a screen boundary, MouseMove events are no longer dispatched in that direction. In a corner, all events cease. This is causing me problems with continuing to send messages to the application to continue panning. I am hoping the joystick will behave differently, but am also looking for any other suggestions. I have considered using a timer to send repeated increments (the back-end app only needs position deltas), but I haven't figured out how to stop that. As far as I can tell, there is no way to set the position of the system cursor. If I could reset the mouse x,y to some positive values when it approached an edge, that would work as well. Is there anyway I can get deeper into the mouse event? If I could get a generic moving event, that would also suffice. Any thoughts? Tracy Spratt -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location:
Re: [flexcoders] disable app turn gray then it is disabled
Try: disabledOverlayAlpha=0 in the MXML for your Application class. or from AS3: this.setStyle(disabledOverlayAlpha,0); (assuming 'this' is referring to your Application class.) HTH, Ian On Thu, Jul 30, 2009 at 2:53 PM, Willy Ciwill...@gmail.com wrote: I can't find any answer on the web. then I disable the app using this.enabled=false; this action also show a gray layer, is there anyway I can disable the app without the gray layer? thanks Willy 617-606-3437 -- 6 X 9 = 42 http://www.wolframalpha.com/input/?i=meaning+of+life --
Re: [flexcoders] AIR app as a controlled desktop
App switch (ALT+TAB on Windows, or APPLE+TAB on OSX) will get around that one. I don't believe it's possible in AIR. It _may_ be possible with one of the many available wrappers - e.g. Northcode's SWF Studio: http://www.northcode.com/swfstudio.php HTH, Ian On Wed, Jul 22, 2009 at 10:01 AM, Tom Chivertontom.chiver...@halliwells.com wrote: On Wednesday 22 Jul 2009, simonjpalmer wrote: clicks? I want to be able to start my app, have it take over the user experience, a bit like PowerPoint in presentation mode, and only go back to You can't use full screen mode (ESC will always exit, right ?) - what about a window the size of the screen ? -- Helping to enthusiastically harness advanced ROI as part of the IT team of the year, '09 and '08 This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.Halliwells.com.
Re: [flexcoders] Need help tranforming some XML
Oh *sigh* - mind the line breaks. Ian On Mon, Jun 22, 2009 at 6:25 PM, Ian Thomasi...@eirias.net wrote: Hi Jason, Stepping through it, it works when you break that long line of E4X into separate components. (For some reason people seem to want to write really long E4X statements - I'm not quite sure why...) Like this, your loop works. for each (var contentRowItem:XML in _contentXML..row) { var moduleName:String = contentRowItem.Module; var topicXML:XML = new XML(topic /); topicx...@title = contentRowItem.LinkTitle; // This e4x creates an XMLList, so pull off the first entry var module:XML=finalXML.module.(@title == moduleName)[0]; // Likewise var topics:XML=module..subsection.(@title==contentRowItem.Subsection).topics[0]; topics.appendChild(topicXML); } However - I'd include a bit of error checking for those XMLLists... for each (var contentRowItem:XML in _contentXML..row) { var moduleName:String = contentRowItem.Module; var topicXML:XML = new XML(topic /); topicx...@title = contentRowItem.LinkTitle; var modulesList:XMLList=finalXML.module.(@title == moduleName); if (modulesList.length()!=1) throw new Error(Can't find single module with title:+moduleName); var topicsList:XMLList= modulesList[0]..subsection.(@title==contentRowItem.Subsection).topics; if (topicsList.length()!=1) throw new Error(Can't find single subsection with title:+contentRowItem.Subsection); topicsList[0].appendChild(topicXML); } My general approach to this type of stuff is: break it down. Store and trace out each part of your e4x statement in a separate variable, bit by bit. That'll show you where it's going wrong. HTH, Ian On Mon, Jun 22, 2009 at 5:54 PM, Merrill, Jasonjason.merr...@bankofamerica.com wrote: Been wrestling with a script that transforms some XML from one schema to another for a while, and have most of the transformation working, but having a hard time wrapping my head around the last little bit. Probably easy for some E4X XML gurus out there. The original XML (built automatically by the sever-side app) is fairly flat and looks like this: (_contentXML) xml rows row ID1/ID ModuleiBuild/Module SubsectionAssumptions/Subsection TopicStarting iRequire/Topic OverviewTo start iRequire, you will first need to do a few things, like create a user name and password./Overview AuthorSanders, Larry/Author …etc. /row row ID2/ID ModuleiDeliver/Module SubsectionTechnical Constraints/Subsection …etc. What I need to do, is take it from that “flat” form, and based on the values of some of the nodes (Module,Subsection, and Topic values), make new more hierarchical XML that is based on the Module, Subsection, and Topic values in the XML, so that it looks like this: xml modules module title=iPlan orderID=5 subsections subsection title=Assumptions topics topic title=”Starting iRequire” overview To start iRequire, you will first need to do a… /overview authorSanders, Larry/author /topics subsection title=Project Information/ /subsections /module module title=”iDeliver” orderID=”6” subsections subsection title=Assumptions/ ..etc. I have it assembled this far, where the module nodes are created just fine, and the subsections are appearing under the right module with the right title attribute: (finalXML) xml modules module title=iPlan orderID=5 subsections subsection title=Assumptions topics / /subsection subsection title=Project Information topics / /subsection /subsections /module module title=”iDeliver” orderID=”6” subsections subsection title=Assumptions topics / /subsection subsection title=Technical Constraints topics / /subsection subsection title=Design Phase Documents topics / /subsection subsection title=Implementation Phase Documents topics / /subsection /subsections /module …etc.
Re: [flexcoders] Need help tranforming some XML
Hi Jason, Stepping through it, it works when you break that long line of E4X into separate components. (For some reason people seem to want to write really long E4X statements - I'm not quite sure why...) Like this, your loop works. for each (var contentRowItem:XML in _contentXML..row) { var moduleName:String = contentRowItem.Module; var topicXML:XML = new XML(topic /); topicx...@title = contentRowItem.LinkTitle; // This e4x creates an XMLList, so pull off the first entry var module:XML=finalXML.module.(@title == moduleName)[0]; // Likewise var topics:XML=module..subsection.(@title==contentRowItem.Subsection).topics[0]; topics.appendChild(topicXML); } However - I'd include a bit of error checking for those XMLLists... for each (var contentRowItem:XML in _contentXML..row) { var moduleName:String = contentRowItem.Module; var topicXML:XML = new XML(topic /); topicx...@title = contentRowItem.LinkTitle; var modulesList:XMLList=finalXML.module.(@title == moduleName); if (modulesList.length()!=1) throw new Error(Can't find single module with title:+moduleName); var topicsList:XMLList= modulesList[0]..subsection.(@title==contentRowItem.Subsection).topics; if (topicsList.length()!=1) throw new Error(Can't find single subsection with title:+contentRowItem.Subsection); topicsList[0].appendChild(topicXML); } My general approach to this type of stuff is: break it down. Store and trace out each part of your e4x statement in a separate variable, bit by bit. That'll show you where it's going wrong. HTH, Ian On Mon, Jun 22, 2009 at 5:54 PM, Merrill, Jasonjason.merr...@bankofamerica.com wrote: Been wrestling with a script that transforms some XML from one schema to another for a while, and have most of the transformation working, but having a hard time wrapping my head around the last little bit. Probably easy for some E4X XML gurus out there. The original XML (built automatically by the sever-side app) is fairly flat and looks like this: (_contentXML) xml rows row ID1/ID ModuleiBuild/Module SubsectionAssumptions/Subsection TopicStarting iRequire/Topic OverviewTo start iRequire, you will first need to do a few things, like create a user name and password./Overview AuthorSanders, Larry/Author …etc. /row row ID2/ID ModuleiDeliver/Module SubsectionTechnical Constraints/Subsection …etc. What I need to do, is take it from that “flat” form, and based on the values of some of the nodes (Module,Subsection, and Topic values), make new more hierarchical XML that is based on the Module, Subsection, and Topic values in the XML, so that it looks like this: xml modules module title=iPlan orderID=5 subsections subsection title=Assumptions topics topic title=”Starting iRequire” overview To start iRequire, you will first need to do a… /overview authorSanders, Larry/author /topics subsection title=Project Information/ /subsections /module module title=”iDeliver” orderID=”6” subsections subsection title=Assumptions/ ..etc. I have it assembled this far, where the module nodes are created just fine, and the subsections are appearing under the right module with the right title attribute: (finalXML) xml modules module title=iPlan orderID=5 subsections subsection title=Assumptions topics / /subsection subsection title=Project Information topics / /subsection /subsections /module module title=”iDeliver” orderID=”6” subsections subsection title=Assumptions topics / /subsection subsection title=Technical Constraints topics / /subsection subsection title=Design Phase Documents topics / /subsection subsection title=Implementation Phase Documents topics / /subsection /subsections /module …etc. But what I can’t seem to get is that last part of how to insert the right topic data under each topics node (Overview, ID,
Re: [flexcoders] Ideas / input greatly appreciated
There's this: http://sourceforge.net/projects/flashlight-vnc/ HTH, Ian On Fri, May 29, 2009 at 6:29 PM, Rick Winscot rick.wins...@zyche.com wrote: You can create an account that allows 3 people to connect... for free (has this changed?). By ‘tall order’ I mean... 1. You cannot view a users desktop from Flash, Flex, or AIR 2. You cannot control the users computer (keyboard/mouse) from Flash, Flex, or AIR The only exception to this is Acrobat Connect – which uses a custom plugin to accomplish that feat. The only other alternative is to roll your own solution with a wrapper like Merapi to give you access to OS screen/input hooks which could be passed to AIR. A serious engineering effort to be sure. Flash - flash sharing (i.g. whiteboard) is possible if that is what you are trying to do... other than that you are out of luck. Have you looked at Flash VNC? http://www.darronschall.com/weblog/2005/11/flashvnc-released.cfm Alternatively, you could roll a hybrid solution: use Teamviewer for the remote viewing / control and then create a flex app that does all your custom pod stuffs. Cheers, Rick Winscot On 5/29/09 1:13 PM, Allan Pichler dreamc...@gmail.com wrote: But I was under the impression that connect pro is pretty expensive ??? Anyone know of an AIR app for the screen sharing that is launched from the main app??? --a From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Rick Winscot Sent: Friday, May 29, 2009 10:06 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Ideas / input greatly appreciated Screen sharing / remote control is a tall order for Flash based technologies at the present time. You might want to take a look at the Acrobat Connect Collaboration Builder SDK. http://www.adobe.com/devnet/acrobatconnect/articles/intro_sync_swf.html Cheers, Rick Winscot On 5/29/09 12:53 PM, Allan Pichler dreamc...@gmail.com wrote: Hi all. I’m trying to find a low cost solution to do 1-1 screen sharing/remote control, preferably inside a flex application, alternatively as a popup window. The application also need some other collaboration widgets, so I was looking at Acrobat Connect, but I can’t find any information about customization of the user interface and adding new pods. Any help You can give is much appreciated! Best regards and have a nice day! Allan Pichler Brewmaster - ColdFusion/Flex/Ajax/UI -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links * 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:flexcoders-dig...@yahoogroups.com mailto:flexcoders-fullfeatu...@yahoogroups.com * To unsubscribe from this group, send an email to: flexcoders-unsubscr...@yahoogroups.com * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Strange error
That's a perfectly reasonable error. Both things compile to a class called CustomSkin - and you can't have two classes in the same project called CustomSkin. Sounds like your sample project wasn't set up to compile - are you sure whoever provided the project isn't just giving you two separate examples of the same thing, one version in MXML, one version in AS? I suspect you aren't supposed to be trying to compile the two together. HTH, Ian On Wed, May 27, 2009 at 8:35 PM, markgoldin_2000 markgoldin_2...@yahoo.com wrote: I am getting the following error: Severity and Description Path Resource Location Creation Time Id D:\projects\sfcs\UFDCommonLib\src\CustomSkin.as and D:\projects\sfcs\UFDCommonLib\src\CustomSkin.mxml can't co-exist in the same directory. UFDCommonLib Why is that? I am using a sample project I got from the web and these files are in the same directory. Thanks for help.
Re: [flexcoders] Re: How to optimise SWC to its minimal size?
You can use the 'externs' command-line option to the Flex compiler to tell Flex to exclude specific classes - as long as you're sure that your code _will_ have access to them at runtime. Documentation here: http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html HTH, Ian On Fri, May 22, 2009 at 4:13 PM, lytvynyuk lytvyn...@yahoo.com wrote: Any ideas? Hey, Flex gurus I know you are here! :)
Re: [flexcoders] Re: Why would as keyword not work
As Pedro says - my guess would be that you are passing a DetailData object from one module to the other when you haven't loaded the modules in the same ApplicationDomain (or from one compiled .swf to another, if you're not using modules). Take a look at the documentation for ApplicationDomain. HTH, Ian On Thu, Apr 30, 2009 at 6:18 PM, Pedro Sena sena.pe...@gmail.com wrote: Are you using modules? On Thu, Apr 30, 2009 at 2:17 PM, valdhor valdhorli...@embarqmail.com wrote: Hmmm. Looks like I misspoke. now I get... Type coercion failed. Cannot convert Model.ValueObjects::detaild...@11c0a941 to Model.ValueObjects.DetailData. What is the difference between a Model.ValueObjects::DetailData and a Model.ValueObjects.DetailData
Re: [flexcoders] Re: Why would as keyword not work
Steve, My guess at what is going on - based on my limited understanding of what you're doing - is: - You have your class definition (DetailData) compiled in to your main application and into your module. - You load your module into your main application - Because you have not specifed that you want your module to be in the same ApplicationDomain as the main application, its class definitions remain segregated from the main application's class definition. - Your module creates the DetailData (whether on return from remoting call or not) by instantiating it's own definition of DetailData (call it class DetailDataA, if that helps). - The event fires from your module to your application. - Your event handler tries to cast the created object - which is of type DetailDataA - to its _own_ definition of DetailData (call it class DetailDataB). Hence your error. No matter that the two class definitions are actually identical - because they are not in the same ApplicationDomain, the code treats them as separate. Now, if you alter your module loading so that you pass in ApplicationDomain.currentDomain as the domain you want the module to load into, the problem should go away. (ModuleLoader.applicationDomain=ApplicationDomain.currentDomain) I hope that makes some sort of sense. Of course, I may have totally misunderstood your situation! HTH, Ian On Thu, Apr 30, 2009 at 9:11 PM, valdhor valdhorli...@embarqmail.com wrote: Alex - I have read your Modules presentation about twenty times so far as well as any other documentation I could find on Modules and Application Domains. I'm pretty sure I understand everything so far. Pedro - The ValueObject is only being used by this particular module - not by the application (Or any other module). Ian - All other modules work fine with the exchange data. Note that the exchange data and this value object are two different things. I am NOT passing this value object as part of the exchange data. The VO gets created from a remoteObject call. All the above being said, I think I have found my problem. The click event was handled in the renderer. This works fine in an application but does not seem to in a module. By moving the click handler to the datagrid component, the error disappears. This problem crept in whilst I was moving my monolithic app to a series of modules. Thanks for taking the time to push me in the right direction. Steve If anyone can enlighten me as to why click events in item renderers work differently in modules than applications, please do. --- In flexcoders@yahoogroups.com, Ian Thomas i...@... wrote: As Pedro says - my guess would be that you are passing a DetailData object from one module to the other when you haven't loaded the modules in the same ApplicationDomain (or from one compiled .swf to another, if you're not using modules). Take a look at the documentation for ApplicationDomain. HTH, Ian On Thu, Apr 30, 2009 at 6:18 PM, Pedro Sena sena.pe...@... wrote: Are you using modules? On Thu, Apr 30, 2009 at 2:17 PM, valdhor valdhorli...@... wrote: Hmmm. Looks like I misspoke. now I get... Type coercion failed. Cannot convert Model.ValueObjects::detaild...@11c0a941 to Model.ValueObjects.DetailData. What is the difference between a Model.ValueObjects::DetailData and a Model.ValueObjects.DetailData
[flexcoders] AS3 loading AS2 getBounds() issue
Hi guys, (This is an AS3 issue rather than Flex per se, but might be of interest.) I've discovered a strange bug with the AS2 MovieClip.getBounds() and MovieClip.getRect() methods. As far as I can tell, it only happens in this situation: AppA is an _AS3_ application. AppA loads AppB. AppB is an AS2 application. AppB loads AppC. AppC is an AS2 application. If you run AppA, then any getBounds() or getRect() calls on objects in AppC fail, but they work as expected in AppB. (If you just run AppB, then everything works as expected.) I've tried various variants of this; if, instead of loading AppB, you embed it into AppA at compile-time, the problem still occurs. It appears to be something to do with loading one VM1 movie into another one within a VM2 shell. For the curious, here's a Zip containing a minimal test setup: http://www.wildwinter.net/public/getBoundsBug.zip All suggestions for workarounds welcomed, as this is a real nuisance for what we're currently working on. (For reference, this is in Flash Player 9,0,115,0, using either Flex compiler 2.01 or Flex Compiler 3.0 for the AS3 and using Flash 8.0 or MTASC for the AS2.) Cheers, Ian
Re: [flexcoders] AS3 loading AS2 getBounds() issue
Hello Alex, This is nothing to do with communication between the VMs. As it happens, for our actual production app, we are using Grant Skinner's SWFBridge to communicate via LocalConnection. But the sample Zip I've provided shows the bug, and has nothing to do with VM-VM communication - a simple Loader component shows the problem. To restate the simplest test case: AS3 app A loads AS2 app B (via a Loader component) AS2 app B loads AS2 app C (via MovieClipLoader) MovieClip.getRect() and MovieClip.getBounds() _fail_ within app C, and work within app B. No communication (other than loading) required. Thanks, Ian On Tue, Mar 11, 2008 at 5:23 PM, Alex Harui [EMAIL PROTECTED] wrote: AS3 and AS2 are different VMs and cannot access each other. LocalConnection or ExternalInterface can be used instead. Google for AS2 SWF Loader for some existing solutions. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ian Thomas Sent: Tuesday, March 11, 2008 3:13 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] AS3 loading AS2 getBounds() issue Hi guys, (This is an AS3 issue rather than Flex per se, but might be of interest.) I've discovered a strange bug with the AS2 MovieClip.getBounds() and MovieClip.getRect() methods. As far as I can tell, it only happens in this situation: AppA is an _AS3_ application. AppA loads AppB. AppB is an AS2 application. AppB loads AppC. AppC is an AS2 application. If you run AppA, then any getBounds() or getRect() calls on objects in AppC fail, but they work as expected in AppB. (If you just run AppB, then everything works as expected.) I've tried various variants of this; if, instead of loading AppB, you embed it into AppA at compile-time, the problem still occurs. It appears to be something to do with loading one VM1 movie into another one within a VM2 shell. For the curious, here's a Zip containing a minimal test setup: http://www.wildwinter.net/public/getBoundsBug.zip All suggestions for workarounds welcomed, as this is a real nuisance for what we're currently working on. (For reference, this is in Flash Player 9,0,115,0, using either Flex compiler 2.01 or Flex Compiler 3.0 for the AS3 and using Flash 8.0 or MTASC for the AS2.) Cheers, Ian
Re: [flexcoders] AS3 loading AS2 getBounds() issue
Alex, It works correctly when app A loads app C directly. As I said, the test sources are minimal. They contain no excess code or dependencies. I have tested this thoroughly in a number of scenarios and believe it's a player error. I have logged this as an error on Jira. Thanks, Ian On Tue, Mar 11, 2008 at 7:57 PM, Alex Harui [EMAIL PROTECTED] wrote: Does it fail for app A loading app C directly? Maybe there is some dependency in app C that isn't in app B like access to stage. I won't have time to diagnose from your sources, so maybe someone else will take the time.
Re: [flexcoders] REALLY wierd compiler problem, honest this is what happened!
I have had a similar (not compiler-related) problem on Vista which had me just as puzzled: Details here: http://wildwinter.blogspot.com/2007/04/aaagh-vista.html But the basic result was that the problem was all to do with Vista's user account control; shadow-copying files unexpectedly. If you're on Vista, it might be something to do with that. If not - no idea, I'm afraid! Ian On Dec 15, 2007 8:58 AM, Giles Roadnight [EMAIL PROTECTED] wrote: I've been working on a project at home for a few weeks now. I made quite a bit of progress last weekend and committed it all to CVS. Last night I went back to it to do some more work. There was a slight problem that an alert box had Login Error as a title rather than Error so I fixed that in the code and compiled the project. It still said Login Error. I put some break points and traces in to make sure that I was looking at the correct bit of code. The break points fired but no traces appeared and the old variable value (Login Error) was still there ven though I'd changed the code. Very Odd. I then cleaned the project, no difference. Checked out a fresh copy of the project, no difference. Tried it on a different computer, same thing. I then started removing bits of the project, I deleted module files, removed code that popped up the login dialogue, removed a component and the custom preloader. All I should get now is an empty panel with test as the title. I cleaned the project, made sure all the files in the output directory were gone and compiled - I STILL got the whole project as it had been to begin with. I tried lots of combinations of moving the build folder, cleaning ect and nothing worked. Has anyone ever had anyhtign like this? It really does seem impossible to me - I had deleted all the code and the compiled swfs. I have no idea where the swf were being generated from. This morning I have finally managed to fix it. I deleted everything except the default MXML file and everythgin within that except for the bare minimum. I then gradually added the assets back in and I now have it all working again (and it says Error rather than Login Error). I have no idea what happened. It would be good to hear that I'm not goign mad. Thanks Giles
Re: [flexcoders] Replace color in animation?
Bjorn, If all of the areas you want to change (e.g. the red areas of the image) are exported as a single sub-movie-clip of the overall movie-clip, you can use the flash.geom.ColorTransform class to change the colour of everything in that subclip. That works for us. Hope that's helpful, Ian On Nov 15, 2007 11:51 AM, bjorn - [EMAIL PROTECTED] wrote: Ok, this is maybe a bit offtopic but I'll give it a shot anyway -- We get vector animations created in Illustrator from a design shop, which we convert to MovieClips and use in flash. What I would like to do is replace a specific color in flash in runtime. E.g. if it's a car I'd like to be able to specify it's color as blue instead of red. Is this possible? --
Re: [flexcoders] Croping area
Hi Anzer, Have two copies of your image; one set to 0.5 alpha and one in front of that set to 1.0 alpha. Use a rectangular mask on the image in front (DisplayObject.mask) That should do it. Ian On 10/24/07, Anzer [EMAIL PROTECTED] wrote: Hi, I am working in an image manipulation application and I have almost finished with that. Now I have a problem with image cropping UI. I want to make the image shaded (alpha = .5) except what seen through the crop area. The crop area is draggable. Please give suggestions to do this
Re: [flexcoders] Re: Croping area
Hi Anzer, I'd do something like: - on CLICK on the frontmost image, install a MOUSE_MOVE listener to start listening to MOUSE_MOVE events - on MOUSE_MOVE, adjust the x and y of your mask clip (not the image itself) appropriately. - on RELEASE on the frontmost image, uninstall the MOUSE_MOVE listener That's the basics of it, I think. Hope that points you in the right direction, Ian- Hide quoted text - On 10/24/07, mailtoanzer [EMAIL PROTECTED] wrote: Thank you for the reply. I tried your solution but I couldnt make the crop area draggable. I am trying to do something similar to the crop tool in http://www.picnik.com/. http://www.picnik.com/ My crop area is not resizable but the whole image can be scaled by dragging the corners. I have completed the scaling of image and cropping, the only thing remaining is the alpha for image area except croping area. Please let me know if there is any solution
Re: [flexcoders] Re: Croping area
You're quite right, Jon - I'd completely forgotten that reverse order could cut out from a shape. Ian On 10/24/07, Jon Bradley [EMAIL PROTECTED] wrote: Creating multiple versions of an image is a bit much on the overhead. Plus, you don't have the capability of doing a white wash, or dark wash, or custom color overlay for the crop. In my applications I've written a an 'overlay' class. It's is a filled rectangle drawn in clockwise fashion, with an inner rectangle drawn in reverse order (matching the crop box transformation). This is pretty easy to do. Just write a new function that will draw a rectangle in reverse order (counter-clockwise) and do something like the following: overlay.beginFill() overlay.drawRect( image rectangle, false); // where false means draw normal, or clockwise overlay.drawRect( crop rectangle, true) // draw it reverse making a hole overlay.endFill() So, in short, don't use another image because you'll overcomplicate things, imho. Use reverse fills as holes since it's faster and gives you more flexibility on the look. Anz --- any possibility we can take a look at your version of the picnic-style crop tool?
Re: [flexcoders] Take two: dynamic asset creation
Hi Alex, I've submitted this as a feature request on the Flex tracker. As an aside, the simplest solution is (I think) a very straightforward change to the Flex API. If the expected data fields were extended so that as well as 'icon' you passed in 'iconArguments' and those arguments, if present, were used as arguments to the asset constructor it would solve it all. And I don't think it would impact performance appreciably - the only difference is that internally Flex would call new SomeAssetClass(someArgs) instead of new SomeAssetClass(). The parameterisation of those constructors would open up so much more potential. Cheers, Ian On 10/23/07, Alex Harui [EMAIL PROTECTED] wrote: If we can figure out a way to allow this in the future, we will. You aren't the first person to ask for it. When we wrote 2.0, we were so worried about performance we made assumptions that skipped levels of indirection like the one you want.
Re: [flexcoders] Take two: dynamic asset creation
Fine - that'll work just as well. Ian On 10/23/07, Alex Harui [EMAIL PROTECTED] wrote: That's fine. We wouldn't do what you suggested though, we'd use IClassFactory in more places
[flexcoders] Dynamic class creation?
Hi all, Got a bit of a tricky problem here that I'm banging my head against... If you assume I have some function that returns a Class object - for example: getAssetClass(id:String):Class This returns a Class object which, at some future time, will be called with new SomeClass() to construct an instance of an object. Let's assume that the body of the function looks something like this: function getAssetClass(id:String):Class { return GenericAssetClass; } However, the actual behaviour I need changes depending on the value of 'id'. Effectively what I want to happen is for the returned class to be parameterised in some way - so that when new SomeClass() is called it evaluates to new GenericAssetClass(id). In AS2, this was possible because constructors were just functions. I could happily say: function getAssetClass(id:String):Function { return function():Object {return new GenericAssetClass(id);} } However, in AS3 this won't work, as Class is quite a different thing from Function. Changing GenericAssetClass.prototype.constructor doesn't help, as it's static and applies to all instances of GenericAssetClass. Doing something like this: function getAssetClass(id:String):Class { GenericAssetClass.id=id; return GenericAssetClass; } class GenericAssetClass { public static id:String; public function GenericAssetClass() { // Do something that depends on 'id' } } won't help either, because as soon as you change the static GenericAssetClass.id, that change applies to all the constructors you've handed out. I could do something like this: function getAssetClass(id:String):Class { if (id==id1) return GenericAssetClass1; else if (id==id2) return GenericAssetClass2; // etc. as required } but the trouble is that there is only one, parameterised GenericAssetClass and I can't define all the options up front - it truly is dynamic. *sigh* I've a feeling this ought to be possible, I just can't for the life of me think how. Is there any way I can hook into the new Class() call somewhere? Or uniquely identify each reference to GenericAssetClass that I've handed out, so that I can use a lookup table during the construction phase? Thanks in advance, Ian
Re: [flexcoders] Dynamic class creation?
Hi Christophe, Unfortunately not, but thanks. To explain, I'll copy a response email that I just posted to Flash_tiger: - I know of getDefinitionByName, but that won't work for me as I'm not returning back different class definitions - I'm returning the _same_ class definition each time, but want to parameterise it. As to why I'm doing this / what I'm hoping to achieve... I'm writing a framework that integrates with the Flex components but which is agnostic about where its assets come from. I have (for example) a BitmapData object - never mind how I got it - and want to be able to transform it into a BitmapAsset class to pass to (say) a TileList. To do that I need to be able to pass a Class rather than an instance - a descendant of BitmapAsset. I can't pass new BitmapAsset(bitmapData), because that's an instance, not a class. I can't pass just BitmapAsset, because it doesn't have the relevant bitmapData and has no way of getting it. I need to pass some sort of dynamic class or class function which can have new X() called on it and is parameterised with the appropriate bitmapData. Does that make any sense? Thanks, Ian On 10/22/07, Christophe Herreman [EMAIL PROTECTED] wrote: Hi Ian, maybe this will solve your problem (if I understood correctly): var clazz:Class = getDefinitionByName(com.domain.MyClass) as Class; http://livedocs.adobe.com/flex/2/langref/flash/utils/package.html#getDefinitionByName()http://livedocs.adobe.com/flex/2/langref/flash/utils/package.html#getDefinitionByName%28%29 regards, Christophe
Re: [flexcoders] Take two: dynamic asset creation
Thanks Arul, The more I delve in to this and experiment with it the more I'm beginning to think it's not possible. Ben Stucki has an interesting post on a similar solution: http://blog.benstucki.net/?p=42 But it relies on you needing to know exactly which component container the resulting object is destined for, and that won't work in TileLists (because ItemRenderers get reused). Josh Tynjala has a slightly different solution: http://www.zeuslabs.us/2007/09/28/actionscript-3-bitmap-image-classes-with-functions-and-loaders But it hits the same issue that I did, which is that in AS3 Function!=Class any more. It feels like it _ought_ to be easy. If it's really true that we can't use runtime-created assets with the Flex framework without handrolling a load of different ItemRenderers or creating our own subclasses of the Flex components, then that's very depressing and seems ill-thought-out. :-( Cheers, Ian On 10/22/07, Arul [EMAIL PROTECTED] wrote: Dear Ian, I understand your use-case, I also needed something similar Let me do a quick experiment and get back to you on this Regards, Arul www.shockwave-india.com/blog/ - Original Message - *From:* Ian Thomas [EMAIL PROTECTED] *To:* flexcoders@yahoogroups.com *Sent:* Monday, October 22, 2007 10:43 PM *Subject:* [flexcoders] Take two: dynamic asset creation Here's an easier way to explain the problem I posted about earler. If I create some BitmapAssets manually rathern than using embed: var b1:BitmapAsset=new BitmapAsset(someBitmapData1); var b2:BitmapAsset=new BitmapAsset(someBitmapData2); var b3:BitmapAsset=new BitmapAsset(someBitmapData3); How do I then pass them to something like a TileList, which expects an icon property of type Class: var rowData:Object={label:Some Label,icon:WhatGoesHere}; Where WhatGoesHere can't be BitmapAsset (that just produces an empty bitmap). Nor can it be b1, because that's not of type Class. The goal here is to achieve this without creating a new ItemRenderer. Thanks in advance, Ian
Re: [flexcoders] Take two: dynamic asset creation
Thank you, Alex. But as I said, that's what I'm trying to avoid doing; it means that I can't supply runtime-created asset data via any other means than rewriting/extending every single Flex component that I need to do it for. That seems completely backwards, and seems an ill-thought-out strategy in the creation of the Flex framework. Ian On 10/22/07, Alex Harui [EMAIL PROTECTED] wrote: You would write a custom itemRenderer to show bitmaps instead of class instances. -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Ian Thomas *Sent:* Monday, October 22, 2007 8:47 AM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Take two: dynamic asset creation Thanks Arul, The more I delve in to this and experiment with it the more I'm beginning to think it's not possible. Ben Stucki has an interesting post on a similar solution: http://blog.benstucki.net/?p=42 But it relies on you needing to know exactly which component container the resulting object is destined for, and that won't work in TileLists (because ItemRenderers get reused). Josh Tynjala has a slightly different solution: http://www.zeuslabs.us/2007/09/28/actionscript-3-bitmap-image-classes-with-functions-and-loaders But it hits the same issue that I did, which is that in AS3 Function!=Class any more. It feels like it _ought_ to be easy. If it's really true that we can't use runtime-created assets with the Flex framework without handrolling a load of different ItemRenderers or creating our own subclasses of the Flex components, then that's very depressing and seems ill-thought-out. :-( Cheers, Ian
Re: [flexcoders] Take two: dynamic asset creation
Thanks Arul - I've wrestled with it for about 6 hours now and am going to take a break for the night. A bunch of different avenues seem to be closed off: - You can't subclass Class - You can't replace the constructor() function of a class - You can't set any static data on the Class instance that you return, because that static data will apply to _all_ objects calling the constructor. - You can't clone a Class (effectively creating a new Class object dynamically) - You can't call new() on a Class and as said before - You can't pass a Function as the constructor as you could in AS2, or replace the constructor as you could in AS2 Ideally what we're looking for is some sort of ClassFactory or ClassProxy that can be passed as a Class. But because you can't subclass Class, that's looking impossible. I've taken a look at the native serialisation but can't see anything obvious there. Ben Stucki actually suggested creating a .swf on-the-fly in memory (as a ByteArray) - and including a new, dynamically created class in it - then loading it as a class library using Loader. That's a possibility, but it's going to be both tricky, asynchronous (I'm guessing!), inelegant and (comparatively) slow. Hopefully some brainwave will come to me overnight. :-) Cheers, Ian On 10/22/07, Arul [EMAIL PROTECTED] wrote: Dear Ian, Thanks for the links Right now I'm stuck in the same place as Josh Tynjala . old school style Function prototypes are not treated as Class. since flex components expect a class it fails But I'm going to dig further in the morning (now its 1 am in Singapore) Regards, Arul
Re: [flexcoders] Dynamic class creation?
Dan, Thanks for that; I don't think so (I'd already looked at it). As far as I can see it's only useful for things expecting a ClassFactory, not a Class. Cheers, Ian On 10/22/07, Daniel Freiman [EMAIL PROTECTED] wrote: Fill ClassFactory work? http://livedocs.adobe.com/flex/201/langref/mx/core/ClassFactory.html - Dan Freiman
Re: [flexcoders] Take two: dynamic asset creation
Thanks Alex. Bitmaps are only an example, here - any kind of derived Asset class suffers from the same issues. I can understand your comments about CSS skinning etc.; and that the Flex framework is designed for embedding. The particular situation I am working in requires - specifically - that image data in data-driven elements - for example, a TileList - is not from embedded images, but is from runtime-generated images (whether they are bitmaps or not is immaterial - I was using bitmaps as an example). And we are in the process of building a framework that is completely agnostic about where resources come from - from embeds, from external libraries, from user-generated code, from cloning other resources, from ByteArrays fetched across sockets etc. As I'm sure you can see, making that resource framework play nicely with existing (or future) Flex components is very much on the agenda, and we'd prefer not to have to customize existing Flex components (even via ItemRenderers etc.) if we can just use them out of the box. (This is an API which is being handed to other coders, and should therefore be as clean as possible). At the root of it all, I do find it odd that if I have dynamically generated, say, a BitmapAsset (without embedding) that I can't just pass it into a Flex Component at the point at which it needs a BitmapAsset. The trouble is, Flex needs a Class, and all I have is a (perfectly valid) instance. That seems wrong. It seems there should be some way of me being able to go backwards from my instance and find the original class. And there is, of course, but it's useless to just pass a vanilla BitmapAsset class in to Flex because you'll end up with a blank bitmap. Hence my problem. :-) On 10/22/07, Alex Harui [EMAIL PROTECTED] wrote: Anyway, if you absolutely have to do this, and you know the total number of different assets you are going to create, you can make different Bitmap subclasses that clone their bitmap data at instantiation time and assign the dynamic assets to those Bitmap subclasses. -- I don't quite get this - could you possibly expand on it further? Thanks, Ian
Re: [flexcoders] Dynamic class creation?
Alex - again, thanks. Please see the other thread for a much fuller explanation. Cheers, Ian On 10/22/07, Alex Harui [EMAIL PROTECTED] wrote: I repeat: the recommended practice is to use a custom itemRenderer.
[flexcoders] Caret position
Hi folks, Is there any way to set the caret position (or the selection) in a TextField object? All three of the relevant properties - caretIndex, selectionBeginIndex, selectionEndIndex - are read-only. Any ideas? Thanks, Ian
Re: [flexcoders] Caret position
Daniel, *sigh* Thanks very much. Now I feel really stupid. :-) But also very grateful, as for a while I thought that Adobe had missed out that functionality, for some strange reason. :-) Cheers, Ian On 08 Apr 2007 08:41:02 -0700, Daniel Freiman [EMAIL PROTECTED] wrote: Try setSelection(). - Daniel Freiman nondocs? http://nondocs.blogspot.com
Re: [flexcoders] an as3 zip library
Brilliant - thanks David. Ian On 3/5/07, David Chang [EMAIL PROTECTED] wrote: Hello, I had put together a small library for handling zip files and thought I'd share it. Anyways if you're interested, you can find more info at http://nochump.com/blog/?p=15 David
Re: [flexcoders] Flex/Flash on The iPhone ?
Pretty sure. Watch the 'image zoom' movie - putting two fingers on the screen and moving them apart zooms the image... Ian On 1/10/07, Merrill, Jason [EMAIL PROTECTED] wrote: The same way Safari does. (but are you sure there are multiple simutaneous mouse events in the iPhone?) Jason Merrill Bank of America Learning Organizational Effectiveness
Re: [flexcoders] Re: SEO Compatibility
On 12/28/06, Kevin Newman [EMAIL PROTECTED] wrote: What you have described is basic deep linking, but does not solve the problem I have been attempting to articulate. Regardless of what goes on on the server, if you enter some path info after the .com part of the url, the server thinks it is getting its data from that location (foo.com/bar/ for example). Not quite true. You can use mod_rewrite (on Apache) to chop up the URL - everything after the foo.com/ can be altered internally to be a request to something else entirely, without affecting the browser. e.g. the client enters foo.com/bar/monkey internally, mod_rewrite alters it to foo.com/index.php?page=bar/monkey, but the user still sees foo.com/bar/monkey in his browser. I've done it lots, I know it works. :-) You can then enter your application at any point you like based on a complete URL - e.g. passing it through to Flash as flashvars via PHP. But as you say, unless we then update the browser's location bar when we move through the app, it doesn't help much. :-) Cheers, Ian
Re: [flexcoders] Re: SEO Compatibility
On 12/17/06, Claus Wahlers [EMAIL PROTECTED] wrote: PLUS.. ;) I'd be interested in how Ajax applications handle SEO, as they likely face the same, or similar problems. Ok, Ajax apps probably don't face as much problems as Flex apps as the displayed data is HTML and contains links that spiders can follow, so disregard this. No, actually, you're quite right, Claus. A lot of data is displayed in AJAX by a Javascript function loading data via an XMLHttpRequest object, and writing the contents of the request into the current document. Spiders won't be able to follow the links in the Javascript functions, and so won't see the results. Ian
Re: [flexcoders] Tamarin, Adobe open source the Flash player ?
Hi Tom, Just came across the same thing myself - that's a stunning contribution, if I'm reading it right. It basically looks like Adobe are providing the source of the AVM2 bytecode interpreter/runtime engine to Mozilla so that Mozilla can use it as the execution engine for their ECMAscript/Javascript engine (SpiderMonkey). Doesn't look like open sourcing the Flash player, I'm afraid tho'. :-) Ian On 11/7/06, Tom Chiverton [EMAIL PROTECTED] wrote: (http://www.adobe.com/aboutadobe/pressroom/pressreleases/200611/110706Mozilla.html) I can't work out if this is effectively open souring the Flash Player (as Sun is doing with Java) or not. It seems they've opened up the bits that take Flash bytecode (a .swf) and turn it into native code inside a plugin. I think ( Mozilla FAQ: Source code [for] ActionScript Virtual Machine (AVM2) ... in Adobe Flash Player 9, including the Just In Time (JIT) runtime compiler ). The Mozilla FAQ isn't the clearest thing I've read this morning, but I've only had one tea, so does anyone else want to try ? -- 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/
Re: [flexcoders] Loading AVM1 content into AVM2
On 9/17/06, Daniel Wabyick [EMAIL PROTECTED] wrote: Yeah, I just reproduced your bug ... Seems like the reference to _root gets screwed up on subsequent calls. What's *really* interesting ... If I comment out the cleanup in your AVMLoader class, I can *crash* Eclipse ... if (_loader!=null) { //_loader.unload(); //removeChild(_loader); //_loader=null; } Wow - yes. Certainly Firefox crashes if I comment it out; I don't know if that's the same issue you were having. I'll make sure that gets filed, too. Thanks. Note that your publish path for your FLA is incorrect. It should be bin/AVMTestMovie.swf but its bin/AVMMovie.swf. Whoops - thanks; I renamed it to make things a bit clearer just before I made the archive (of course!) Cheers, Ian -- 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] Loading AVM1 content into AVM2
Hi guys, I've hit a huge hurdle when trying to communicate between AVM1 and AVM2. I've been trying to create a component - call it AVM1Loader - which will allow simple communication between an AVM2 flex app and a contained AVM1 file. In theory, it's pretty simple: - Use Loader to load the file. - Create a LocalConnection for AVM2 to talk to AVM1 - Create a LocalConnection for AVM1 to talk to AVM2 This all works fine, and communications all work. However, the problem comes with the naming of the LocalConnections. Clearly each AVM1Loader instance wants to have a differently named pair of LocalConnections; otherwise you'll get into trouble if you're trying to have two AVM1Loaders running together at the same time - or even two instances of the same Flex app running together at the same time. Generating a unique ID is easy, but I can't for the life of me work out how to communicate it to the contained AVM1 file. The obvious way would be to pass it as a parameter: e.g. _loader.load(new URLRequest(AVM1File.swf?key=+someUniqueKey)); That works, but only (apparently) once. The next time you try to load AVM1File.swf with a _different_ key (under a whole new instance of AVM1Loader) something very odd happens. The key value does get transmitted correctly on the second run, but the _root of the contained movie gets screwed up. These simple trace statements are on the root of AVM1File.swf: trace(_root); trace(_root.clip); // (Clip is an instance defined on the stage of AVM1File) trace(_parent); On the first (successful) load (i.e. loading AVM1File.swf?key=someUniqueKey), I get: _root _root.clip undefined Which is as expected. On the second run through (i.e. loading AVM1File.swf?key=someOtherKey), I get: _root _level0.App0.Panel4.contentPane.AVM1Loader40.instance55.instance56.clip _level0.App0.Panel4.contentPane.AVM1Loader40.instance55 Which is very strange - suddenly my AVM1 code is seeing its AVM2 instance name. And from that point on, the AVM1 code stops working correctly - loading clips etc. fails. If I change the URL to just AVM1File.swf it all works fine, but obviously my unique key doesn't get transmitted. Similarly, fixing the URL - sending AVM1File.swf?key=dummy each time - works fine. Somethings up when you alter the parameter. It's a new instance of Loader() - I'm not reusing anything. So - that's clearly some sort of bug, and I seem to have hit a blank wall there. If anyone's got any ideas on that peculiarity then great. But that aside, if anyone's got any brainwaves on how to simply communicate a unique ID to an AVM1 file I'm loading, that'd be great. :-) Yours in frustration, Ian -- 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/
Re: [flexcoders] Loading AVM1 content into AVM2
Hi Daniel, Thanks for that. If I understand you correctly, you're suggesting creating a known LocalConnection which acts as an 'ID server' in AVM2. I had thought about something similar. The issue is that I can't see how the pairing up works between an AVM1Loader (the AS3 component) and it's contained AVM1 movie. I can understand using a known point for the AVM1 movie to talk to, but can't see how you can guarantee that the right IDs can be guaranteed to be known by both parent and child if, for example, two such pairs are being created at the same time. You can't queue it - e.g. FIFO - because you can't guarantee that the first AVM1 movie loads faster than the second. And you can't even do it by URL mangling or somesuch, because we might be dealing with loading the same movie into two different components (which is the case in my setup). Additionally, I think the known server fails if (for example) two copies of the same Flex app were running at the same time - although I guess you could get around that by querying LC_DAEMON to see if it already exists before creating it. I'll play around with the idea and see if I can make sense of it; unless you've any other light to shed. :-) Thanks for the Adobe info - I'll create a simple test case and drop a note to them.Cheers, IanOn 9/16/06, Daniel Wabyick [EMAIL PROTECTED] wrote: That most definitely sounds like a bug ... I think the following would work: - Create a class LocalConnectionDaemon in AVM2 that is connected under a hardcoded LC name. ( e.g. LC_DAEMON ); - Create a class LocalConnectionDaemon in AVM1 that does the following: - Generates a unique LocalConnection URL based on the current-time-millis ( e.g. var clientId:String = LC_CLIENT_1324343243243 ) - Send a command to LocalConnectionDaemon via - LC_SERVER .. createClient( clientId ) - Listen for a command (on that same LocalConnection, or one the server can figure out) called onClientCreated( otherClientId:String ) - LocalConnectionDaemon should have a method createClient( clientId:String ) that takes the ID, and transforms it to a guaranteed unique name (e.g. var newClientId:String = clientId + _AVM2) and sends onClientCreated( newClientId ); Definitely more painful, but doable. I should point out that one big issue with LocalConnection is that messages are limited to 40kb. You may need to chunk your requests over if they are large. Also, just thought this would be a good time to point out Adobe's bug-report / wishlist page. If you send them a *reproducable* bug report, they will get back to you very quickly: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform Regards, -D Ian Thomas wrote: Hi guys, I've hit a huge hurdle when trying to communicate between AVM1 and AVM2. I've been trying to create a component - call it AVM1Loader - which will allow simple communication between an AVM2 flex app and a contained AVM1 file. In theory, it's pretty simple: - Use Loader to load the file. - Create a LocalConnection for AVM2 to talk to AVM1 - Create a LocalConnection for AVM1 to talk to AVM2 This all works fine, and communications all work. However, the problem comes with the naming of the LocalConnections. Clearly each AVM1Loader instance wants to have a differently named pair of LocalConnections; otherwise you'll get into trouble if you're trying to have two AVM1Loaders running together at the same time - or even two instances of the same Flex app running together at the same time. Generating a unique ID is easy, but I can't for the life of me work out how to communicate it to the contained AVM1 file. The obvious way would be to pass it as a parameter: e.g. _loader.load(new URLRequest(AVM1File.swf?key=+someUniqueKey)); That works, but only (apparently) once. The next time you try to load AVM1File.swf with a _different_ key (under a whole new instance of AVM1Loader) something very odd happens. The key value does get transmitted correctly on the second run, but the _root of the contained movie gets screwed up. These simple trace statements are on the root of AVM1File.swf: trace(_root); trace(_root.clip); // (Clip is an instance defined on the stage of AVM1File) trace(_parent); On the first (successful) load (i.e. loading AVM1File.swf?key=someUniqueKey), I get: _root _root.clip undefined Which is as expected. On the second run through (i.e. loading AVM1File.swf?key=someOtherKey), I get: _root _level0.App0.Panel4.contentPane.AVM1Loader40.instance55.instance56.clip _level0.App0.Panel4.contentPane.AVM1Loader40.instance55 Which is very strange - suddenly my AVM1 code is seeing its AVM2 instance name. And from that point on, the AVM1 code stops working correctly - loading clips etc. fails. If I change the URL to just AVM1File.swf it all works fine, but obviously my unique key doesn't get transmitted. Similarly, fixing the URL - sending AVM1File.swf?key