Re: [Flashcoders] Selling a Flash website
Thanks Mike! I'll have a look right away. Gert-Jan 008/10/6 Mike Duguid [EMAIL PROTECTED] On Mon, Sep 29, 2008 at 4:18 PM, Gert-Jan van der Wel [EMAIL PROTECTED] wrote: For the last couple of years a friend and I were happily running a project on the side called T-signers.com. It's a site where people can design and order their own custom t-shirts. It's always been a pleasure to work on it, but recently a couple of things have changed and we can't find the time anymore to work on it. At this moment we're thinking about selling it or finding some enthusiastic developers to continue the project. Does anybody know how we should handle this? I'd have a look at sitepoint.com marketplace if you want to sell the site, there are a lot of serious traders there as opposed to ebay where you'd be unlikely to get more than beer money for it. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Gert-Jan van der Wel Co-Founder CTO, Floorplanner.com +31 (0)10 281 0799 +31 (0)6 1665 0338 [EMAIL PROTECTED] http://www.floorplanner.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] streaming mp3s not consistent
hi guys i have a quick question regarding streaming mp3s. I have several (hundred) dynamically loaded mp3s that i've been streaming into flash using the following code: NOTE: AS2 [code] private function startMouth():Void { var avatarSound:Sound = new Sound(); avatarSound.loadSound(mp3, true); avatarSound.onSoundComplete = Delegate.create(this, stopMouth); } [/code] mp3 is a getter that grabs the property _mp3 which is set dynamically before the method the problem i'm having is that the mp3s don't always stream fully and can stop before the end (and because of this, the onSoundComplete never fires). This is for a high-use application so we expect high server-load and spikes which makes me think that streaming might not be the best way - the mp3s are between 5-8k each so i was thinking that preloading them individually before use might be better would you agree with this or is there a better way of doing this? thanks a lot alz ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] [Solved] flushing memory
Found out what the problem was The data for the game was being held in a singleton - just needed to clear that and the game behaves properly On 4 Oct 2008, at 08:20, allandt bik-elliott (thefieldcomic.com) wrote: i've tried delete Question (Question is the main object that gets populated) but that didn't cut it On Fri, Oct 3, 2008 at 7:27 PM, eric e. dolecki [EMAIL PROTECTED] wrote: Handle it without using a timeline at all and use code straight instead? On Fri, Oct 3, 2008 at 2:11 PM, Allandt Bik-Elliott (Receptacle) [EMAIL PROTECTED] wrote: hi folks is there any way i can completely flush the memory for the flash plugin? i have a spelling game that uses classes on symbols placed on the timeline and when i hit a replay button at the end of my game, the playhead is moved to the start of the timeline (so none of the symbols are present any more) and then the game is started up again the only problem is that when the game goes through it's second pass, all of the questions are duplicated. I've tried delete'ing all of the objects in the class itself at the end of the game before i move back to the start but it still happens the only way i can see around it is to reload the whole page but that's a hit on the server which seems a little over the top cheers alz ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] extends MovieClip and static methods
Hi, Is it possible to have a class that extends MovieClip linked to a movie in the library and have statics methods and vars in it ?? L ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] extends MovieClip and static methods
Sorry I was not receiving mails when I send that: Hi, Is it possible to have a class that extends MovieClip linked to a movie in the library and have statics methods and vars in it ?? L if any answer can you repost ? thx :) L ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] extends MovieClip and static methods
Hi, Laurent, I don't see why not... if you're having trouble, the number one culprit when doing library linkage is often that the Flash IDE has an incorrect Class name and is secretly creating an unrelated class file behind the scenes. Double check your linkage settings, make sure the package is correct, etc. -jonathan On Mon, Oct 6, 2008 at 7:39 AM, laurent [EMAIL PROTECTED] wrote: Sorry I was not receiving mails when I send that: Hi, Is it possible to have a class that extends MovieClip linked to a movie in the library and have statics methods and vars in it ?? L if any answer can you repost ? thx :) L ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- -jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] attachMovie() with non-library-symbols
I've found a few movies out there using attachMovie() with symbol names which are NOT exported in the SWF movie containing the call. Are the SWF bogus (containing useless actionscript) or is there another interpretation of attachMovie() first argument ? --strk; () ASCII Ribbon Campaign /\ Keep it simple! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] extends MovieClip and static methods
Hi Jonathan, No the linking is good, I actually compile the fla containing that class with no problem. But when compiling my main that refer the the static method of that class it throw me errors about 1119: Access of possibly undefined property body through a reference with static type client.frenchdandy:CaddyView. like one mc on stage is undefined. of course because it will be defined when the mc containing that class will be added to the main stage...so why is it checking now??!! thx L jonathan howe a écrit : Hi, Laurent, I don't see why not... if you're having trouble, the number one culprit when doing library linkage is often that the Flash IDE has an incorrect Class name and is secretly creating an unrelated class file behind the scenes. Double check your linkage settings, make sure the package is correct, etc. -jonathan On Mon, Oct 6, 2008 at 7:39 AM, laurent [EMAIL PROTECTED] wrote: Sorry I was not receiving mails when I send that: Hi, Is it possible to have a class that extends MovieClip linked to a movie in the library and have statics methods and vars in it ?? L if any answer can you repost ? thx :) L ___ 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
[Fwd: Re: [Flashcoders] extends MovieClip and static methods]
Hi Jonathan, No the linking is good, I actually compile the fla containing that class with no problem. But when compiling my main that refer the the static method of that class it throw me errors about 1119: Access of possibly undefined property body through a reference with static type client.frenchdandy:CaddyView. like one mc on stage is undefined. of course because it will be defined when the mc containing that class will be added to the main stage...so why is it checking now??!! thx L jonathan howe a écrit : Hi, Laurent, I don't see why not... if you're having trouble, the number one culprit when doing library linkage is often that the Flash IDE has an incorrect Class name and is secretly creating an unrelated class file behind the scenes. Double check your linkage settings, make sure the package is correct, etc. -jonathan On Mon, Oct 6, 2008 at 7:39 AM, laurent [EMAIL PROTECTED] wrote: Sorry I was not receiving mails when I send that: Hi, Is it possible to have a class that extends MovieClip linked to a movie in the library and have statics methods and vars in it ?? L if any answer can you repost ? thx :) L ___ 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] test
sorry, here a present for testing if I receive your mails... http://vimeo.com/1831024 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] extends MovieClip and static methods
ok being less demanding, I made the call to my static method from the mc ( menu ) containing the class and from my main, I call menu.function(); that call the static one. No call of the static method is made from outside de mc it's compiled in. It's a workaround, I have no idea if it's possible to do what I wanted. L laurent a écrit : Hi Jonathan, No the linking is good, I actually compile the fla containing that class with no problem. But when compiling my main that refer the the static method of that class it throw me errors about 1119: Access of possibly undefined property body through a reference with static type client.frenchdandy:CaddyView. like one mc on stage is undefined. of course because it will be defined when the mc containing that class will be added to the main stage...so why is it checking now??!! thx L jonathan howe a écrit : Hi, Laurent, I don't see why not... if you're having trouble, the number one culprit when doing library linkage is often that the Flash IDE has an incorrect Class name and is secretly creating an unrelated class file behind the scenes. Double check your linkage settings, make sure the package is correct, etc. -jonathan On Mon, Oct 6, 2008 at 7:39 AM, laurent [EMAIL PROTECTED] wrote: Sorry I was not receiving mails when I send that: Hi, Is it possible to have a class that extends MovieClip linked to a movie in the library and have statics methods and vars in it ?? L if any answer can you repost ? thx :) L ___ 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
[Flashcoders] working with getPixel32 and setPixel32,
hi folks, can any one shed some light to me on the setpixel32 and getpixel32? I'd like to be able to affect just one of the 4 components: A R G or B independently of another. Essentially, read the current ARGB using getPixel32 and then manipulate just one part of it, in my case, halve the current A value of the ARGB and then re-assign it back to the bitmap. //1: grab the HEX value for the current coordinate: var val:uint = getPixel32(x,y); //2: manipulate the HEX value of just 1 of the 4 parts, in my case the A of the ARGB: //3: re-assign it back to the display: setPixel32(x,y,val); Thanks for your help! Sebastian. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] working with getPixel32 and setPixel32,
Hi, You might be able to do this easier by using getPixels() / setPixels() and manipulating the returned Byte Array. Here are some links that may help you do this fast: http://board.flashkit.com/board/showthread.php?t=741099 http://laserpirate.com/flashblog/?p=12 HTH Glen sebastian wrote: hi folks, can any one shed some light to me on the setpixel32 and getpixel32? I'd like to be able to affect just one of the 4 components: A R G or B independently of another. Essentially, read the current ARGB using getPixel32 and then manipulate just one part of it, in my case, halve the current A value of the ARGB and then re-assign it back to the bitmap. //1: grab the HEX value for the current coordinate: var val:uint = getPixel32(x,y); //2: manipulate the HEX value of just 1 of the 4 parts, in my case the A of the ARGB: //3: re-assign it back to the display: setPixel32(x,y,val); Thanks for your help! Sebastian. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] working with getPixel32 and setPixel32,
I'm not sure of this, but: After you grab val you could bitshift out the alpha channel (a), subtract that from the original argb value to remove the alpha channel. Manipulate a and bitshift it back up again before adding it to the rgb value to give you a new argb. var a:uint = val 32 0xff; var rgb:uint = val - (a 32); a = a / 2; var newval:uint = rgb + (a 32); Andrew Murphy Interactive Media Specialist [EMAIL PROTECTED] Delvinia 214 King Street West, Suite 214 Toronto Canada M5H 3S6 P 416.364.1455 ext. 232 F 416.364.9830 W www.delvinia.com CONFIDENTIALITY NOTICE This email message may contain privileged or confidential information. If you are not the intended recipient or received this communication by error, please notify the sender and delete the message without copying or disclosing it. AVIS DE CONFIDENTIALITÉ Ce message peut contenir de l'information légalement privilégiée ou confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir reçu par erreur ce message, nous vous saurions gré d'en aviser l'émetteur et d'en détruire le contenu sans le communiquer a d'autres ou le reproduire. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sebastian Sent: Monday, October 06, 2008 3:18 PM To: Flash Coders List Subject: [Flashcoders] working with getPixel32 and setPixel32, hi folks, can any one shed some light to me on the setpixel32 and getpixel32? I'd like to be able to affect just one of the 4 components: A R G or B independently of another. Essentially, read the current ARGB using getPixel32 and then manipulate just one part of it, in my case, halve the current A value of the ARGB and then re-assign it back to the bitmap. //1: grab the HEX value for the current coordinate: var val:uint = getPixel32(x,y); //2: manipulate the HEX value of just 1 of the 4 parts, in my case the A of the ARGB: //3: re-assign it back to the display: setPixel32(x,y,val); Thanks for your help! Sebastian. ___ 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] working with getPixel32 and setPixel32,
Thanks Glen and Andrew, Thanks for your fast help, Tried to use this code [below] but it makes my pixels yellow instead of 50% alpha on each pass... any ideas why? Is there any good tutorial on working with bit operations and bit logic? Would make it easier for me to trouble shoot/make my own equations. :) Thanks! Seb. Andrew Murphy wrote: I'm not sure of this, but: After you grab val you could bitshift out the alpha channel (a), subtract that from the original argb value to remove the alpha channel. Manipulate a and bitshift it back up again before adding it to the rgb value to give you a new argb. var a:uint = val 32 0xff; var rgb:uint = val - (a 32); a = a / 2; var newval:uint = rgb + (a 32); Andrew Murphy Interactive Media Specialist [EMAIL PROTECTED] Delvinia 214 King Street West, Suite 214 Toronto Canada M5H 3S6 P 416.364.1455 ext. 232 F 416.364.9830 W www.delvinia.com CONFIDENTIALITY NOTICE This email message may contain privileged or confidential information. If you are not the intended recipient or received this communication by error, please notify the sender and delete the message without copying or disclosing it. AVIS DE CONFIDENTIALITÉ Ce message peut contenir de l'information légalement privilégiée ou confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir reçu par erreur ce message, nous vous saurions gré d'en aviser l'émetteur et d'en détruire le contenu sans le communiquer a d'autres ou le reproduire. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sebastian Sent: Monday, October 06, 2008 3:18 PM To: Flash Coders List Subject: [Flashcoders] working with getPixel32 and setPixel32, hi folks, can any one shed some light to me on the setpixel32 and getpixel32? I'd like to be able to affect just one of the 4 components: A R G or B independently of another. Essentially, read the current ARGB using getPixel32 and then manipulate just one part of it, in my case, halve the current A value of the ARGB and then re-assign it back to the bitmap. //1: grab the HEX value for the current coordinate: var val:uint = getPixel32(x,y); //2: manipulate the HEX value of just 1 of the 4 parts, in my case the A of the ARGB: //3: re-assign it back to the display: setPixel32(x,y,val); Thanks for your help! Sebastian. ___ 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] working with getPixel32 and setPixel32,
Hi, I think you need to shift by 24 for alpha, you also need to shift then mask the value. RGB is just the bottom three bytes masked and shifting by 1 rather than divide by 2 may be faster, but google for the speed comparisons in AS3 - I think John Grden may have blogged this: var a:uint = (val 24) 0xff; var rgb:uint = val 0xff; a = a 1; var newval:uint = (a 32) | rgb; It would be a good learning exercise to do your own equations for manipulating pixel stuff, but have a look at Mario Klingemann's blog - quasimondo.com - for tips and tricks with images as he is one of the best people at manipulating bitmaps in Flash so he may have some nice examples to stimulate you. For simpler manipulation have a google. Also, if you are just setting the alpha to 50% for the whole bitmap, it may be quicker to do this on the MovieClip because FlashPlayer might be optimising composition somehow, but I understand this may just be an example. HTH Glen sebastian wrote: Thanks Glen and Andrew, Thanks for your fast help, Tried to use this code [below] but it makes my pixels yellow instead of 50% alpha on each pass... any ideas why? Is there any good tutorial on working with bit operations and bit logic? Would make it easier for me to trouble shoot/make my own equations. :) Thanks! Seb. Andrew Murphy wrote: I'm not sure of this, but: After you grab val you could bitshift out the alpha channel (a), subtract that from the original argb value to remove the alpha channel. Manipulate a and bitshift it back up again before adding it to the rgb value to give you a new argb. var a:uint = val 32 0xff; var rgb:uint = val - (a 32); a = a / 2; var newval:uint = rgb + (a 32); Andrew Murphy Interactive Media Specialist [EMAIL PROTECTED] Delvinia 214 King Street West, Suite 214 Toronto Canada M5H 3S6 P 416.364.1455 ext. 232 F 416.364.9830 W www.delvinia.com CONFIDENTIALITY NOTICE This email message may contain privileged or confidential information. If you are not the intended recipient or received this communication by error, please notify the sender and delete the message without copying or disclosing it. AVIS DE CONFIDENTIALITÉ Ce message peut contenir de l'information légalement privilégiée ou confidentielle. Si vous n'êtes pas le destinataire ou croyez avoir reçu par erreur ce message, nous vous saurions gré d'en aviser l'émetteur et d'en détruire le contenu sans le communiquer a d'autres ou le reproduire. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sebastian Sent: Monday, October 06, 2008 3:18 PM To: Flash Coders List Subject: [Flashcoders] working with getPixel32 and setPixel32, hi folks, can any one shed some light to me on the setpixel32 and getpixel32? I'd like to be able to affect just one of the 4 components: A R G or B independently of another. Essentially, read the current ARGB using getPixel32 and then manipulate just one part of it, in my case, halve the current A value of the ARGB and then re-assign it back to the bitmap. //1: grab the HEX value for the current coordinate: var val:uint = getPixel32(x,y); //2: manipulate the HEX value of just 1 of the 4 parts, in my case the A of the ARGB: //3: re-assign it back to the display: setPixel32(x,y,val); Thanks for your help! Sebastian. ___ 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 -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AS2 Memory / CPU usage
Hi, I have inherited an app which is very AS1 / AS2 timeline based and runs on a Linux kiosk box. Debugging the app today, I have noticed that the CPU usage spikes after a while and the whole application slows down. This seems to be when loading data from XML Sockets repeatedly, so I am guessing it may be a memory issue. Is there any way of delving into the system deeper to find out what the problem may be? Does anyone have any pointers to info or articles on what happens with FP memory CPU when you jump backwards and forwards in a timeline which references instances created on certain frames and global / _root objects functions? Does FP9 do memory management for AVM1? Thanks Glen -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] working with getPixel32 and setPixel32,
hi Glen, Kudos for the shift 1 operation, knew that was a faster operand. However, this code is still now working, now it simply doesn't change anything... :( var val:uint = getPixel32(x,y); var a:uint = (val 24) 0xff; var rgb:uint = val 0xff; a = a 1; var newval:uint = (a 32) | rgb; setPixel32(x,y,newval); I also tried changing it to say: ... var rgb:uint = val 0x00ff; a = a 1; var newval:uint = (a 24) | rgb; ... since I thought that was an error maybe, but that also doesn't influence the alpha of the pixel... :( Out of desperation I also tried: var a:uint = val 0xff00; var rgb:uint = val 0x00f; a = a 1; var newval:uint = a | rgb; and var a:uint = val 0xff00; var rgb:uint = val 0x00f; a = a 1; var newval:uint = (a 24) | rgb; :( sniff... Setting alpha for the whole MC is not an option for what I am doing. I'm trying to create trails behind things that are moving by having a video-burn like effect; by operating on the pixel level. At the moment I am using code from 'Adventures in AS', but once i have it working I'll encapsulate it and use it in a different project. The original source is: http://flashcoding.blogspot.com/2008/03/small-starfield-with-bluring-effect.html And my current draft-code modification is: package { import flash.events.*; import flash.display.*; import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; public class Starfield { var mc:MovieClip =new MovieClip(); var screendata:BitmapData; var stars:Array=new Array(); var antal:Number=500; public function Starfield(timeline) { screendata=new BitmapData(320,240,false,0x); var screen:Bitmap=new Bitmap(screendata); mc.addChild(screen); for (var i:int=0;iantal;i++) { InitStar(i); } mc.addEventListener(Event.ENTER_FRAME,this.render); timeline.addChild(mc); } private function MoveStar(index:int) { if (stars[index][0]-160 || stars[index][0]160 || stars[index][1]-120 || stars[index][1]120) { InitStar(index); } else { stars[index][0]= stars[index][0]*stars[index][2]; stars[index][1]= stars[index][1]*stars[index][2]; } } private function InitStar(index:int) { stars[index]=[Number(((Math.random()*10)-5)),Number(((Math.random()*10)-5)),Number((Math.random()/10)+1)]; } private function render(e:Event):void { for(var x:int=0;x320;x++) { for(var y:int=0;y240;y++) { var val:uint = screendata.getPixel32 (x,y); var a:uint = (val 24) 0xff; var rgb:uint = val 0xff; a = a 1; var newval:uint = (a 24) | rgb; screendata.setPixel32(x,y,newval); } } for(var i:int=0;iantal;i++) { MoveStar(i); screendata.setPixel(stars[i][0]+160,stars[i][1]+120,0xFF); } } } } Regards, Sebastian. Glen Pike wrote: Hi, I think you need to shift by 24 for alpha, you also need to shift then mask the value. RGB is just the bottom three bytes masked and shifting by 1 rather than divide by 2 may be faster, but google for the speed comparisons in AS3 - I think John Grden may have blogged this: var a:uint = (val 24) 0xff; var rgb:uint = val 0xff; a = a 1; var newval:uint = (a 32) | rgb; It would be a good learning exercise to do your own equations for manipulating pixel stuff, but have a look at Mario Klingemann's blog - quasimondo.com - for tips and tricks with images as he is one of the
[Flashcoders] SWC catalog XML file format documentation?
Hi, There are a couple of posts on this list from April discussing using nochump's ziplib to open read SWC files. I'm looking to do something along those lines. Is anyone aware of any documentation from Adobe on the SWC catalog's XML file format? thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] sizing an arbitrary loaded swf
PD: I think someone at Flash_Tiger just found a way simpler and more straight forward means to get the stage size: Try loaderInfo.width and loaderInfo.height. http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/LoaderInfo.html Cheers Juan Pablo Califano 2008/10/5, Juan Pablo Califano [EMAIL PROTECTED]: Hi Andrew, I'm not sure were the problem could be, but checking both swf's I got 640x480 and 600x200, which seems right. If I open the swf standalone (I mean double clicking on it), the player opens it with those dimensions. Plus, I've converted the to fla just to check the dimensions and I got back the same values. What the swf header contains is the size of the stage, or, in other words, the size you set for the fla document at author time (if you're using the Flash IDE; in that case, it's the numbers you set using the size button in the properties panel). I've also checked with another player from youtube and the size of the swf is 480x387, which seems to match with the rebuilt fla and with what I see in the site. Maybe those swf's are being scaled, cropped or masked by other means ? (when embedding, for instance) It's just a thought, anyway, perhaps if you post the url of the page that contains those swfs, someone is able to figure out why there's a difference between what you see on the screen and the swf's stage size. Cheers Juan Pablo Califano 2008/10/5, Andrew Sinning [EMAIL PROTECTED]: Hi Juan Pablo, I just got back to this problem and tested your SwfHeader class. From the few tests that I've run, this returns exactly the same dimensions that the LoaderInfo class does. I'm still stuck. Here's an example of a swf on YouTube: http://www.youtube.com/v/C7PH3GVj104 The LoaderInfo/SwfHeader dimensions are 640x320, but the actual dimensions appear to be 320x180. This swf http://client.shoutlet.com/static/imageplayer/viewer.php?config=http://client.shoutlet.com/file/64/5863.xml Looks to be actually 400x200 but the LoaderInfo/SwfHeader dimensions are 600x200. Juan Pablo Califano wrote: http://pastebin.be/14115 (SwfHeader class) 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] working with getPixel32 and setPixel32,
Hi, If I haven't misread something, this a = a 1; makes no sense. Unless you're trying to divide alpha by 2, in which case I obviously missed something. If you want to extract the 4 components, you can use something like this: var hexaValue:int = 0x9100ff33; var a:int = (hexaValue 24) 0xff; var r:int = (hexaValue 16) 0xff;; var g:int = (hexaValue 8) 0xff;; var b:int = hexaValue 0xff; var newAlpha:int = 0xcc; var copyHexaValue:int = newAlpha 24 | r 16 | g 8 | b; trace(uint(copyHexaValue).toString(16)); // traces cc00ff33 If you don't bother to get the individual RGB components, just the alpha channel, try this: var hexaValue:int = 0x9100ff33; var a:int = (hexaValue 24) 0xff; var arg:int = hexaValue 0xff; var newAlpha:int = 0xcc; copyHexaValue = newAlpha 24 | arg; trace(uint(copyHexaValue).toString(16));// traces cc00ff33 Also, I'm casting to uint just to display the value in a more meaningful/readable way in the trace, but as long as you don't perform arithmetic on those values, you don't have to (because it's parsed as a bit pattern, not as numerical value, if that makes sense...). Cheers Juan Pablo Califano 2008/10/6, sebastian [EMAIL PROTECTED]: hi Glen, Kudos for the shift 1 operation, knew that was a faster operand. However, this code is still now working, now it simply doesn't change anything... :( var val:uint = getPixel32(x,y); var a:uint = (val 24) 0xff; var rgb:uint = val 0xff; a = a 1; var newval:uint = (a 32) | rgb; setPixel32(x,y,newval); I also tried changing it to say: ... var rgb:uint = val 0x00ff; a = a 1; var newval:uint = (a 24) | rgb; ... since I thought that was an error maybe, but that also doesn't influence the alpha of the pixel... :( Out of desperation I also tried: var a:uint = val 0xff00; var rgb:uint = val 0x00f; a = a 1; var newval:uint = a | rgb; and var a:uint = val 0xff00; var rgb:uint = val 0x00f; a = a 1; var newval:uint = (a 24) | rgb; :( sniff... Setting alpha for the whole MC is not an option for what I am doing. I'm trying to create trails behind things that are moving by having a video-burn like effect; by operating on the pixel level. At the moment I am using code from 'Adventures in AS', but once i have it working I'll encapsulate it and use it in a different project. The original source is: http://flashcoding.blogspot.com/2008/03/small-starfield-with-bluring-effect.html And my current draft-code modification is: package { import flash.events.*; import flash.display.*; import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; public class Starfield { var mc:MovieClip =new MovieClip(); var screendata:BitmapData; var stars:Array=new Array(); var antal:Number=500; public function Starfield(timeline) { screendata=new BitmapData(320,240,false,0x); var screen:Bitmap=new Bitmap(screendata); mc.addChild(screen); for (var i:int=0;iantal;i++) { InitStar(i); } mc.addEventListener(Event.ENTER_FRAME,this.render); timeline.addChild(mc); } private function MoveStar(index:int) { if (stars[index][0]-160 || stars[index][0]160 || stars[index][1]-120 || stars[index][1]120) { InitStar(index); } else { stars[index][0]= stars[index][0]*stars[index][2]; stars[index][1]= stars[index][1]*stars[index][2]; } } private function InitStar(index:int) { stars[index]=[Number(((Math.random()*10)-5)),Number(((Math.random()*10)-5)),Number((Math.random()/10)+1)]; } private function render(e:Event):void { for(var x:int=0;x320;x++) { for(var y:int=0;y240;y++) { var val:uint = screendata.getPixel32 (x,y); var a:uint = (val 24) 0xff; var rgb:uint = val 0xff; a = a 1; var newval:uint = (a 24) | rgb; screendata.setPixel32(x,y,newval); } }
Re: [Flashcoders] working with getPixel32 and setPixel32,
PD: Sorry, even though the result is the same, to make more sense the second sample should read: var hexaValue:int = 0x9100ff33; var a:int = (hexaValue 24) 0xff; var rgb:int = hexaValue 0xff; var newAlpha:int = 0xcc; copyHexaValue = newAlpha 24 | rgb; trace(uint(copyHexaValue).toString(16));// traces cc00ff33 Using rgb as the name of the var that stores the value of the RGB components, instead of arg. 2008/10/6, Juan Pablo Califano [EMAIL PROTECTED]: Hi, If I haven't misread something, this a = a 1; makes no sense. Unless you're trying to divide alpha by 2, in which case I obviously missed something. If you want to extract the 4 components, you can use something like this: var hexaValue:int = 0x9100ff33; var a:int = (hexaValue 24) 0xff; var r:int = (hexaValue 16) 0xff;; var g:int = (hexaValue 8) 0xff;; var b:int = hexaValue 0xff; var newAlpha:int = 0xcc; var copyHexaValue:int = newAlpha 24 | r 16 | g 8 | b; trace(uint(copyHexaValue).toString(16)); // traces cc00ff33 If you don't bother to get the individual RGB components, just the alpha channel, try this: var hexaValue:int = 0x9100ff33; var a:int = (hexaValue 24) 0xff; var arg:int = hexaValue 0xff; var newAlpha:int = 0xcc; copyHexaValue = newAlpha 24 | arg; trace(uint(copyHexaValue).toString(16));// traces cc00ff33 Also, I'm casting to uint just to display the value in a more meaningful/readable way in the trace, but as long as you don't perform arithmetic on those values, you don't have to (because it's parsed as a bit pattern, not as numerical value, if that makes sense...). Cheers Juan Pablo Califano 2008/10/6, sebastian [EMAIL PROTECTED]: hi Glen, Kudos for the shift 1 operation, knew that was a faster operand. However, this code is still now working, now it simply doesn't change anything... :( var val:uint = getPixel32(x,y); var a:uint = (val 24) 0xff; var rgb:uint = val 0xff; a = a 1; var newval:uint = (a 32) | rgb; setPixel32(x,y,newval); I also tried changing it to say: ... var rgb:uint = val 0x00ff; a = a 1; var newval:uint = (a 24) | rgb; ... since I thought that was an error maybe, but that also doesn't influence the alpha of the pixel... :( Out of desperation I also tried: var a:uint = val 0xff00; var rgb:uint = val 0x00f; a = a 1; var newval:uint = a | rgb; and var a:uint = val 0xff00; var rgb:uint = val 0x00f; a = a 1; var newval:uint = (a 24) | rgb; :( sniff... Setting alpha for the whole MC is not an option for what I am doing. I'm trying to create trails behind things that are moving by having a video-burn like effect; by operating on the pixel level. At the moment I am using code from 'Adventures in AS', but once i have it working I'll encapsulate it and use it in a different project. The original source is: http://flashcoding.blogspot.com/2008/03/small-starfield-with-bluring-effect.html And my current draft-code modification is: package { import flash.events.*; import flash.display.*; import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; public class Starfield { var mc:MovieClip =new MovieClip(); var screendata:BitmapData; var stars:Array=new Array(); var antal:Number=500; public function Starfield(timeline) { screendata=new BitmapData(320,240,false,0x); var screen:Bitmap=new Bitmap(screendata); mc.addChild(screen); for (var i:int=0;iantal;i++) { InitStar(i); } mc.addEventListener(Event.ENTER_FRAME,this.render); timeline.addChild(mc); } private function MoveStar(index:int) { if (stars[index][0]-160 || stars[index][0]160 || stars[index][1]-120 || stars[index][1]120) { InitStar(index); } else { stars[index][0]= stars[index][0]*stars[index][2]; stars[index][1]= stars[index][1]*stars[index][2]; } } private function InitStar(index:int) { stars[index]=[Number(((Math.random()*10)-5)),Number(((Math.random()*10)-5)),Number((Math.random()/10)+1)]; } private function render(e:Event):void { for(var x:int=0;x320;x++) { for(var y:int=0;y240;y++)