Re: [Flashcoders] jigsaw puzzle piece algorithm
Hi, no i dont think its the same. Reading your story it sounds like every piece has a set of neighbours, with a maximum of fours neighbours. Taking your example: Initially each piece group property is an empty array, but for a group something like: A B C D a.group = [a,b,c,d] and b.group = [a,b,c,d] and c.group = [a,b,c,d] etc for : ABCD EF a.group would be = [a,b,c,d,e,f] You dont need to explicitly define a's neighbours, since its a grid, so you know how to find it's direct neighbour if necessary. greetz Hans On 7/28/06, Guntur N. Sarwohadi [EMAIL PROTECTED] wrote: Hi Danny, Thanks for the reply.. I'm not quite sure to what you mean, but doesn't it sound similar to my current approach? Rather than using arrays, you suggested objects. Please correct me if I'm wrong. Cheers, Guntur N. Sarwohadi ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Problems getting the brightness of a color returned from getPixel
to go from a 24 bit number to 3x8 bit colour components you can just shift it and mask the bits you need : var r=color 16 0xFF var g=color 8 0xFF var b=color 0xFF that should do the job. James Deakin wrote: Hi Guys, I'm having some problems with getting the brightness of a color returned from get pixel. get pixel returns an RGB color as a number which means I was expecting something like three groups of three numbers 255 255 255 or similar. what I am actually getting back is of this form 14540754 one digit short. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] swf to AVI
Hi, you can also stop advertising/spamming :). greetz Hans ps or make it open source, that'd be even better:)) On 7/28/06, master [EMAIL PROTECTED] wrote: Hi, You can try Moyea Flash to Video Converter at http://www.flash-video-mx.com/flash_to_video_web/ master 2006-07-28 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Loading Remote Images Cross Domain files - MoveieClipLoader
Hi all, Just thought I'd post up saying I solved the problem for anyone searching the archives. I was using onLoadInit to make the image fade in once it was loaded. For some reason, when using onLoadInit the whole loadClip called just doesn't get called at all for crossdomain images. When i changed it to onLoadComplete however everything works find. The crossdomain.xml file gets called and everything is fine. I'd been under the impression onLoadInit was better to use that onLoadComplete so i'm still at a bit of a loss in that regard, but the code is working and I'm happy. Thanks, - Kevin On Fri, Jul 28, 2006 at 02:59:33PM +0100, Kevin Cannon wrote: Hi, I've managed to narrow down the problem. I'm using the MovieClipLoader class so I canfade in an image once loaded. It won't load the image crossdomain with the loadClip function, but if I just use plain old loadMovie it works fine. This works: targetClip.loadMovie(imagePath); But this code doesn't: var mcLoader = new MovieClipLoader(); mcLoader.addListener(this); mcLoader.loadClip(imagePath, targetClip); I've no idea why using the loader class wouldn't work when it's deployed. Anyone got any ideas? Thanks, - Kevin ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] as3 and attachmovie
So the newMC will automatically know to get the next highest depth? And if that is true how about swapping depths with other mcs? ...helmut -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Meinte van't Kruis Sent: Tuesday, July 25, 2006 10:18 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] as3 and attachmovie Carl, Everything in AS3 is classes, so you can't do anything without using classes. It's actually easier than attachmovie. Just make a var newMC=new MovieClip(); this.addChild(newMC); feels alot cleaner that attachmovie(gf,gf+_root.getNextHighestDepth(),_root.getNextHighestDepth( )); doesn't it ;). good luck! Meinte ps. you can checkout senocular.com , he has some excellent tutorials on AS3 On 7/25/06, eka [EMAIL PROTECTED] wrote: Hello :) read in french : - http://iteratif.free.fr/blog/index.php?2006/07/11/44-bibliotheque-part agee-sous-flash-9 attachMovie is remove in AS3 :) Use [embed(source=)] metadata and create the instance with new MyClass and addChild() method :) eKA+ :) 2006/7/25, Carl Welch [EMAIL PROTECTED]: I just downloaded the demo of Flash 9 / as3 and I noticed you can't use attachmovie anymore. I've found some new methods on google but it seems like the only way I can do it is by using classes. Is there another way to handle an attachmovie equivilent without using a class in as3? thanks. -- Carl Welch http://www.carlwelch.com [EMAIL PROTECTED] 805.403.4819 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] 5 Star Rating System
On Jul 28, 2006, at 6:59 PM, Dave Watts wrote: This is not the appropriate place to ask this question. I don't know where the appropriate place would be, but I do know it's not here. However, Steven's was fair. (and pretty funny.) -- Troy RPSystems, Ltd. http://www.rpsystems.net ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] 5 Star Rating System
On Jul 29, 2006, at 12:36 PM, Troy Rollins wrote: However, Steven's was fair. (and pretty funny.) It would not have been fair if he hadn't specified the need for lasers, of course. Such a fine line... ;-) -- Troy RPSystems, Ltd. http://www.rpsystems.net ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] as3 and attachmovie
http://as3.betaruce.com/tut/tut_2/tut_2.html On 7/29/06, Helmut Granda [EMAIL PROTECTED] wrote: So the newMC will automatically know to get the next highest depth? And if that is true how about swapping depths with other mcs? ...helmut -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Meinte van't Kruis Sent: Tuesday, July 25, 2006 10:18 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] as3 and attachmovie Carl, Everything in AS3 is classes, so you can't do anything without using classes. It's actually easier than attachmovie. Just make a var newMC=new MovieClip(); this.addChild(newMC); feels alot cleaner that attachmovie(gf,gf+_root.getNextHighestDepth(),_root.getNextHighestDepth( )); doesn't it ;). good luck! Meinte ps. you can checkout senocular.com , he has some excellent tutorials on AS3 On 7/25/06, eka [EMAIL PROTECTED] wrote: Hello :) read in french : - http://iteratif.free.fr/blog/index.php?2006/07/11/44-bibliotheque-part agee-sous-flash-9 attachMovie is remove in AS3 :) Use [embed(source=)] metadata and create the instance with new MyClass and addChild() method :) eKA+ :) 2006/7/25, Carl Welch [EMAIL PROTECTED]: I just downloaded the demo of Flash 9 / as3 and I noticed you can't use attachmovie anymore. I've found some new methods on google but it seems like the only way I can do it is by using classes. Is there another way to handle an attachmovie equivilent without using a class in as3? thanks. -- Carl Welch http://www.carlwelch.com [EMAIL PROTECTED] 805.403.4819 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Carl Welch http://www.carlwelch.com [EMAIL PROTECTED] 805.403.4819 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Problems getting the brightness of a color returned from getPixel
Thanks very much for your response Martin but I don't understand it. I don't have three vars called R G and B. I just have a number which was retuned from getPixel. Am I being stupid? I can't see how I should do what you sugest. Pease explain a little further. James On 7/29/06, Martin Wood [EMAIL PROTECTED] wrote: to go from a 24 bit number to 3x8 bit colour components you can just shift it and mask the bits you need : var r=color 16 0xFF var g=color 8 0xFF var b=color 0xFF that should do the job. James Deakin wrote: Hi Guys, I'm having some problems with getting the brightness of a color returned from get pixel. get pixel returns an RGB color as a number which means I was expecting something like three groups of three numbers 255 255 255 or similar. what I am actually getting back is of this form 14540754 one digit short. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Problems getting the brightness of a color returnedfrom getPixel
Thanks very much for your response Martin but I don't understand it. I don't have three vars called R G and B. I just have a number which was retuned from getPixel. Am I being stupid? I can't see how I should do what you sugest. Pease explain a little further. That number you're getting is a color. You're just seeing it in decimal form, rather than hexadecimal form. It's the same thing. For example, the value for white is either 16777215 or 0xff (the two are the SAME number, just represented in two different ways). On 0xff, the first ff pair is R, then G, then B. Like when you have html color, #ff. To extract the single R G and B values from a color, simply apply Martin's code to the color. var color = 0xffc1e2; // or the one returned by getPixel, same thing var r = color 16 0xFF var g = color 8 0xFF var b = color 0xFF Then R, G, and B will contain the values for each channel, going from 0 to 255. Calculating brightness from that is one whole different matter, though. - Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Problems getting the brightness of a color returnedfrom getPixel
You seem to be thinking of numbers as if they are stored like strings. They aren't. RGB colors are stored as 3-byte (24-bit) numbers. For example, red looks like this in binary: b ...which is the same thing as this in hexadecimal: 0xFF ... which is the same thing as this in decimal: 16711680 To isolate, for example the red portion, you can use SHIFT RIGHT () to shift all bits to the right by 16 bits. Binary: b 16 = b Hexadecimal: 0xFF 16 = 0xFF Decimal: 16711680 16 = 255 Generally it's a good idea not to presume that there may not be more bits to the left, so you can filter them out using a bitwise AND (). To explain, this better, here's how to extract the green value from bright cyan (0x7F): The binary value of the color: 0111 Split into colors: 0111 Shift right 8 bits: 10111b 8 = In hexadecimal, this result is: 0x In decimal, it is: 65535 Clearly this is too large, because it includes the red value. To remove it, we use a bitwise AND. b 0xFF = b = 0xFF To illustrate, we are taking this value: b (=0x; =65535) ...and doing a bitwise AND with this value: b (=0x00FF; =255) This compares each bit in the first number to each bit in the second number. If both bits are 1 (on), that bit is 1 (on) in the result. If both bits are 0 (off), both bits are 0 (off) in the result. So the result is: b (=0xFF; =255) ...which is, indeed, the green value of the color. So Martin Wood's example (slightly edited): var r:Number = color 16 0xFF; var g:Number = color 8 0xFF; var b:Number = color 0xFF; ... is how to retrieve the red, green, and blue values from a single RGB color number. -- T. Michael Keesey ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Problems getting the brightness of a colorreturnedfrom getPixel
Small correction. This: This compares each bit in the first number to each bit in the second number. If both bits are 1 (on), that bit is 1 (on) in the result. If both bits are 0 (off), both bits are 0 (off) in the result. So the result is: ...should be: This compares each bit in the first number to each bit in the second number. If both bits are 1 (on), that bit is 1 (on) in the result. If *either bit is* 0 (off), *that bit is* 0 (off) in the result. So the result is: (emphasis added) -- T. Michael Keesey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Sent: Saturday, July 29, 2006 3:25 PM To: 'Flashcoders mailing list' Subject: RE: [Flashcoders] Problems getting the brightness of a colorreturnedfrom getPixel You seem to be thinking of numbers as if they are stored like strings. They aren't. RGB colors are stored as 3-byte (24-bit) numbers. For example, red looks like this in binary: b ...which is the same thing as this in hexadecimal: 0xFF ... which is the same thing as this in decimal: 16711680 To isolate, for example the red portion, you can use SHIFT RIGHT () to shift all bits to the right by 16 bits. Binary: b 16 = b Hexadecimal: 0xFF 16 = 0xFF Decimal: 16711680 16 = 255 Generally it's a good idea not to presume that there may not be more bits to the left, so you can filter them out using a bitwise AND (). To explain, this better, here's how to extract the green value from bright cyan (0x7F): The binary value of the color: 0111 Split into colors: 0111 Shift right 8 bits: 10111b 8 = In hexadecimal, this result is: 0x In decimal, it is: 65535 Clearly this is too large, because it includes the red value. To remove it, we use a bitwise AND. b 0xFF = b = 0xFF To illustrate, we are taking this value: b (=0x; =65535) ...and doing a bitwise AND with this value: b (=0x00FF; =255) This compares each bit in the first number to each bit in the second number. If both bits are 1 (on), that bit is 1 (on) in the result. If both bits are 0 (off), both bits are 0 (off) in the result. So the result is: b (=0xFF; =255) ...which is, indeed, the green value of the color. So Martin Wood's example (slightly edited): var r:Number = color 16 0xFF; var g:Number = color 8 0xFF; var b:Number = color 0xFF; ... is how to retrieve the red, green, and blue values from a single RGB color number. -- T. Michael Keesey ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com