[Flashcoders] Random numbers?
Can someone help me understand why the randRange function below doesn't return a random distribution, but the randRange2 function does? Here's some test code. thanks, - rajat var a = [0,0,0,0,0]; var b = [0,0,0,0,0]; var x; for (var i=0; i 1000; i++) { x = randRange(1,4); a[x]++; x = randRange2(1,4); b[x]++; } trace (a: + a); trace (b: + b); // -- // Generate a random number in a range. function randRange(min, max) { var randomNum = Math.round(Math.random()*(max-min))+min; return randomNum; } // Generate a random number in a range. function randRange2(min, max) { var randomNum = min + Math.floor(Math.random() * (max + 1 - min)); return randomNum; } -- Rajat Paharia [EMAIL PROTECTED] http://www.bunchball.com http://www.rootburn.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] (no subject)
hey how do i not get all these message in other words not me registerd to flas coders -Original Message- From: [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Thu, 6 Jul 2006 2:27 AM Subject: Re: [Flashcoders] (no subject) I encountered this strange quirk recently as well. I found the most reliable solution is to duplicate your project folder, open and recompile from that folder, close and continue working from your original folder and everything is fine (for a while)! No amount of deleting ASO cache solves it (in fact, some say it compounds the problem). Here is an extensive outline of the problem which a) doesn't seem to provide a solution (other than saying you can safely ignore the error) and b) doesn't suggest how to prevent the problem arising. http://ericlin2.tripod.com/as2/conflict.html If anyone can shed any more light on how to prevent this quirk, I'd be grateful. HTH A. On 7/6/06, grimmwerks [EMAIL PROTECTED] wrote: Curious - can't figure out where there's a second example of the classes floating around -- any suggestions? **Error** C:\Documents and Settings\grimmwerks\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Classes\com\grimmwerks\bakery\NumericStepperCell.as: Line 13: The name of this class, 'com.grimmwerks.bakery.NumericStepperCell', conflicts with the name of another class that was loaded, ' com.grimmwerks.bakery.NumericStepperCell'. class com.grimmwerks.bakery.NumericStepperCell extends UIComponent { ___ 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 Check out AOL.com today. Breaking news, video search, pictures, email and IM. All on demand. Always Free. ___ 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] butterfly animation
Hi Doug, i used the bit101 particle class (http://www.bit-101.com/Particles/) in conjunction with a preanimated butterfly. See http:// www.petrusko.de/butterfly.swf for an example (the butterflies appear after click). The important thing is to set turnToPath to true and experiment with wander/maxSpeed/grav. Gives a quite random butterfly motion... Greetz, Mathis Am 21.07.2006 um 21:31 schrieb Doug Tangren: does anybody here have a link for a good actionscript butterfly animation? Doug Tangren [EMAIL PROTECTED] ___ 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] (no subject)
On 7/23/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hey how do i not get all these message in other words not me registerd to flas coders The instructions appear at the end of every message you receive from the mailing list. ___ 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] getting started with AS3
try these as well, helped me get started: http://www.senocular.com/flash/tutorials/as3withmxmlc/ the same guy also posts as3 tip-of-the day on kirupa.com forum. good luck, -Meinte On 7/21/06, Bbt Lists [EMAIL PROTECTED] wrote: Tom Lee wrote: If you are a licensed user of Flash 8, you can download the Flash 9 AS3 Preview at http://labs.adobe.com/technologies/flash9as3preview/. Thanks MUCH! -- dnk ___ 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] butterfly animation
I had to create a butterfly animation for a client a while ago. After messing around for a bit, I decided that it was the kind of thing that could be done better using traditional timeline animation. The reason being that the butterfly's wings stretch and bend in all sorts of complicated ways while it's flying. To get all those curves right with actionscript might be doable, but it would be hairy. If you don't need that level of realism, actionscript is a more tenable solution - I'd google actionscript inverse kinematics... Anyway, it's not code, but here you go... http://www.jimkremens.com/dev/demo/butterfly/index.html Jim Kremens On 7/21/06, Doug Tangren [EMAIL PROTECTED] wrote: does anybody here have a link for a good actionscript butterfly animation? Doug Tangren [EMAIL PROTECTED] ___ 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] (no subject)
On 6-jul-2006, at 11:27, Adrian Park wrote: I encountered this strange quirk recently as well. I found the most reliable solution is to duplicate your project folder, open and recompile from that folder, close and continue working from your original folder and everything is fine (for a while)! No amount of deleting ASO cache solves it (in fact, some say it compounds the problem). This happens when you use the star import construct: import some.quirky.namespace.* // will reimport some classes, sometimes, depending on phases of the moon The compiler goes bonkers over that. If you want to ruin it to pieces and see it crash and burn, do this: import FP8.* ___ 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] sequential tweens ?
Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ 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] Re: Flashcoders Digest, Vol 18, Issue 60
Thank you for your email. I will be out of the office Friday, 7/21. If you need any assistance, please contact Paul Sternglass at [EMAIL PROTECTED] or 914-614-0046. ___ 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] need help with local apache test server
use xammp, saved u from installing them just one click xammp do it for you. www.apachefriends.org On 7/23/06, Marc Hoffman [EMAIL PROTECTED] wrote: I'm trying to set up a local apache server for testing PHP on my laptop. This is all new territory for me and although I've followed instructions on several sites, it won't work. I do have TCP/IP working. During setup and when trying to start the server, I get this DOS message: Installing the Apache2.2 service The Apache2.2 service is successfully installed. Testing httpd.conf Errors reported here must be corrected before the service can be started. (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Note the errors or messages above, and press the ESC key to exit. 25... I then tried installing WAMP, which integrates the apache server functionality. I used it to have Apache test port 80 (which is what the server is using) and first got a DOS alert that Skype might be using it. Closed Skype, re-tested port 80, and got the DOS alert Your port 80 is not actually used. Then I used WAMP to Install Service and got the DOS message: Your port 80 is available, Install will proceed. But a subsequent test of Port 80 once again indicated Your port 80 is not actually used. WAMP allows direct setting of the WWW root, and I have pointed it to a location with an index.html file. But my browser (firefox) cannot open http://localhost/ or http://localhost/test01 where I have another index.html file. I'd appreciate help from anyone who understands this stuff. Thanks, Marc ___ 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 -- Discipline can be painful, but it helps when you give it a chance. ___ 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] My Flash Editor UI is invisible/disapeared?
try ..rightclick 'restore'. On 7/22/06, Chris McFadyen aka Grayson Carlyle [EMAIL PROTECTED] wrote: As of yesterday, I can only see Flash Editor in maximized mode. Trying to restore the window to it's normal size results in blank desktop, however, I can still access the menus using alt, as seen in this image: http://home.cogeco.ca/~gcarlyle24/flashgone.gif Only affects Flash Editor, though, quite possibly has nothing to do with Flash. Anyone seen this happen to them before? ___ 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 -- Discipline can be painful, but it helps when you give it a chance. ___ 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] sequential tweens ?
Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished João, Your best bet would be to use some better tweening engine that allows delays. That way you could fire all your tweens at once without having to worry about setting callbacks or other events when each tween is finished - you just give a increasingly bigger delkay for each photo. Not only this makes some clearer and more straightforward code, but you could even animate it in a way that the photos' tweening time intersect each other, without being dependent on chained events. For this task I'd recommend mc tween, laco's tween, or the fuse kit. Any of them will do what you want, and there's probably a few more that I'm forgetting about. You *could* do it with your onMotionFinished event. You'd need to setup a function that fires the animation, and each photo would have to fire the animation on the next one. It's simple, but it's awkward and counterproductive. And really, this kind of need is something that comes up so frequently when animating an interface that using a class or extension that supports delays instead is your best bet. - 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] sequential tweens ?
i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ 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 -- John Van Horn [EMAIL PROTECTED] ___ 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, BitmapData and domain security
I don't see the point of restricting access to BitmapData from another server when all you have to do to get at it is use a proxy script on your own server. Here's an example: http://www.neave.com/temp/proxy.php?proxy_url=http://www.google.com/ intl/en/images/logo.gif I was doing something similar in Director a few years ago and ended up having to rename my php script to proxy.jpg and editing my .htaccess file for that directory to execute a .jpg as a php script (using AddHandler, IIRC). Perhaps this is Flash's issue as well... Alan ___ 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] Random numbers?
It is the difference between floor and round. Charles P. On 7/23/06, Rajat Paharia [EMAIL PROTECTED] wrote: Can someone help me understand why the randRange function below doesn't return a random distribution, but the randRange2 function does? Here's some test code. thanks, - rajat var a = [0,0,0,0,0]; var b = [0,0,0,0,0]; var x; for (var i=0; i 1000; i++) { x = randRange(1,4); a[x]++; x = randRange2(1,4); b[x]++; } trace (a: + a); trace (b: + b); // -- // Generate a random number in a range. function randRange(min, max) { var randomNum = Math.round(Math.random()*(max-min))+min; return randomNum; } // Generate a random number in a range. function randRange2(min, max) { var randomNum = min + Math.floor(Math.random() * (max + 1 - min)); return randomNum; } -- Rajat Paharia [EMAIL PROTECTED] http://www.bunchball.com http://www.rootburn.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] jigsaw puzzle
I am trying to go on this way step by step and and met something that I cannot understand. Maybe anybody can help. I created pieces of puzzle. Each puzzle contain mask that I draw with Drawing API on one level. I checked it and it creates well. Then I attach picture on another layer. I see now mask and picture. All is correct. I say pic.setMask(mask) after that picture is masked but it has configuration that is different from mask shape. function drawPattern(linkageID, target, clipName, depth, x, y, cur_row, cur_column):MovieClip { var r=partW*0.15; var mc:MovieClip = target.createEmptyMovieClip(clipName, depth); mc._x = x; mc._y = y; maskX=(partW*cur_column); maskY=(partH*cur_row); var mask:MovieClip = mc.createEmptyMovieClip(mask, 2); var pic:MovieClip=mc.attachMovie(linkageID,pic,1); pic._x=0; pic._y=0; mask_sides=sides[cur_column][cur_row]; mask.lineStyle(undefined, 0x0, 100); mask.moveTo(maskX, maskY); mask.beginFill(0x0, 100); drawSideV(mask,mask._xpen,mask._ypen,mask_sides[1]*r,1); drawSideG(mask,mask._xpen,mask._ypen,mask_sides[2]*r,1); drawSideV(mask,mask._xpen,mask._ypen,mask_sides[3]*r,-1); drawSideG(mask,mask._xpen,mask._ypen,mask_sides[4]*r,-1); mask.endFill(); pic.setMask(mask); return mc; } function tiler (linkageID){ depthCount=1; for (var j=0;jcolumn;j++){ for(var i=0;irow;i++){ part=drawPattern(linkageID,this,part+j+_+i,depthCount,stageX,stageY,i,j); depthCount++; activity(part.mask); } } } tiler(pic); Thanks a lot for help. 2006/7/16, Hans Wichman [EMAIL PROTECTED]: Hi Natalia, you can find it here: http://www.google.nl/search?hl=nlq=jigsaw+puzzle+flashcodersmeta= and http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/msg17822.html Yes its possible. greetz Hans On 7/16/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Thank you, Guntur. I can not find your thread in the archive. Do you have this algorithm or any basic fla? It would be very helpful. Drawing api is clear for one object but creating many puzzles looks fantastic. Is it possible? Natalia 2006/7/16, Guntur N. Sarwohadi [EMAIL PROTECTED]: Natalia, You can search the archive and find recent threads concering jigsaw puzzle algorithm. In fact, thats the thread I started.. that's why I (and Hans) know it's there ^_^ But to answer you question... 1. flash 8 has provided a bitmapData class, it's really good handling bitmaps so you can use the copyPixel method and but it in n movieClips on it. For jigsaw drawing, you can use flash drawing api.. especially the curveTo method. Basically it's only one type of curving and it is repeated for each side with variations being it inward or out.. 2. group and blending two pieces isn't that hard actually, as long as the pieces are placed in the right position it will look as one. The drop shadow is done by code and updated, while the center curve fading can also be done by code.. sure, it's a little complex than droptarget and hittest but it can be done :D hope that helps Guntur N. Sarwohadi On 7/15/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Yes, I checked before posting but found only questions without answers. 2006/7/15, Hans Wichman [EMAIL PROTECTED]: Please refer to the archives, there is a thread about this going on as we speak... On 7/15/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Hi to all Can anybody give me advice for creating game like this? http://www.magickeys.com/books/jigsaws/cheetah_1/e.html 1. How can I create each time different pieces? I can only guess that there are some sets with different shapes and they attached as mask. 2. When pieces are correct new pieces appear. How this is done? How they determinate that? This is not droptarget or hittest. How from two masks they create one mask? Has anybody any code that can help to create this? Thanks, natavi ___ 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:
RE: [Flashcoders] Speak into microphone Save as wav to sever, is it possible in Flash9 /AS3/Flex2 ??!
There was a long discussion about this on the Red5 mailing list (open source flash comm server) a couple of months back. The audio is saved on the server as a FLV. Converting to mp3/wav is possible but not really so easy There are some posts and discussions on this subject on this site: http://www.flashcomguru.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] jigsaw puzzle
Hi, what exactly do you mean, it has a config different from the mask shape? The only thing that seems 'off' to me is the starting index in the mask sides, which starts with 1 instead of zero, but that might be perfectly ok depending on how you built the array. Could you show a screendump of what you describe? greetz Hans On 7/23/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: I am trying to go on this way step by step and and met something that I cannot understand. Maybe anybody can help. I created pieces of puzzle. Each puzzle contain mask that I draw with Drawing API on one level. I checked it and it creates well. Then I attach picture on another layer. I see now mask and picture. All is correct. I say pic.setMask(mask) after that picture is masked but it has configuration that is different from mask shape. function drawPattern(linkageID, target, clipName, depth, x, y, cur_row, cur_column):MovieClip { var r=partW*0.15; var mc:MovieClip = target.createEmptyMovieClip(clipName, depth); mc._x = x; mc._y = y; maskX=(partW*cur_column); maskY=(partH*cur_row); var mask:MovieClip = mc.createEmptyMovieClip(mask, 2); var pic:MovieClip=mc.attachMovie(linkageID,pic,1); pic._x=0; pic._y=0; mask_sides=sides[cur_column][cur_row]; mask.lineStyle(undefined, 0x0, 100); mask.moveTo(maskX, maskY); mask.beginFill(0x0, 100); drawSideV(mask,mask._xpen,mask._ypen,mask_sides[1]*r,1); drawSideG(mask,mask._xpen,mask._ypen,mask_sides[2]*r,1); drawSideV(mask,mask._xpen,mask._ypen,mask_sides[3]*r,-1); drawSideG(mask,mask._xpen,mask._ypen,mask_sides[4]*r,-1); mask.endFill(); pic.setMask(mask); return mc; } function tiler (linkageID){ depthCount=1; for (var j=0;jcolumn;j++){ for(var i=0;irow;i++){ part=drawPattern(linkageID,this,part+j+_+i,depthCount,stageX,stageY,i,j); depthCount++; activity(part.mask); } } } tiler(pic); Thanks a lot for help. 2006/7/16, Hans Wichman [EMAIL PROTECTED]: Hi Natalia, you can find it here: http://www.google.nl/search?hl=nlq=jigsaw+puzzle+flashcodersmeta= and http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/msg17822.html Yes its possible. greetz Hans On 7/16/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Thank you, Guntur. I can not find your thread in the archive. Do you have this algorithm or any basic fla? It would be very helpful. Drawing api is clear for one object but creating many puzzles looks fantastic. Is it possible? Natalia 2006/7/16, Guntur N. Sarwohadi [EMAIL PROTECTED]: Natalia, You can search the archive and find recent threads concering jigsaw puzzle algorithm. In fact, thats the thread I started.. that's why I (and Hans) know it's there ^_^ But to answer you question... 1. flash 8 has provided a bitmapData class, it's really good handling bitmaps so you can use the copyPixel method and but it in n movieClips on it. For jigsaw drawing, you can use flash drawing api.. especially the curveTo method. Basically it's only one type of curving and it is repeated for each side with variations being it inward or out.. 2. group and blending two pieces isn't that hard actually, as long as the pieces are placed in the right position it will look as one. The drop shadow is done by code and updated, while the center curve fading can also be done by code.. sure, it's a little complex than droptarget and hittest but it can be done :D hope that helps Guntur N. Sarwohadi On 7/15/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Yes, I checked before posting but found only questions without answers. 2006/7/15, Hans Wichman [EMAIL PROTECTED]: Please refer to the archives, there is a thread about this going on as we speak... On 7/15/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Hi to all Can anybody give me advice for creating game like this? http://www.magickeys.com/books/jigsaws/cheetah_1/e.html 1. How can I create each time different pieces? I can only guess that there are some sets with different shapes and they attached as mask. 2. When pieces are correct new pieces appear. How this is done? How they determinate that? This is not droptarget or hittest. How from two masks they create one mask? Has anybody any code that can help to create this? Thanks, natavi ___
Re: [Flashcoders] sequential tweens ?
yes .. I think it´s going to work .. I will try - Original Message - From: John VanHorn [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 2:00 PM Subject: Re: [Flashcoders] sequential tweens ? i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ 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 -- John Van Horn [EMAIL PROTECTED] ___ 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] sequential tweens ?
Hi João! Have you taken a look at Fuse or animationpackage? It makes sequential tweens much easir and straitghforward... Cheers, - Marcelo. On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: yes .. I think it´s going to work .. I will try - Original Message - From: John VanHorn [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 2:00 PM Subject: Re: [Flashcoders] sequential tweens ? i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ 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 -- John Van Horn [EMAIL PROTECTED] ___ 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] sequential tweens ?
Well I made some through the onMotionFinished but your app is fully dependent on all tweens having their opening job done, the app logic gets hidden inside a series of onMotionFinished wich you have to navigate through one by one. For example I´m doing a CD where I have a lot of opening activity and only after it I set the menus and display containers when I did it at first time I had just one function call createCD() and as all actions were sequentially dependents, to understand what the app did it was necessary to go from one function after another till I got the last one I was wondering about some colection or queue scheme where some animators objects ( object to be tweened, tweening properties ) would implement some interface and the complete animation chain would be achived in a FOR IN loop through the collection, am I missing something here ? I´d rather to invest more in code clarity than in some special tricks, even working for some time with OO I still have preference to realize what the app is doing in some structured fashion, maybe I´m overstressing it -) thanks for your time João Carlos - Original Message - From: Zeh Fernando [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 1:52 PM Subject: Re: [Flashcoders] sequential tweens ? Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished João, Your best bet would be to use some better tweening engine that allows delays. That way you could fire all your tweens at once without having to worry about setting callbacks or other events when each tween is finished - you just give a increasingly bigger delkay for each photo. Not only this makes some clearer and more straightforward code, but you could even animate it in a way that the photos' tweening time intersect each other, without being dependent on chained events. For this task I'd recommend mc tween, laco's tween, or the fuse kit. Any of them will do what you want, and there's probably a few more that I'm forgetting about. You *could* do it with your onMotionFinished event. You'd need to setup a function that fires the animation, and each photo would have to fire the animation on the next one. It's simple, but it's awkward and counterproductive. And really, this kind of need is something that comes up so frequently when animating an interface that using a class or extension that supports delays instead is your best bet. - 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 ___ 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] sequential tweens ?
Hi Marcelo you had suggested that to me another time -) I will take a look on them right now -) João Carlos - Original Message - From: Marcelo de Moraes Serpa [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 4:19 PM Subject: Re: [Flashcoders] sequential tweens ? Hi João! Have you taken a look at Fuse or animationpackage? It makes sequential tweens much easir and straitghforward... Cheers, - Marcelo. On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: yes .. I think it´s going to work .. I will try - Original Message - From: John VanHorn [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 2:00 PM Subject: Re: [Flashcoders] sequential tweens ? i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ 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 -- John Van Horn [EMAIL PROTECTED] ___ 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] sequential tweens ?
couldnt you just use 2 methods in your class to control the sequence of tweens? // Start a tween for a photo private function tweenPhoto() { var animPhotoX:Tween = new Tween (photoStrip[currentIndex], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[currentIndex], _yscale, Bounce.easeOut, 100, 120, 0.5, true); // Get the tween to call us back when its finished animPhotoY.onMotionFinished = Delegate.create(this,tweenFinished); } // Tween finished private function tweenFinished() { currentIndex++; if(currentIndex == numberOfPhotos) { // The sequence is complete // do something, dispatch an event, call a method etc.. :) } else { startTween(currentIndex); } } Then to start the whole show just make sure currentIndex and numberOfPhotos are setup correctly and call tweenPhoto(); e.g. private function createPhotos(photolist:Array) { // photo creation stuff here currentIndex = 0; numberOfPhotos = photolist.length; tweenPhoto(); } no need for intervals or anything fancy. hope thats what you mean. Martin jcarlos wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? ___ 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] sequential tweens ?
I can't recommend Zeh's MC Tween enough...you can sequence the tweens and even have callbacks when the tween is finished to call a function. Check out the documentation and examples here: http:// hosted.zeh.com.br/mctween/index.html Gerry On Jul 23, 2006, at 3:40 PM, jcarlos wrote: Hi Marcelo you had suggested that to me another time -) I will take a look on them right now -) João Carlos - Original Message - From: Marcelo de Moraes Serpa [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 4:19 PM Subject: Re: [Flashcoders] sequential tweens ? Hi João! Have you taken a look at Fuse or animationpackage? It makes sequential tweens much easir and straitghforward... Cheers, - Marcelo. On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: yes .. I think it´s going to work .. I will try - Original Message - From: John VanHorn [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Sunday, July 23, 2006 2:00 PM Subject: Re: [Flashcoders] sequential tweens ? i think the setInterval thing would work just fine. you could pass the same time to the interval that you do to the tween. or you could do somehthing like this: //if pics are loaded dynamically, these can be set dynamically var mcNum:Number = 1; var mcMax:Number = 4; function nextTween(){ var theMc:MovieClip = this[mc + mcNum]; var theTween:Tween = new Tween(theMc, _x, Strong.easeInOut, theMc._x, theMc._x - 85, 1, true); theTween.onMotionFinished = function(){ mcNum++; if(mcNum = mcMax){ nextTween(); } } } nextTween(); On 7/23/06, jcarlos [EMAIL PROTECTED] wrote: Hi All, I need some ideas how to workaround the following situation I have na mc as an holder for some photoStrip this photoStrip has n photos as mcs in it I want to produce some tween over each one BUT the next tween should only begin after the previous has finished as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ? for (var prop in photoStrip) { if (prop != _childCounter) { var animPhotoX:Tween = new Tween (photoStrip[prop], _xscale, Bounce.easeOut, 100, 120, 0.5, true); var animPhotoY:Tween= new Tween (photoStrip[prop], _yscale, Bounce.easeOut, 100, 120, 0.5, true); animPhotoY.onMotionFinished = function() { // would be the next tween something like } } } } I know that inside the the strip the mcs are named as childDepth0 to childDepthN-1 being N the number of photos placed in it I tryed something with a for photoStrip[depthChild + i] but it didn´t work, since the for runs for all values of the control variable not caring about if motionFinished has occurred or not The last idea I had, but it seemed too dirty would be to have an SetInterval checking from time to time if the currente Tween ended and then increment i and clear it after the last tween happen. I need something like an (irch) GOTO or some Design Pattern techinique I do not master at this point. Joao Carlos ___ 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 -- John Van Horn [EMAIL PROTECTED] ___ 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
Re: [Flashcoders] sequential tweens ?
// Tween finished private function tweenFinished() { ... else { startTween(currentIndex); oops, this is meant to say tweenPhoto(currentIndex) my email client doesnt have refactoring support yet ;) ___ 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] double-byte text entry in windowless mode
Hi All, I'm having difficulty entering any double-byte text in a standard input text box, when the flash movie is embedded in either wmode transparent or opaque. Using the default wmode = window, I can switch my IME to Korean, Arabic or whatever and text will enter perfectly. Once I embed using either of the winowless modes, I get junk in my text box when using anything other than standard english text. Does anyone have any ideas? Sinead. ___ 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] jigsaw puzzle
May I sent fla to your mail? 2006/7/23, Hans Wichman [EMAIL PROTECTED]: Hi, what exactly do you mean, it has a config different from the mask shape? The only thing that seems 'off' to me is the starting index in the mask sides, which starts with 1 instead of zero, but that might be perfectly ok depending on how you built the array. Could you show a screendump of what you describe? greetz Hans On 7/23/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: I am trying to go on this way step by step and and met something that I cannot understand. Maybe anybody can help. I created pieces of puzzle. Each puzzle contain mask that I draw with Drawing API on one level. I checked it and it creates well. Then I attach picture on another layer. I see now mask and picture. All is correct. I say pic.setMask(mask) after that picture is masked but it has configuration that is different from mask shape. function drawPattern(linkageID, target, clipName, depth, x, y, cur_row, cur_column):MovieClip { var r=partW*0.15; var mc:MovieClip = target.createEmptyMovieClip(clipName, depth); mc._x = x; mc._y = y; maskX=(partW*cur_column); maskY=(partH*cur_row); var mask:MovieClip = mc.createEmptyMovieClip(mask, 2); var pic:MovieClip=mc.attachMovie(linkageID,pic,1); pic._x=0; pic._y=0; mask_sides=sides[cur_column][cur_row]; mask.lineStyle(undefined, 0x0, 100); mask.moveTo(maskX, maskY); mask.beginFill(0x0, 100); drawSideV(mask,mask._xpen,mask._ypen,mask_sides[1]*r,1); drawSideG(mask,mask._xpen,mask._ypen,mask_sides[2]*r,1); drawSideV(mask,mask._xpen,mask._ypen,mask_sides[3]*r,-1); drawSideG(mask,mask._xpen,mask._ypen,mask_sides[4]*r,-1); mask.endFill(); pic.setMask(mask); return mc; } function tiler (linkageID){ depthCount=1; for (var j=0;jcolumn;j++){ for(var i=0;irow;i++){ part=drawPattern(linkageID,this,part+j+_+i,depthCount,stageX,stageY,i,j); depthCount++; activity(part.mask); } } } tiler(pic); Thanks a lot for help. 2006/7/16, Hans Wichman [EMAIL PROTECTED]: Hi Natalia, you can find it here: http://www.google.nl/search?hl=nlq=jigsaw+puzzle+flashcodersmeta= and http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/msg17822.html Yes its possible. greetz Hans On 7/16/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Thank you, Guntur. I can not find your thread in the archive. Do you have this algorithm or any basic fla? It would be very helpful. Drawing api is clear for one object but creating many puzzles looks fantastic. Is it possible? Natalia 2006/7/16, Guntur N. Sarwohadi [EMAIL PROTECTED]: Natalia, You can search the archive and find recent threads concering jigsaw puzzle algorithm. In fact, thats the thread I started.. that's why I (and Hans) know it's there ^_^ But to answer you question... 1. flash 8 has provided a bitmapData class, it's really good handling bitmaps so you can use the copyPixel method and but it in n movieClips on it. For jigsaw drawing, you can use flash drawing api.. especially the curveTo method. Basically it's only one type of curving and it is repeated for each side with variations being it inward or out.. 2. group and blending two pieces isn't that hard actually, as long as the pieces are placed in the right position it will look as one. The drop shadow is done by code and updated, while the center curve fading can also be done by code.. sure, it's a little complex than droptarget and hittest but it can be done :D hope that helps Guntur N. Sarwohadi On 7/15/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Yes, I checked before posting but found only questions without answers. 2006/7/15, Hans Wichman [EMAIL PROTECTED]: Please refer to the archives, there is a thread about this going on as we speak... On 7/15/06, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Hi to all Can anybody give me advice for creating game like this? http://www.magickeys.com/books/jigsaws/cheetah_1/e.html 1. How can I create each time different pieces? I can only guess that there are some sets with different shapes and they attached as mask. 2. When pieces are correct new pieces appear. How this is done? How they determinate that? This is not droptarget or hittest. How
Re: [Flashcoders] sequential tweens ?
couldnt you just use 2 methods in your class to control the sequence of tweens? // Start a tween for a photo private function tweenPhoto() (...) You see, that's what I'm totally against when writing code: overcomplication. Going around and around and around to come back and do something quite small. Martin, do not take this personally, I don't mean to sound rude or anything, I'm sorry in advance if I do, and your code totally makes logical sense and it's 100% correct, but... WHY would someone need so much code just to produce sequential tweenings? A bunch of specialized functions just to make it work? And then suppose he has an slightly different animation he wants to do at the same time, will he need new functions, or add parameters to those functions, and so long and so forth? Why something so convoluted for something so simple? Simply because the tweening doesn't support delays? :( Going back to the original post: if I were to code that using MC Tween (I'll use my code as an example, because I'm not so acquainted with other extension's code). Anyways, I'd do it like this: var delay = 0; for (var prop in photoStrip) { if (prop != _childCounter) { photoStrip[prop].tween(_yscale, 120, 0.5, easeinout, delay); photoStrip[prop].tween(_xscale, 120, 0.5, easeinout, delay); delay += 0.5; } } or even: var delay = 0; for (var prop in photoStrip) { if (prop != _childCounter) { photoStrip[prop].scaleTo(120, 0.5, easeinout, delay); delay += 0.5; } } or to use some other as1-less syntax, once again my own's zeh.easing.Tweener, a static as2 class which provide a one-shot method for animation triggering: import zeh.easing.Tweener; var delay = 0; for (var prop in photoStrip) { if (prop != _childCounter) { Tweener.addTween(photoStrip[prop], {_xscale:120, _yscale:120, time:0.5, transition:easeinout, delay:delay}); delay += 0.5; } } or just in one line (or maybe two with the 'import' statement): import zeh.easing.Tweener; for (var i:Number = 0; i photoStrip.length; i++) Tweener.addTween(photoStrip[prop], {_xscale:120, _yscale:120, time:0.5, transition:easeinout, delay:0.5 * i}); Really. WHY does it have to be more complicated than that? ..Functions? ..setIntervals? ..Delegates? What's next, a sequential animation calling design pattern with 10 different methods? Just for a one-shot sequential animation? And still making it more difficult and less practical -- less easy to change? It's just sequential animations, no secret, no big deal. Why not fit the solution to it, using any of the existing solutions that support delays, instead of going 1000 extra miles? Do programmers bill by number of functions they've written? Sorry for the rant, but really, there's a moment you have to use the best tool for the task - and I don't mean only the easiest. The tweening classes included on Flash are cool and all that, but they're too basic, too raw. Why you'd need dozens of lines just to do something that can be done with one single line in a pretty straightforward way is beyond me. Most of the times I have to build sites, there's so much having to be animated correctly that if I resorted to functions and complex callbacks any time I needed some kind of sequence or delay, my code would be a complete mess and the sequence would be unmaintainable. Now, with delays it's as easy as it gets. It's easier to read, debug, write, change, etc. My advice is to still use another solution. MC Tween, laco's, Fuse Kit, it doesn't matter. Any of them will do the trick. And probably next version of Flash's tweening functions, considering Robert Penner is working for them now. - 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] sequential tweens ?
Martin, do not take this personally, I don't mean to sound rude or anything, I'm sorry in advance if I do, and your code totally makes logical sense and it's 100% correct, but... WHY would someone need so much code just to produce sequential tweenings? A bunch of specialized functions just to make it work? And then suppose he has an slightly different animation he wants to do at the same time, will he need new functions, or add parameters to those functions, and so long and so forth? Why something so convoluted for something so simple? Simply because the tweening doesn't support delays? :( don't worry i don't take it personally its only programming :) To me it doesn't seem complicated, just a couple of functions, nothing special in either function. If it doesn't fit the requirements, so be it. Sorry for the rant, but really, there's a moment you have to use the best tool for the task - and I don't mean only the easiest. The tweening classes included on Flash are cool and all that, but they're too basic, too raw. Why you'd need dozens of lines just to do something that can be done with one single line in a pretty straightforward way is beyond me. Most of the times I have to build sites, there's so much having to be animated correctly that if I resorted to functions and complex callbacks any time I needed some kind of sequence or delay, my code would be a complete mess and the sequence would be unmaintainable. Now, with delays it's as easy as it gets. It's easier to read, debug, write, change, etc. Don't be sorry, if it upsets you then best to let it out, bottling things up isn't good for the soul :) Anyway, to consider if its easier to change then it really depends on how you want to change it. In some cases yes its undoubtedly easier, in other cases i think it could be harder but I don't know the API of your tweening classes so I cant say. What if i wanted to trigger something when each tween ends? What if i want to perform an action depending on which tween has ended? Each solution has its pro's and con's so its worth understanding the options and the trade offs. Like i said i don't find functions or callbacks complicated, its the bread and butter of programming. The code i showed is an idiom that I've used on a number of occasions, not just for sequencing animations but for various things that need treating in a consequential manner and aren't all necessarily time based. My advice is to still use another solution. MC Tween, laco's, Fuse Kit, it doesn't matter. Any of them will do the trick. Mine too :) I don't know any of the other animation kits so I couldn't vouch for their ease of use, size when installed or performance, but I've heard good things about those you mention. anyway..shop around, its always the way to get the best deal and the solution that fits your needs. Martin. ___ 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] Online Live Support without FlashComm (or even withouth Flash at all)
Thanks Richards, I checked it and will fit for what I was looking for. 2006/7/21, richard carr [EMAIL PROTECTED]: ck out flash chat http://tufat.com/s_flash_chat_chatroom.htm Richard On 7/21/06, Helios Pregioni Bayma [EMAIL PROTECTED] wrote: Hi list, I am developing a site that will need an online live support. The site is full Flash and I would like the support to be in it too, but it´s not an obligation. What I know is that I can´t use FlashComm, since the server don´t support it and the client is not willing to pay. Is that a tutorial, a way, an example to make it? If not using Flash, can be PHP or ASP. Thanks! Helios Pregioni Bayma ___ 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 -- Helios Pregioni Bayma Macromedia Certified FlashMX Designer 21 8742 0577 [EMAIL PROTECTED] | www.heliospb.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