[flexcoders] Re: binary in xml
> 1. Store the binary data from the xml in a BytesArray. > 2. Use Loader.loadBytes() to make it an image. unfortunately after giving this a solid newbie try, getting stumped converting the binary data to an image. what i've tried in my item renderer is: // legends? thisNode=XML(TreeListData(super.listData).item); if (thisNode.legend.length()) { var loader:Loader=new Loader(); var ba:ByteArray=new ByteArray(); ba.writeObject([EMAIL PROTECTED]); loader.loadBytes(ba); addChild(loader.content); } keeps throwing "Error #2124: Loaded file is an unknown type." at runtime. any ideas? thanks. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: binary in xml
> 1. Store the binary data from the xml in a BytesArray. > 2. Use Loader.loadBytes() to make it an image. unfortunately after giving this a solid newbie try, getting stumped converting the binary data to an image. what i've tried in my item renderer is: // legends? thisNode=XML(TreeListData(super.listData).item); if (thisNode.legend.length()) { var loader:Loader=new Loader(); var ba:ByteArray=new ByteArray(); ba.writeObject([EMAIL PROTECTED]); loader.loadBytes(ba); addChild(loader.content); } keeps throwing "Error #2124: Loaded file is an unknown type." at runtime. any ideas? thanks. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: binary in xml
--- In flexcoders@yahoogroups.com, EECOLOR <[EMAIL PROTECTED]> wrote: > image. If thats the case you can do the following: > > 1. Store the binary data from the xml in a BytesArray. > 2. Use Loader.loadBytes() to make it an image. hi greetz, i've given that method a solid newbie try but i can't get the data loaded into a ByteArray from the xml. i've tried // any legends in this? thisLegend=XML(TreeListData(super.listData).item.legend); if (thisLegend) { var loader:Loader=new Loader(); var ba:ByteArray=new ByteArray(); ba.writeObject([EMAIL PROTECTED]); loader.loadBytes(ba); addChild(loader.content); } but flex keeps throwing runtme "Error #2124: Loaded file is an unknown type." errors. any ideas? thanks. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: binary in xml
Hi there! The best way I found to work with binarys/xml is Base64... Flex has built in classes for that (Base64Encoder and Base64Decoder) Regards Rogério --- In flexcoders@yahoogroups.com, "Paul Hastings" <[EMAIL PROTECTED]> wrote: > > On 10/1/06, EECOLOR <[EMAIL PROTECTED]> wrote: > > I think it has something to do with the way you write the information to the byte array. If you try to write it as an object, the information (a string in your case) will be translated to the AMF equivalant of the string, which is not the actual data you need. So somehow (and i dont have enough experience with this, nor the time to test it myself right now) you should convert the string of bytes to actual bytes. > > thanks, but i'll probably have to punt on this for the time being & > write out the graphics as files & pass their locations thru to flex. i > keep getting blind-sided by a bunch of seemingly trivial stuff flex > side, it's thrown my project schedule in the trash can several times > ;-) > > though one final question, the binaries are PNG. would that have an effect? > > > Hope you get there, and when you do, please post the solution :) > > i'll re-visit this as soon as we can get the project back on schedule. > > thanks. > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: binary in xml
To anyone interested still: AS3 function to convert a Base64 encoded Image and display it in flex! private function testIt():void { var b:Base64Decoder = new Base64Decoder(); b.decode('base64 encoded image string goes here'); var bA:ByteArray = b.flush(); var l:Loader = new Loader(); l.loadBytes(bA); var img:Image = new Image(); img.addChild(l); img.scaleContent = true; img.scaleX = .5; img.scaleY = .5; t.addChild(img); } The "t" object is just a Canvas object in the application. It's just a rough outline. You can load the string (which is easier and more likely what you'll actually do) via HTTPService to use in the decode function. That way, you'll be able to have \n characters and there won't be any errors thrown. Hope this helps someone out there! :D -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: binary in xml
--- In flexcoders@yahoogroups.com, "nathanpdaniel" <[EMAIL PROTECTED]> wrote: > To anyone interested still: i certainly still interested ;-) > private function testIt():void worked a treat, thanks. > The "t" object is just a Canvas object in the application. It's > just a rough outline. You can load the string (which is easier and any suggestions on hwo to use this in a custom renderer? i'd like to use it along w/some text in a tree or datagrid. not quite getting on to load the rendered image via this. thanks. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> 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] Re: binary in xml
I think it has something to do with the way you write the information to the byte array. If you try to write it as an object, the information (a string in your case) will be translated to the AMF equivalant of the string, which is not the actual data you need. So somehow (and i dont have enough experience with this, nor the time to test it myself right now) you should convert the string of bytes to actual bytes. Check out the different write options on the byte array class, and maybe start another thread to get help converting a string of bytes to actual bytes. Hope you get there, and when you do, please post the solution :) Greetz Erik __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
Re: [flexcoders] Re: binary in xml
On 10/1/06, EECOLOR <[EMAIL PROTECTED]> wrote: > I think it has something to do with the way you write the information to the > byte array. If you try to write it as an object, the information (a string in > your case) will be translated to the AMF equivalant of the string, which is > not the actual data you need. So somehow (and i dont have enough experience > with this, nor the time to test it myself right now) you should convert the > string of bytes to actual bytes. thanks, but i'll probably have to punt on this for the time being & write out the graphics as files & pass their locations thru to flex. i keep getting blind-sided by a bunch of seemingly trivial stuff flex side, it's thrown my project schedule in the trash can several times ;-) though one final question, the binaries are PNG. would that have an effect? > Hope you get there, and when you do, please post the solution :) i'll re-visit this as soon as we can get the project back on schedule. thanks. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> 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] Re: binary in xml
The flash player is capable of runtime loading of the PNG file format, so that should not pose a problem. Greetz EE __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company Your email settings: Individual Email|Traditional Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___
Re: [flexcoders] Re: binary in xml
On Thursday 19 October 2006 08:23, coldfusionpaul wrote: > > The "t" object is just a Canvas object in the application. It's > > just a rough outline. You can load the string (which is easier and > > any suggestions on hwo to use this in a custom renderer? i'd like to > use it along w/some text in a tree or datagrid. not quite getting on > to load the rendered image via this. 'this' might work. -- Tom Chiverton Helping to autoschediastically seize market-driven functionalities 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 St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. 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 8008. For more information about Halliwells LLP visit www.halliwells.com. -- 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] Re: binary in xml
> > any suggestions on hwo to use this in a custom renderer? i'd like to > > use it along w/some text in a tree or datagrid. not quite getting on > > to load the rendered image via this. > > 'this' might work. yeah i've tried that. but only seems to work for static data. i've added nathan's method to the custom renderer's creationComplete & it works fine when the data is static (see snippet below). but as soon as i start pulling the xml from a java server via cf, i start getting "TypeError: Error #1009: Cannot access a property or method of a null object reference. at graphicRenderer/___HBox1_creationComplete()." errors. there's a text widget in the same renderer that displays the text fine. http://www.adobe.com/2006/mxml"; width="400" height="40" creationComplete="convertToImage(data.swatchLegend);"> private function convertToImage(hex:String):void { var b:Base64Decoder = new Base64Decoder( ); b.decode(hex); var bA:ByteArray = b.flush(); var l:Loader = new Loader(); l.loadBytes( bA); var img:Image = new Image(); img.addChild(l); this.addChild(img); } -- 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/