[flexcoders] Re: Sandbox violation running from Builder. How did I get this and how do I fix it?
I also get a security sandbox violation error on a flex project after checking out from SVN. I have a flex project that compiles and runs fine on the original development computer. I then check in my source code to an SVN repository. When a fellow developer checks the project out from SVN and tries to compile on their system, they encounter the security sandbox violation error. My flex application never tries to access a remote file. The security sandbox violation occurs while trying to access a local XML file in the project directory (source code in src/, swf in bin-debug/ and xml file in assets/ --- all three are sister directories). If anyone has figured out the solution to this puzzle, please post! Best wishes, -- j --- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote: It was *something* funky caused by svn checkout. First I check out via builder to my workspace (file location as well as create project) and I got the problem. I checked out to a directory completely separate from my workspace via another SVN client, and then copied the tree to the builder workspace directory and created a new project in Builder, still didn't work. Finally I created yet another project, quit flex, copied the /src directory from my checkout, deleted all dotfiles (svn and whatever else) with a find | grep | xargs rm and re-started flex, and now it works (but it's not checked out, just effectively exported). The workspace isn't listed in Flash Player's trusted locations through the advanced settings UI, so it'd be really nice to know how the player determines what is and isn't a builder swf, so I can take whatever's causing the damned problem out of SVN (or put it back in if it's missing something) - and also let other devs on the list and in my office know what to look out for :) -Josh On Fri, Jun 6, 2008 at 12:51 PM, Bjorn Schultheiss [EMAIL PROTECTED] wrote: Are you sure its not a security settings related issue.. www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Rick Winscot rick.winscot@ wrote: Also. where is the project 'physically' located? I would strongly recommend making sure that the project is inside your workspace. Are there any compiler options like -use-network=false present? Rick Winscot From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of Tracy Spratt Sent: Thursday, June 05, 2008 9:03 PM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: RE: [flexcoders] Sandbox violation running from Builder. How did I get this and how do I fix it? Very strange. There was a similar thread a couple days ago and we did not find a solution, as far as I know. Did you create the new project by don't New Project and then copying in the files, or did you import the other project? (the first, I know, but maybe try the second?) Maybe try removing the application from the project's application list and then re-adding it? Tracy _ From: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com [mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] On Behalf Of Josh McDonald Sent: Thursday, June 05, 2008 8:42 PM To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Subject: [flexcoders] Sandbox violation running from Builder. How did I get this and how do I fix it? I've checked out a project into the same directory as all my other projects, and now I'm getting a security sandbox violation trying to load a local file even when running from Flex. What could cause this? And how do I get it back to behaving the way it should for all builder projects? -J -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: josh@ -- Therefore, send not to know For whom the bell tolls. It tolls for thee. :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
[flexcoders] Re: Runtime CSS and SWF is not a loadable module
About posting the swf in another way: I don't have any other webspace that I own. I'd be happy to use a file hosting site, but want to avoid having others register to view/download the file. What is your preferred posting method?. Does the group allow SWF as attachments to emal? In the meantime, please see below for the text of the CSS file that I used to make the style swf. All I did to make the SWF from the CSS is: mxmlc style.css Thanks again, -- j /* CSS file */ Application { background-alpha: 1; background-gradient-colors: #ff, #00; font-size: 10px; } Panel { titleStyleName: panelTitle; headerHeight: 32; borderColor: #660099; borderAlpha: 1; borderThicknessLeft: 10; borderThicknessTop: 0; borderThicknessBottom: 10; borderThicknessRight: 10; headerColors: #cc33ff, #660099; } .panelTitle { color: white; font-family: Arial, Helvetica; font-size: 14px; font-weight: bold; } Label { font-size: 20; color: #ff; font-weight: bold; } Button { cornerRadius: 15; textIndent: 0; highlightAlphas: 0.26, 0; fillColors: #ccff00, #99ff99, #ff, #cc; color: #ff; textRollOverColor: #336600; } --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: I'm unable to download those files. Try to find another way to make them available. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jamalwally Sent: Monday, July 21, 2008 5:53 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Runtime CSS and SWF is not a loadable module Was anybody able to view the css styles swf that I posted earlier? I'm still unable to implement runtime css because of the SWF is not a loadable module error. Any further help would be greatly appreciated. Thank you, --j --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex Harui aharui@ wrote: Post the swf. From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of jamalwally Sent: Wednesday, July 16, 2008 11:37 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Runtime CSS and SWF is not a loadable module Hi Tracy, I'm confident that FB3 can find the style swf since the following is printed to the console: [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:assets:style1.swf - 11,294 bytes after decompression Still not sure how to verify that the style1.swf is actually a style swf (though I have no reason to believe that it is not). James --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt tspratt@ wrote: Make sure the compiled css swf is actually where you expect. I am having problems with FB3 where the compiler misplaces the css swf, into a deeply nested folder structure under the bin folder, and I always have to copy it to the correct location. I plan to post a question on this some time soon. Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of jamalwally Sent: Wednesday, July 16, 2008 12:45 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Runtime CSS and SWF is not a loadable module Hello, I'm trying to implement runtime css in my flex application. I have compiled my css file into a swf with mxmlc mxmlc style1.css Then I load the resulting style1.swf on Application creationComplete: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=vertical creationComplete=StyleManager.loadStyleDeclarations('../assets/style1.s wf', true, true) But when I debug this in Flex Builder 3, I get an error (see below) saying that my style1.swf is not a loadable module. I looked around online and in this forum and it seems that this message is security-based, which is puzzling to me because all files are local in my example. I am not loading a style file from another domain. My directory structure (on OS X Leopard) is: testRuntimeCss\ assets\ style1.css style1.swf src
[flexcoders] Re: Runtime CSS and SWF is not a loadable module -- new information
Although I do get a runtime error when the application tries to load the style SWF that I made via mxmlc BasicStyle.css (the SWF in the assets/ folder), I was finally able to get styles to successfully load using the SWF generated by FB3. I'd still like to know how to load style SWFs made via mxmlc though. In the meantime, here's how I got the styles to load: * In FB 3, I right-clicked (CTRL-Clicked on a mac) on the assets/BasicStyle.css file and selected Compile CSS to SWF. This put a check mark next to that option. * Then I noticed that FB3 compiled the CSS file into a SWF and located that swf in: bin/Users/username/Documents/Flex Builder 3/testRuntimeCss/assets/BasicStyles.swf notice that FB3 reproduced the directory structure of the Flex Project location under the bin directory (rather than putting the style SWF in the assets/ folder directly). * So I updated my MXML file to read: StyleManager.loadStyleDeclarations(Users/jbattat/Documents/Flex Builder 3/testRuntimeCss/assets/BasicStyles.swf) (the path passed to loadStyleDeclarations() used to be ../assets/BasicStyles.swf) * Then I did a debug run, clicked the Button and the styles were successfully loaded. So some obvious questions remain: * Do you really have to code the path to the style swf in this way, or can you tell FB3 to compile the CSS file into a SWF and place the SWF directly in the bin-debug/ folder (or elsewhere) * How do you get runtime styles to load using style SWFs made via mxmlc (this is the critical question for me). * Is there a way to diff two SWFs? I have one SWF (made by FB3) that works and one (made by mxmlc) that does not. Seeing the differences between the two would be instructive. As always, thanks for your help -- j --- In flexcoders@yahoogroups.com, jamal wally [EMAIL PROTECTED] wrote: Hello again, OK, I'm sending the style swf as an attachment to this post. If it doesn't work, I will email directly to you Alex (thank you very much for your patience). Alex, to answer your question about the location of the style swf: The style SWF is local to my machine and lives in a subdirectory of the project. I named the flex project testRuntimeCss and the project files are in: ~/Documents/Flex Builder 3/testRuntimeCss/ The main MXML file is in the default location (src/) and the style CSS and SWF files are both in assets/. Let me also point out that in order to minimize the potential for user-error on my part, I have re-done my test runtime css Flex Project so that it follows the Adobe example at: http://livedocs.adobe.com/flex/3/html/help.html?content=styles_10.html I copied/pasted their example simple CSS into a file called BasicStyles.css which lives in the assets/ folder of my project. For completeness, here is the content of the CSS file, copied directly from the Adobe help page listed above. /* styles/runtime/assets/BasicStyles.css */ Button { fontSize:24; color: #FF9933; } Label { fontSize:24; color: #FF9933; } I then compiled the CSS file into a SWF with: mxmlc BasicStyle.css The resulting swf, BasicStyle.swf, is attached. By the way, I am using the mxmlc app from SDK 3.0.0 (on Mac Leopard) which mxmlc /Applications/Adobe Flex Builder 3/sdks/3.0.0/bin/mxmlc Another thing to point out is that I have done this both with Compile CSS to SWF option for the BasicStyle.css file on and off. Both approaches give the same result (runtime error -- described below). I then copied/pasted the MXML content from the Adobe help page into my main MXML file. Again, for completeness, here is the MXML that I used: ?xml version=1.0? !-- styles/BasicApp.mxml -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.styles.StyleManager; public function applyRuntimeStyleSheet():void { StyleManager.loadStyleDeclarations(../assets/BasicStyles.swf) } ]] /mx:Script mx:Label text=Click the button to load a new CSS-based SWF file/ mx:Button id=b1 label=Click Me click=applyRuntimeStyleSheet()/ /mx:Application When I debug in FB3, the application SWF successfully loads in my web browser. But when I click on the button labeled Click Me, the application crashes. The error I get is: Error: Unable to load style(SWF is not a loadable module): ../assets/BasicStyles.swf. Just before that error, I get the following trace which suggests that the SWF style file was, indeed found. [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:assets:BasicStyles.swf - 34,571 bytes after decompression Please let me know if you find a problem with the attached swf. -- j
[flexcoders] Re: Runtime CSS and SWF is not a loadable module
Was anybody able to view the css styles swf that I posted earlier? I'm still unable to implement runtime css because of the SWF is not a loadable module error. Any further help would be greatly appreciated. Thank you, --j --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Post the swf. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jamalwally Sent: Wednesday, July 16, 2008 11:37 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Runtime CSS and SWF is not a loadable module Hi Tracy, I'm confident that FB3 can find the style swf since the following is printed to the console: [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:assets:style1.swf - 11,294 bytes after decompression Still not sure how to verify that the style1.swf is actually a style swf (though I have no reason to believe that it is not). James --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Tracy Spratt tspratt@ wrote: Make sure the compiled css swf is actually where you expect. I am having problems with FB3 where the compiler misplaces the css swf, into a deeply nested folder structure under the bin folder, and I always have to copy it to the correct location. I plan to post a question on this some time soon. Tracy From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of jamalwally Sent: Wednesday, July 16, 2008 12:45 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Runtime CSS and SWF is not a loadable module Hello, I'm trying to implement runtime css in my flex application. I have compiled my css file into a swf with mxmlc mxmlc style1.css Then I load the resulting style1.swf on Application creationComplete: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=vertical creationComplete=StyleManager.loadStyleDeclarations('../assets/style1.s wf', true, true) But when I debug this in Flex Builder 3, I get an error (see below) saying that my style1.swf is not a loadable module. I looked around online and in this forum and it seems that this message is security-based, which is puzzling to me because all files are local in my example. I am not loading a style file from another domain. My directory structure (on OS X Leopard) is: testRuntimeCss\ assets\ style1.css style1.swf src\ testRuntimeCss.mxml I have tried this with the Compile CSS to SWF option both checked and unchecked (right click on style1.css). What gives? [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:bin- debug:testRuntimeCss.swf - 582,620 bytes after decompression [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:assets:style1.swf - 11,294 bytes after decompression Error: Unable to load style(SWF is not a loadable module): ../assets/style1.swf. at anonymous()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\styles\S tyleManag erImpl.as:858] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ModuleInfoProxy/moduleEventHandler()[E:\dev\3.0.x\frameworks\projects\fr amework\src \mx\modules\ModuleManager.as:1027] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ModuleInfo/initHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\ mx\modules\ ModuleManager.as:631]
[flexcoders] Re: Runtime CSS and SWF is not a loadable module
I've posted the swf and associated css file at: http://www.fas.harvard.edu/~metro/METRO/styles/style1.swf http://www.fas.harvard.edu/~metro/METRO/styles/style1.css Thank you very much for your continued assistance, I really appreciate it. --j --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Post the swf.
[flexcoders] Re: Runtime CSS and SWF is not a loadable module
Thanks for the quick response. I'm not sure how to verify that the swf is a style swf. Any suggestions would be greatly appreciated. By the way, is there some reason that running mxmlc style1.css would not produce a style swf? Thank you --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Make sure it really is a style swf. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jamalwally Sent: Tuesday, July 15, 2008 9:45 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Runtime CSS and SWF is not a loadable module Hello, I'm trying to implement runtime css in my flex application. I have compiled my css file into a swf with mxmlc mxmlc style1.css Then I load the resulting style1.swf on Application creationComplete: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=vertical creationComplete=StyleManager.loadStyleDeclarations('../assets/style1.s wf', true, true) But when I debug this in Flex Builder 3, I get an error (see below) saying that my style1.swf is not a loadable module. I looked around online and in this forum and it seems that this message is security-based, which is puzzling to me because all files are local in my example. I am not loading a style file from another domain. My directory structure (on OS X Leopard) is: testRuntimeCss\ assets\ style1.css style1.swf src\ testRuntimeCss.mxml I have tried this with the Compile CSS to SWF option both checked and unchecked (right click on style1.css). What gives? [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:bin- debug:testRuntimeCss.swf - 582,620 bytes after decompression [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:assets:style1.swf - 11,294 bytes after decompression Error: Unable to load style(SWF is not a loadable module): ../assets/style1.swf. at anonymous()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\styles\S tyleManag erImpl.as:858] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ModuleInfoProxy/moduleEventHandler()[E:\dev\3.0.x\frameworks\projects\fr amework\src \mx\modules\ModuleManager.as:1027] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ModuleInfo/initHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\ mx\modules\ ModuleManager.as:631]
[flexcoders] Re: Runtime CSS and SWF is not a loadable module
Hi Tracy, I'm confident that FB3 can find the style swf since the following is printed to the console: [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:assets:style1.swf - 11,294 bytes after decompression Still not sure how to verify that the style1.swf is actually a style swf (though I have no reason to believe that it is not). James --- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote: Make sure the compiled css swf is actually where you expect. I am having problems with FB3 where the compiler misplaces the css swf, into a deeply nested folder structure under the bin folder, and I always have to copy it to the correct location. I plan to post a question on this some time soon. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jamalwally Sent: Wednesday, July 16, 2008 12:45 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Runtime CSS and SWF is not a loadable module Hello, I'm trying to implement runtime css in my flex application. I have compiled my css file into a swf with mxmlc mxmlc style1.css Then I load the resulting style1.swf on Application creationComplete: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml layout=vertical creationComplete=StyleManager.loadStyleDeclarations('../assets/style1.s wf', true, true) But when I debug this in Flex Builder 3, I get an error (see below) saying that my style1.swf is not a loadable module. I looked around online and in this forum and it seems that this message is security-based, which is puzzling to me because all files are local in my example. I am not loading a style file from another domain. My directory structure (on OS X Leopard) is: testRuntimeCss\ assets\ style1.css style1.swf src\ testRuntimeCss.mxml I have tried this with the Compile CSS to SWF option both checked and unchecked (right click on style1.css). What gives? [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:bin- debug:testRuntimeCss.swf - 582,620 bytes after decompression [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:assets:style1.swf - 11,294 bytes after decompression Error: Unable to load style(SWF is not a loadable module): ../assets/style1.swf. at anonymous()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\styles\S tyleManag erImpl.as:858] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ModuleInfoProxy/moduleEventHandler()[E:\dev\3.0.x\frameworks\projects\fr amework\src \mx\modules\ModuleManager.as:1027] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ModuleInfo/initHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\ mx\modules\ ModuleManager.as:631]
[flexcoders] Runtime CSS and SWF is not a loadable module
Hello, I'm trying to implement runtime css in my flex application. I have compiled my css file into a swf with mxmlc mxmlc style1.css Then I load the resulting style1.swf on Application creationComplete: mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical creationComplete=StyleManager.loadStyleDeclarations('../assets/style1.swf', true, true) But when I debug this in Flex Builder 3, I get an error (see below) saying that my style1.swf is not a loadable module. I looked around online and in this forum and it seems that this message is security-based, which is puzzling to me because all files are local in my example. I am not loading a style file from another domain. My directory structure (on OS X Leopard) is: testRuntimeCss\ assets\ style1.css style1.swf src\ testRuntimeCss.mxml I have tried this with the Compile CSS to SWF option both checked and unchecked (right click on style1.css). What gives? [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:bin- debug:testRuntimeCss.swf - 582,620 bytes after decompression [SWF] Users:jbattat:Documents:Flex Builder 3:testRuntimeCss:assets:style1.swf - 11,294 bytes after decompression Error: Unable to load style(SWF is not a loadable module): ../assets/style1.swf. at anonymous()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\styles\StyleManag erImpl.as:858] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ModuleInfoProxy/moduleEventHandler()[E:\dev\3.0.x\frameworks\projects\framework\src \mx\modules\ModuleManager.as:1027] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at ModuleInfo/initHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\modules\ ModuleManager.as:631]
[flexcoders] Flex builder compiler line
Is there a way to see the compiler command that Flex builder 3 uses? For example, in Builder 3, under Properties - Flex Compiler, you can choose several compiler options. I guess that Builder generates a list of compiler options from this gui. I'd like to see the final arguments that are sent to the compiler. I'd like to begin compiling my swfs from the command line using mxmlc, and I would like to use the same compiler options from the command line that the builder is generating from the GUI options. For example, I am using Flex 2.0.1 Hotfix 3 (see the Use a specific SDK drop-down menu item in the Flex Compiler options) and would like to see the equivalent compiler command line option. Thanks in advance, jamal
[flexcoders] Re: embedding html in xml
thank you iilsley. Your suggestion to use CDATA works. However, I have a large number of these input XML files and rather than changing each one of them, I was hoping to be able to specify globally which tags should be ignored (b, a, etc) and that they could be ignored in all of the XML files. Is there a way to do this globally? Perhaps by specifying an HTML namespace or something similar? Or is it possible to programatically tell the XML class that text has no child nodes, in other words to programatically force the XML class to treat the contents of text/text as CDATA? Thank you --- In flexcoders@yahoogroups.com, iilsley [EMAIL PROTECTED] wrote: try text ![CDATA[ This is the text with bhtml/b tags ]] /text --- In flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com , jamalwally jamalwally@ wrote: Hi there, I am using an external XML file to define the content for a Text component in Flex. The xml file has HTML tags (e.g. b for bold). When I assign the XML to the Text component's htmlText property, I get unwanted extra line breaks around the HTML tags. For example, here is the external XML file: text This is the text with bhtml/b tags /text Then in actionscript I load the XML file and create the Text component // create the XML file loader var xmlLoader = new URLLoader(); xmlLoader.load(new URLRequest(externalFilename)); // create an XML object from the file contents var myxml:XML = new XML(xmlLoader.data); // make the Text component var mytext:Text = new Text(); mytext.htmlText = myxml; The displayed text component has three lines of text because of unwanted line breaks around the HTML b tag: This is the text with *html* tags Instead of just one line of text as I was hoping for: This is the text with *html* tags Is there a way around this (perhaps a way to specify a set of tags (e.g. b) that should not be interpreted as XML sub-nodes of text? Thanks in advance
[flexcoders] embedding html in xml
Hi there, I am using an external XML file to define the content for a Text component in Flex. The xml file has HTML tags (e.g. b for bold). When I assign the XML to the Text component's htmlText property, I get unwanted extra line breaks around the HTML tags. For example, here is the external XML file: text This is the text with bhtml/b tags /text Then in actionscript I load the XML file and create the Text component // create the XML file loader var xmlLoader = new URLLoader(); xmlLoader.load(new URLRequest(externalFilename)); // create an XML object from the file contents var myxml:XML = new XML(xmlLoader.data); // make the Text component var mytext:Text = new Text(); mytext.htmlText = myxml; The displayed text component has three lines of text because of unwanted line breaks around the HTML b tag: This is the text with *html* tags Instead of just one line of text as I was hoping for: This is the text with *html* tags Is there a way around this (perhaps a way to specify a set of tags (e.g. b) that should not be interpreted as XML sub-nodes of text? Thanks in advance
[flexcoders] Drag and drop fails after a scroll
Hi, I have components that I'm using as drag targets and drop targets. The drag/drop is working fine until I scroll the screen down. Now, the drop target seems to be offset by the amount of the scroll. Here is a simple example showing the effect: http://www.cfa.harvard.edu/~jbattat/personal/testDrag/ Try dragging data from the bottom HorizontalList to the top HorizontalList (intially empty). All is well unless you have scrolled down the screen. For example, scroll to the bottom of the screen. Now you cannot drop data into the top HorizontalList. If you scroll half-way, you must release the drag well above the drop target in order for it to work. Any ideas/advice are *greatly* appreciated. Thanks in advance.
[flexcoders] How to know when TextArea has updated
Hi, I am extending the TextArea class (call it MyTextArea) and want to get information about the text in the textField. I wait for the CREATION_COMPLETE event before accessing the textField, but the textField.getLineIndexOfChar() method returns -1 directly after an update of this.text. Is there an event to listen to that will ensure the text has been updated and rendered so that getLineIndexOfChar() and other similar methods will give the expected results? I include my code below. By the way, I have a click listener and after the SWF loads and I click on the TextArea, I get the expected values of getLineIndexOfChar(). Thanks for your help, James public class MyTextArea extends TextArea { public function MyTextArea():void { super(); // have to wait until CREATION_COMPLETE fires otherwise // this.textField is null addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete); } private function onCreationComplete(e:FlexEvent):void { // looks like the text gets set but info about the text // layout in the TextField is not yet known... this.text = 'this is a long string\n of multiline text'; // these both return -1 trace(this.textField.getLineIndexOfChar(1)); trace(this.textField.getLineIndexOfChar(25)); } }
[flexcoders] Measuring TextField properties in TextArea subclass
Hi, I can't get the correct information about line numbers in the text of a custom class that extends TextArea (call it MyTextArea). If I set the text property of the TextArea in onCreationComplete() then getLineIndexAtPoint() returns -1. I imagine that after I update the text property, I must wait for the display to update before getLineIndexAtPoint() will return anything other than -1. So my questions are: 1. Can you force the display to update immediately? e.g. this.text = a new line of text; // this will return -1 (not what I want) trace(this.textField.getLineIndexAtPoint(2)); forceUpdate(); // this will return 0 (good) trace(this.textField.getLineIndexAtPoint(2)); 2. If you cannot force an update, is there an event to listen for so that I know when the getLineIndexAtPoint() method will return useful information? Here is my example code that does not give me what I want: public class MyTextArea extends TextArea { public function MyTextArea() { super(); // wait for creationComplete otherwise this.textField = null addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete); } private function onCreationComplete(evt:FlexEvent):void { this.text = 'a long line of text \n with a line break ...'; // these both return -1 // but I want them to return 0 and 1, repectively // because char 1 is on line 1 and char 25 is on line 2 trace(this.textField.getLineIndexOfChar(1)); trace(this.textField.getLineIndexOfChar(25)); } } (by the way, in my application, I unfortunately don't have the option of setting this.text in the constructor). Thanks in advance for your help, James
[flexcoders] Determining the text character at a given position in a TextArea
Hi, I would like to be able to highlight text in a TextArea that is under the user's mouse. In Flex 2 is there a way to get the text character that is closest to a given x,y position within a TextArea (or TextField)? Right now, I have each word in a separate TextArea and I listen for mouseOver events on each TextArea, but this is a bit of a pain. It would be cleaner to put all text into one TextArea, but this requires me to be able to determine the mapping between pixel coordinates and text character positions. Any help would be greatly appreciated. This post follows up on an unresolved previous posting: http://tech.groups.yahoo.com/group/flexcoders/message/21888 Thanks, James
[flexcoders] Re: Determining the text character at a given position in a TextArea
--- In flexcoders@yahoogroups.com, Daniel Freiman [EMAIL PROTECTED] wrote: textField.getCharIndexAtPoint(); - Dan Freiman On 10/24/07, jamalwally [EMAIL PROTECTED] wrote: Hi, I would like to be able to highlight text in a TextArea that is under the user's mouse. In Flex 2 is there a way to get the text character that is closest to a given x,y position within a TextArea (or TextField)? Right now, I have each word in a separate TextArea and I listen for mouseOver events on each TextArea, but this is a bit of a pain. It would be cleaner to put all text into one TextArea, but this requires me to be able to determine the mapping between pixel coordinates and text character positions. Any help would be greatly appreciated. This post follows up on an unresolved previous posting: http://tech.groups.yahoo.com/group/flexcoders/message/21888 Thanks, James Thank you Dan, that's exactly what I was looking for. I just didn't notice it in the language reference. My apologies!
[flexcoders] Drop target positions are affected by vertical scrolling
Hi, I had a lot of trouble identifying this problem, but now I've isolated it enough to provide a simple example. I am using the dragEnabled and dropEnabled properties of the HorizontalList to allow the user to drag data from one list to another. I was getting the expected behaviour until the content of my screen got long enough (vertically) to require a vertical scroll bar. When that happened, the drag/drop behaviour got very bizarre. It appears that the virtual (invisible) position of the drop targets does not scroll with the rest of the screen! But the visible rendering of the drop targets (e.g. HorizontalLists) do and so the user gets unexpected behaviour. Here is an example SWF to demonstrate this effect: http://www.cfa.harvard.edu/~jbattat/personal/testDrag/ If you run this example and drag data from the bottom HorizontalList to the top HorizontalList (intially empty), then all is well. But then reload the example, and scroll to the bottom first. You will not be able to drop the data into the empty HorizontalList. If you scroll halfway back to the top, and then try dragging again, you'll see that there is an offset between where you can drop and where the drop-target actually is. For example, if you release the data in the empty upper list, the data gets deposited in the lower list (where it started) but if you drag to above the empty list, you can drop into the empty list! Does anybody have suggestions on how to prevent this from happening or how to work around this. I don't understand why this behaviour would be desired, but perhaps it is? Any illumination would be greatly appreciated! Below, I've included the MXML used to make the above example. Thank you very much for your help! ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute height=200 mx:VBox mx:Text id=textA text=dummy text height=100 / mx:HorizontalList id=dropA dropEnabled='true' dragEnabled='true' dragMoveEnabled='true'/ mx:HorizontalList id=a dropEnabled='true' dragEnabled='true' dragMoveEnabled='true' mx:dataProvider mx:Array mx:Object label=first one/ mx:Object label=second one/ mx:Object label=third one/ /mx:Array /mx:dataProvider /mx:HorizontalList mx:Text id=textB text=dummy text height=100 / /mx:VBox /mx:Application
[flexcoders] Efficiently loading hundreds of images for a slideshow
Hi all, I am developing an application to display a sequence of 2d data contour plots to show the evolution of a physical system (global climate in this case) as a function of time. In this application there are many different quantities (temperature, pressure, rainfall, etc, etc) that the user could choose to plot, so I opted *not* to embed all possible animation sequences into the SWF. Rather, when the user requests a certain variable to view, I transfer those images to the SWF via URLRequest calls. Note, that although this is for a scientific purpose, this application is essentially just an image slideshow because the data plots that comprise an animation have all been generated ahead of time. Now, each animation has between 100 and 250 images. So rather than waiting for all images to arrive, I begin the animation, displaying the images that have arrived as they come (i.e. I stream the animation). For an animation of 50 or fewer images, this approach works very well. However, if I have 60+ images, then the image loading really gets bogged down. Here is my procedure: //Create an instance of the Loader class. myLoader = new Loader(); // load a particular image // and listen for Event.COMPLETE (not shown) myLoader.load( new URLRequest(imageLocation) ); // once the image is loaded, add this image // to an array that holds all of the animation images imageArray.push( Bitmap(myLoader.content) ); // and repeat until there are no more images left to load // The animation is displayed in an Image component located // on a Flex 2 MXML application. The image's source property // is bound to currentImage which is a reference to a particular // Bitmap in the imageArray Array. I find that the image loading + Bitmap generation takes about 0.1 to 0.2 seconds per image for the first ~50 images (this is fine because the animation frame rate is set to 0.5 seconds per image, so the loader keeps up), but after image 60+ it can take 3-5+ seconds per image, which becomes problematic! Can anyone suggest a more efficient way to deal with the loading and display of hundreds of images. I am curious as to what bogs down the image loading+Bitmap generation, but I am also open to new approaches entirely if appropriate! Essentially, all I have to do is make a slideshow that displays hundreds of images loaded on the fly with some time delay between each image. I imagine that this is a fairly standard thing (though I haven't found examples online yet). Thank you very much for your help, and I look forward to your responses, James
[flexcoders] Re: Efficiently loading hundreds of images for a slideshow
Hi Troy, Thank you very much for your suggestion. The PNG images that I was loading were large (1200 x 900). Using smaller images (400 x 300), I can easily load 200+ images with no noticeable delay. There is clearly no point to load images that are higher resolution than will be displayed, so I will have to find a happy tradeoff between appearance and performance (as is often the case!). Is it right to assume that since I am reusing a single loader over and over that the strain on the memory comes from the array that holds the Bitmap objects? All the best, James --- In flexcoders@yahoogroups.com, Troy Gilbert [EMAIL PROTECTED] wrote: I find that the image loading + Bitmap generation takes about 0.1 to 0.2 seconds per image for the first ~50 images (this is fine because the animation frame rate is set to 0.5 seconds per image, so the loader keeps up), but after image 60+ it can take 3-5+ seconds per image, which becomes problematic! It sounds as if you may be running into memory issues. How large are your images (dimensions)? After 60+ images you may be getting a delay as memory starts to swap to/from virtual memory to service the allocation of the bitmap data. One way to work around this would be to ditch older images... of course, if the user wanted to loop or control the playback, this would be problematic, but depending on the UI scenario you may be able to rely on the browser's cache. You could also potentially generate a FLV on the server based on the images the user requests. I know you can use ffmpeg (I think) to generate FLVs, perhaps you can also use it to generate a FLV based on an image sequence. You could then just stream the FLV to them, which would internally (and natively) handle on the memory issues more efficiently and gracefully). Troy.