Re: [Flashcoders] Help jsfl traceBitmap
Thnx a million ! J Muzak wrote: This should work, but should probably build in a few more checks in the loop. Like check if there's a bitmap in the currently editted movieclip in the specified frame. What this does is: - loop through the items in the library - check if current item is a movieclip (not a bitmap as you did) - if movieclip, select it and enter edit mode - get the movieclip timeline and set the elements in its first frame/first layer as document selection // here is where you should check if the above selection contains a bitmap - trace bitmap var doc = fl.getDocumentDOM(); var library = doc.library; var items = library.items.concat(); i = items.length; while (i--) { var item = items[i]; fl.trace(itemType: + item.itemType); if (item.itemType == 'movie clip') { library.selectItem(item); library.editItem(); var timeline = item.timeline; fl.trace(- frameCount: + timeline.frameCount); doc.selection = timeline.layers[0].frames[0].elements; doc.traceBitmap(100, 1, 'pixels', 'normal'); } } doc.exitEditMode(); regards, Muzak - Original Message - From: Jiri jiriheitla...@googlemail.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Monday, February 09, 2009 9:47 AM Subject: [Flashcoders] Help jsfl traceBitmap Hello, i was wondering if someone can help me out with the following. I have a the maintimeline with on it a movieclip. Inside this movieclip is a png, that I would like to trace as a bitmap. I can't seem to target the png that is nested in the movieclip. If i understand correctly I will first need to get it the timeline of the png holder clip from the library and then select the frame. Here is my code which throws a selection: Argument number 1 is invalid. var doc = fl.getDocumentDOM(); var library = doc.library; var items = library.items.concat(); i = items.length; while (i--) { var item = items[i]; if (item.itemType == 'bitmap') { var imageName = item.name.split('.')[0]; var image = doc.getTimeline().layers[0].frames[0].elements[0]; doc.selection = image doc.traceBitmap(100, 100 , 'normal' , 'normal'); } } Hope someone can help! Jiri ___ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] UK freelance flash opportunities
Thanks Allan, I have sent off my CV TO Major Players so hopefully something will come of it. Cheers Paul -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt bik-elliott (thefieldcomic.com) Sent: 09 February 2009 09:42 To: Flash Coders List Subject: Re: [Flashcoders] UK freelance flash opportunities i've had loads of work from neil clements at major players - try there a On Mon, Feb 9, 2009 at 9:22 AM, Paul Steven paul_ste...@btinternet.comwrote: The economic downturn has finally taken its toll on my work load after many years of keeping the wolves at bay. If anyone can point me in the right direction of the best sites, agencies to offer me assistance looking for new projects it would be much appreciated. Cheers Paul http://www.mediakitchen.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Converting hex colour numbers back and forth
Thanks for your responses guys. I'm still stuck on this and I have been playing around a lot. I can get the number from the decimal format to the hex string but when I try to convert it to a hex number the colour is incorrect. Any advice much much appreciated, this is taking up lots of time. Thanks: public function colorIn(o:Object):void { trace(===); var colA:Array = o.Colors.split(,); colA.splice(0,1); for ( var i:uint=1; i=totSprites-1; i++ ) { var c:String = colA[i]; trace(string colour:+c); // e.g. for red: 16711680 //convert to decimal number var tmpN:Number = Number(c); trace(decimal:+tmpN); // traces: 16711680 //convert to string of hex number var hexStr:String = tmpN.toString(16); trace(hexStr:+hexStr); //traces: ff //convert to hex number var hexNum:Number = parseInt(c, 16); trace(= = = = = = = hex number:+hexNum); //traces in decimal format and wrong number: 376510080 //set mc to color var mcToCol:* = mainImage[s+i]; //transform color var newColorTransform:ColorTransform = mcToCol.transform.colorTransform; newColorTransform.color = hexNum; mcToCol.transform.colorTransform = newColorTransform; }; } On Mon, Feb 9, 2009 at 8:55 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Courtesy Evan Mullins of Circlecube Studio: //bitwise conversion of rgb color to a hex value function rgb2hex(r, g, b):Number { return(r16 | g8 | b); } //bitwise conversion of a hex color into rgb values function hex2rgb (hex):Object { var red = hex16; var greenBlue = hex-(red16) var green = greenBlue8; var blue = greenBlue - (green 8); //trace(r: + red + g: + green + b: + blue); return({r:red, g:green, b:blue}); } Jason Merrill Bank of America Learning Performance Solutions Instructional Technology Media Learn about the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of ali drongo Sent: Monday, February 09, 2009 12:26 PM To: Flash Coders List Subject: [Flashcoders] Converting hex colour numbers back and forth Hi there, I'm saving a bunch of colours as a string then using this string later to colour objects in the same way. Something is going wrong though as the colours I am getting back are not the same as the ones I put in. If anyone could point out where I'm going wrong I'd be really grateful, I've googled this and and have checked the help files and as far as I can see it's correct (though obviously it isn't!). Here's my code, I've written comments next to the relevant lines: /// in my coloured button class // 1) colour is set on mouse click private function clickHandler(e:MouseEvent):void { // passes hexValue from ColorPicker colorThis(this.parent.parent[colorPick].hexValue); } // 2) color is stored in var public function colorThis(c:String):void { //stores colour currColor = Number(0x+c); var newColorTransform:ColorTransform = this.transform.colorTransform; newColorTransform.color = currColor; this.transform.colorTransform = newColorTransform; } // application class // 3) stores colors in an array private function collectColors():Array { colors_ar = new Array(); for ( var i:uint=1; i=totSprites; i++ ) { //stores colour in array colors_ar[i] = mainImage[s+i].currColor; }; return colors_ar; } // 4) array is written to string and sent to php to be written to txt file private function sendData(e:MouseEvent):void { showSending(true); var variables:URLVariables = new URLVariables(); //stores all colours as a string variables.colors = collectColors().toString(); var request:URLRequest = new URLRequest(); request.url = http://www..com/text/test.php;; request.method = URLRequestMethod.POST; request.data = variables; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.TEXT; loader.addEventListener(Event.COMPLETE, completeHandler); try { loader.load(request); } catch (error:Error) { trace(Unable to load URL); } } / viewer class // 5) public function colorIn(o:Object):void { var colA:Array = o.Colors.split(,); colA.splice(0,1); for ( var i:uint=1; i=totSprites; i++ ) { //calls the method in the coloured button class mainImage[s+i].colorThis(colA[i]).toString(16); }; } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Converting hex colour numbers back and forth
The problem seems to be here: var hexNum:Number = parseInt(c, 16); You're asking parseInt to convert a string to an integer and telling it the string is an hexadecimal representation, when it's decimal, according to this line: trace(string colour:+c); // e.g. for red: 16711680 So try, hexNum:Number = parseInt(c,10); If you have a number, you don't need to worry about decimal / hexadecimal. It's just a number: you can have, say, the number 10, which would be represented as 10 in decimal, 0xa in hexadecimal, 1010 in binary, etc, but those are just a way to display a number. If you already have the number, you don't need any extra step. Hope this helps. Cheers Juan Pablo Califano 2009/2/10, ali drongo alidro...@googlemail.com: Thanks for your responses guys. I'm still stuck on this and I have been playing around a lot. I can get the number from the decimal format to the hex string but when I try to convert it to a hex number the colour is incorrect. Any advice much much appreciated, this is taking up lots of time. Thanks: public function colorIn(o:Object):void { trace(===); var colA:Array = o.Colors.split(,); colA.splice(0,1); for ( var i:uint=1; i=totSprites-1; i++ ) { var c:String = colA[i]; trace(string colour:+c); // e.g. for red: 16711680 //convert to decimal number var tmpN:Number = Number(c); trace(decimal:+tmpN); // traces: 16711680 //convert to string of hex number var hexStr:String = tmpN.toString(16); trace(hexStr:+hexStr); //traces: ff //convert to hex number var hexNum:Number = parseInt(c, 16); trace(= = = = = = = hex number:+hexNum); //traces in decimal format and wrong number: 376510080 //set mc to color var mcToCol:* = mainImage[s+i]; //transform color var newColorTransform:ColorTransform = mcToCol.transform.colorTransform; newColorTransform.color = hexNum; mcToCol.transform.colorTransform = newColorTransform; }; } On Mon, Feb 9, 2009 at 8:55 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Courtesy Evan Mullins of Circlecube Studio: //bitwise conversion of rgb color to a hex value function rgb2hex(r, g, b):Number { return(r16 | g8 | b); } //bitwise conversion of a hex color into rgb values function hex2rgb (hex):Object { var red = hex16; var greenBlue = hex-(red16) var green = greenBlue8; var blue = greenBlue - (green 8); //trace(r: + red + g: + green + b: + blue); return({r:red, g:green, b:blue}); } Jason Merrill Bank of America Learning Performance Solutions Instructional Technology Media Learn about the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of ali drongo Sent: Monday, February 09, 2009 12:26 PM To: Flash Coders List Subject: [Flashcoders] Converting hex colour numbers back and forth Hi there, I'm saving a bunch of colours as a string then using this string later to colour objects in the same way. Something is going wrong though as the colours I am getting back are not the same as the ones I put in. If anyone could point out where I'm going wrong I'd be really grateful, I've googled this and and have checked the help files and as far as I can see it's correct (though obviously it isn't!). Here's my code, I've written comments next to the relevant lines: /// in my coloured button class // 1) colour is set on mouse click private function clickHandler(e:MouseEvent):void { // passes hexValue from ColorPicker colorThis(this.parent.parent[colorPick].hexValue); } // 2) color is stored in var public function colorThis(c:String):void { //stores colour currColor = Number(0x+c); var newColorTransform:ColorTransform = this.transform.colorTransform; newColorTransform.color = currColor; this.transform.colorTransform = newColorTransform; } // application class // 3) stores colors in an array private function collectColors():Array { colors_ar = new Array(); for ( var i:uint=1; i=totSprites; i++ ) { //stores colour in array colors_ar[i] = mainImage[s+i].currColor; }; return colors_ar; } // 4) array is written to string and sent to php to be written to txt file private function sendData(e:MouseEvent):void { showSending(true); var variables:URLVariables = new URLVariables(); //stores all colours as a string variables.colors = collectColors().toString(); var request:URLRequest = new URLRequest(); request.url = http://www..com/text/test.php;; request.method = URLRequestMethod.POST; request.data = variables; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.TEXT; loader.addEventListener(Event.COMPLETE, completeHandler); try {
Re: [Flashcoders] Converting hex colour numbers back and forth
Maybe this will help? http://muzakdeezign.com/flex3/flex3lib/ColorUtil.zip //docs http://muzakdeezign.com/flex3/flex3lib/docs/com/muzakdeezign/flex/utils/ColorUtil.html regards, Muzak - Original Message - From: ali drongo alidro...@googlemail.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Monday, February 09, 2009 6:26 PM Subject: [Flashcoders] Converting hex colour numbers back and forth Hi there, I'm saving a bunch of colours as a string then using this string later to colour objects in the same way. Something is going wrong though as the colours I am getting back are not the same as the ones I put in. If anyone could point out where I'm going wrong I'd be really grateful, I've googled this and and have checked the help files and as far as I can see it's correct (though obviously it isn't!). ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Converting hex colour numbers back and forth
Hi Ali, If you need to switch between different number systems, you can also try this: var myUint:uint = 0xff; // this is the colour red trace (myUint.toString(16)); //will trace ff -- in hexadecimal system; trace (myUint.toString(2)); //will trace -- in binary system; Hope this helps, Sidney On Feb 10, 2009, at 1:48 PM, Juan Pablo Califano wrote: The problem seems to be here: var hexNum:Number = parseInt(c, 16); You're asking parseInt to convert a string to an integer and telling it the string is an hexadecimal representation, when it's decimal, according to this line: trace(string colour:+c); // e.g. for red: 16711680 So try, hexNum:Number = parseInt(c,10); If you have a number, you don't need to worry about decimal / hexadecimal. It's just a number: you can have, say, the number 10, which would be represented as 10 in decimal, 0xa in hexadecimal, 1010 in binary, etc, but those are just a way to display a number. If you already have the number, you don't need any extra step. Hope this helps. Cheers Juan Pablo Califano 2009/2/10, ali drongo alidro...@googlemail.com: Thanks for your responses guys. I'm still stuck on this and I have been playing around a lot. I can get the number from the decimal format to the hex string but when I try to convert it to a hex number the colour is incorrect. Any advice much much appreciated, this is taking up lots of time. Thanks: public function colorIn(o:Object):void { trace(===); var colA:Array = o.Colors.split(,); colA.splice(0,1); for ( var i:uint=1; i=totSprites-1; i++ ) { var c:String = colA[i]; trace(string colour:+c); // e.g. for red: 16711680 //convert to decimal number var tmpN:Number = Number(c); trace(decimal:+tmpN); // traces: 16711680 //convert to string of hex number var hexStr:String = tmpN.toString(16); trace(hexStr:+hexStr); //traces: ff //convert to hex number var hexNum:Number = parseInt(c, 16); trace(= = = = = = = hex number:+hexNum); //traces in decimal format and wrong number: 376510080 //set mc to color var mcToCol:* = mainImage[s+i]; //transform color var newColorTransform:ColorTransform = mcToCol.transform.colorTransform; newColorTransform.color = hexNum; mcToCol.transform.colorTransform = newColorTransform; }; } On Mon, Feb 9, 2009 at 8:55 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Courtesy Evan Mullins of Circlecube Studio: //bitwise conversion of rgb color to a hex value function rgb2hex(r, g, b):Number { return(r16 | g8 | b); } //bitwise conversion of a hex color into rgb values function hex2rgb (hex):Object { var red = hex16; var greenBlue = hex-(red16) var green = greenBlue8; var blue = greenBlue - (green 8); //trace(r: + red + g: + green + b: + blue); return({r:red, g:green, b:blue}); } Jason Merrill Bank of America Learning Performance Solutions Instructional Technology Media Learn about the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of ali drongo Sent: Monday, February 09, 2009 12:26 PM To: Flash Coders List Subject: [Flashcoders] Converting hex colour numbers back and forth Hi there, I'm saving a bunch of colours as a string then using this string later to colour objects in the same way. Something is going wrong though as the colours I am getting back are not the same as the ones I put in. If anyone could point out where I'm going wrong I'd be really grateful, I've googled this and and have checked the help files and as far as I can see it's correct (though obviously it isn't!). Here's my code, I've written comments next to the relevant lines: /// in my coloured button class // 1) colour is set on mouse click private function clickHandler(e:MouseEvent):void { // passes hexValue from ColorPicker colorThis(this.parent.parent[colorPick].hexValue); } // 2) color is stored in var public function colorThis(c:String):void { //stores colour currColor = Number(0x+c); var newColorTransform:ColorTransform = this.transform.colorTransform; newColorTransform.color = currColor; this.transform.colorTransform = newColorTransform; } // application class // 3) stores colors in an array private function collectColors():Array { colors_ar = new Array(); for ( var i:uint=1; i=totSprites; i++ ) { //stores colour in array colors_ar[i] = mainImage[s+i].currColor; }; return colors_ar; } // 4) array is written to string and sent to php to be written to txt file private function sendData(e:MouseEvent):void { showSending(true); var variables:URLVariables = new URLVariables(); //stores all colours as a string variables.colors = collectColors().toString(); var request:URLRequest = new URLRequest(); request.url = http://www..com/text/test.php;; request.method =
Re: [Flashcoders] Converting hex colour numbers back and forth
Thanks everyone, Juan, you solved the final part of the puzzle and Muzak thanks for your utility class it's very useful. Cheers again! Ali On Tue, Feb 10, 2009 at 1:13 PM, Muzak p.ginnebe...@telenet.be wrote: Maybe this will help? http://muzakdeezign.com/flex3/flex3lib/ColorUtil.zip //docs http://muzakdeezign.com/flex3/flex3lib/docs/com/muzakdeezign/flex/utils/ColorUtil.html regards, Muzak - Original Message - From: ali drongo alidro...@googlemail.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Monday, February 09, 2009 6:26 PM Subject: [Flashcoders] Converting hex colour numbers back and forth Hi there, I'm saving a bunch of colours as a string then using this string later to colour objects in the same way. Something is going wrong though as the colours I am getting back are not the same as the ones I put in. If anyone could point out where I'm going wrong I'd be really grateful, I've googled this and and have checked the help files and as far as I can see it's correct (though obviously it isn't!). ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Help jsfl traceBitmap
Muzak and others, everything worked fine, but now i am struggling with movieclips and different frames on their timeline containing 1 png. I followed your described logic. 1. go trhrough lib items. 2. Check if it is a movieclip. 3. For framecount of the timeline, do a loop. 4. For each frame get the elemtens 5. add this to the selection 6. apply the trace bitmap. 7. ERROR! Selcection not set Would someone please be so kind to take a look...it is driving me nuts! Thnx code function convert(tFlaPath , tExportPath){ fl.openDocument(tFlaPath); var doc = fl.getDocumentDOM(); var library = doc.library; var items = library.items; i = items.length; while (i--) { var item = items[i]; if (item.itemType == 'movie clip') { var timeline = item.timeline; var k = timeline.frameCount; library.selectItem(item); library.editItem(); while(k--){ var j = timeline.layers[0].frames[k].elements.length while(j--){ doc.selection = timeline.layers[0].frames[k].elements doc.traceBitmap(100, 1, 'normal', 'normal'); } } doc.exitEditMode(); } } filename_new = getNewFileName(filename); targetPath = tExportPath + / + filename_new.toUpperCase1() + .swf //doc.exportSWF(targetPath, true); //doc.close(false); } /code Muzak wrote: This should work, but should probably build in a few more checks in the loop. Like check if there's a bitmap in the currently editted movieclip in the specified frame. What this does is: - loop through the items in the library - check if current item is a movieclip (not a bitmap as you did) - if movieclip, select it and enter edit mode - get the movieclip timeline and set the elements in its first frame/first layer as document selection // here is where you should check if the above selection contains a bitmap - trace bitmap var doc = fl.getDocumentDOM(); var library = doc.library; var items = library.items.concat(); i = items.length; while (i--) { var item = items[i]; fl.trace(itemType: + item.itemType); if (item.itemType == 'movie clip') { library.selectItem(item); library.editItem(); var timeline = item.timeline; fl.trace(- frameCount: + timeline.frameCount); doc.selection = timeline.layers[0].frames[0].elements; doc.traceBitmap(100, 1, 'pixels', 'normal'); } } doc.exitEditMode(); regards, Muzak - Original Message - From: Jiri jiriheitla...@googlemail.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Monday, February 09, 2009 9:47 AM Subject: [Flashcoders] Help jsfl traceBitmap Hello, i was wondering if someone can help me out with the following. I have a the maintimeline with on it a movieclip. Inside this movieclip is a png, that I would like to trace as a bitmap. I can't seem to target the png that is nested in the movieclip. If i understand correctly I will first need to get it the timeline of the png holder clip from the library and then select the frame. Here is my code which throws a selection: Argument number 1 is invalid. var doc = fl.getDocumentDOM(); var library = doc.library; var items = library.items.concat(); i = items.length; while (i--) { var item = items[i]; if (item.itemType == 'bitmap') { var imageName = item.name.split('.')[0]; var image = doc.getTimeline().layers[0].frames[0].elements[0]; doc.selection = image doc.traceBitmap(100, 100 , 'normal' , 'normal'); } } Hope someone can help! Jiri ___ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Help jsfl traceBitmap
This one threw me off a bit :) You have to move the timeline playhead for traceBitmap to work. When you enter edit mode, you automatically end up in the first frame, so that's why traceBitmap works for the first frame, and not the others. So, loop through the number of frames, set timeline.currentFrame and then you'll be able to select the elements in that frame and work with them. This should do the trick: var doc = fl.getDocumentDOM(); var library = doc.library; var items = library.items.concat(); var i = items.length; var item; var timeline; var len; var fr; while (i--) { item = items[i]; fl.trace(itemType: + item.itemType); if (item.itemType == movie clip) { library.selectItem(item); library.editItem(); timeline = item.timeline; len = timeline.frameCount; fl.trace(- frameCount: + timeline.frameCount); for(var j=0; jlen; j++) { doc.selectNone(); // move the playhead !! timeline.currentFrame = j; // get reference to current frame object fr = timeline.layers[0].frames[j]; // set doc selection doc.selection = fr.elements; doc.traceBitmap(100, 1, 'pixels', 'normal'); } } } doc.exitEditMode(); regards, Muzak ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Converting hex colour numbers back and forth
I usually don't use parseInt for this purpose I usually just cast it as a uint. i.e. uint(c); would work as well. glad you figured it out. - Taka On Tue, Feb 10, 2009 at 5:54 AM, ali drongo alidro...@googlemail.com wrote: Thanks everyone, Juan, you solved the final part of the puzzle and Muzak thanks for your utility class it's very useful. Cheers again! Ali On Tue, Feb 10, 2009 at 1:13 PM, Muzak p.ginnebe...@telenet.be wrote: Maybe this will help? http://muzakdeezign.com/flex3/flex3lib/ColorUtil.zip //docs http://muzakdeezign.com/flex3/flex3lib/docs/com/muzakdeezign/flex/utils/ColorUtil.html regards, Muzak - Original Message - From: ali drongo alidro...@googlemail.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Monday, February 09, 2009 6:26 PM Subject: [Flashcoders] Converting hex colour numbers back and forth Hi there, I'm saving a bunch of colours as a string then using this string later to colour objects in the same way. Something is going wrong though as the colours I am getting back are not the same as the ones I put in. If anyone could point out where I'm going wrong I'd be really grateful, I've googled this and and have checked the help files and as far as I can see it's correct (though obviously it isn't!). ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Help jsfl traceBitmap
This one threw me off a bit :) Tell me about it, it did my head in all day.. When you enter edit mode, you automatically end up in the first frame, That explains why, although looping through the frames, it was always only the first one to be converted before the error was thrown. I will give your suggestion a try tomorrow and cross my fingers it works. Thank you again. jiri Muzak wrote: This one threw me off a bit :) You have to move the timeline playhead for traceBitmap to work. When you enter edit mode, you automatically end up in the first frame, so that's why traceBitmap works for the first frame, and not the others. So, loop through the number of frames, set timeline.currentFrame and then you'll be able to select the elements in that frame and work with them. This should do the trick: var doc = fl.getDocumentDOM(); var library = doc.library; var items = library.items.concat(); var i = items.length; var item; var timeline; var len; var fr; while (i--) { item = items[i]; fl.trace(itemType: + item.itemType); if (item.itemType == movie clip) { library.selectItem(item); library.editItem(); timeline = item.timeline; len = timeline.frameCount; fl.trace(- frameCount: + timeline.frameCount); for(var j=0; jlen; j++) { doc.selectNone(); // move the playhead !! timeline.currentFrame = j; // get reference to current frame object fr = timeline.layers[0].frames[j]; // set doc selection doc.selection = fr.elements; doc.traceBitmap(100, 1, 'pixels', 'normal'); } } } doc.exitEditMode(); regards, Muzak ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders