Re: [Flashcoders] regexp question
wow - i have no idea what that means at all time to hit the books - thanks :) On 4 Jul 2008, at 01:09, Claudius Ceteras wrote: Hi, is there a way of counting back from the end of the number and inserting the comma (even without a regular expression)? if i use the g modifier in the regexp (so var pattern:RegExp = /000/g;), it will only pick up the first 000 (and every multiple thereafter) instead of leaving the first 0 (which is expected behaviour but something i'd like to get around) How about positive lookaheads? /(000)(?=(?:000)*[^0])/g If you want this also to work for 1234567 = 1,234,567, you can replace every 0 in the pattern with \d and call the replace function with , \1 instead of ,000 This is untested, but should work... Let me know. regards, Claudius ___ 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] regexp question
hi again i've been trying different things and it seems that the [^0] or [^\d] is stopping it working. (I needed to use $1 rather than \1 to reference the first group in the String.replace statement) here is what i've got so far var sYear:String = 1234567; var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*[^\d])/g; sYear = sYear.replace(pattern, ,$1); //traces 1234567 if i drop the NOT part var sYear:String = 1234567; var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*)/g; sYear = sYear.replace(pattern, ,$1); //traces ,123,4567 This stuff is really new to me so i really appreciate the help thanks a On 4 Jul 2008, at 01:09, Claudius Ceteras wrote: Hi, is there a way of counting back from the end of the number and inserting the comma (even without a regular expression)? if i use the g modifier in the regexp (so var pattern:RegExp = /000/g;), it will only pick up the first 000 (and every multiple thereafter) instead of leaving the first 0 (which is expected behaviour but something i'd like to get around) How about positive lookaheads? /(000)(?=(?:000)*[^0])/g If you want this also to work for 1234567 = 1,234,567, you can replace every 0 in the pattern with \d and call the replace function with , \1 instead of ,000 This is untested, but should work... Let me know. regards, Claudius ___ 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] regexp question
Hi Allandt, Have you found this tool already? http://www.gskinner.com/blog/archives/2008/03/regexr_free_onl.html It allows you to test your regex pattern expecially for AS And you can find a cheatsheat on RegEx on www.ilovejackdaniels.com and there is ofcourse alot on whttp://www.regular-expressions.info/quickstart.html and http://www.regular-expressions.info/tutorial.html Hope this will get you started, Sid On Jul 4, 2008, at 11:32 AM, Allandt Bik-Elliott (Receptacle) wrote: hi again i've been trying different things and it seems that the [^0] or [^ \d] is stopping it working. (I needed to use $1 rather than \1 to reference the first group in the String.replace statement) here is what i've got so far var sYear:String = 1234567; var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*[^\d])/g; sYear = sYear.replace(pattern, ,$1); //traces 1234567 if i drop the NOT part var sYear:String = 1234567; var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*)/g; sYear = sYear.replace(pattern, ,$1); //traces ,123,4567 This stuff is really new to me so i really appreciate the help thanks a On 4 Jul 2008, at 01:09, Claudius Ceteras wrote: Hi, is there a way of counting back from the end of the number and inserting the comma (even without a regular expression)? if i use the g modifier in the regexp (so var pattern:RegExp = /000/g;), it will only pick up the first 000 (and every multiple thereafter) instead of leaving the first 0 (which is expected behaviour but something i'd like to get around) How about positive lookaheads? /(000)(?=(?:000)*[^0])/g If you want this also to work for 1234567 = 1,234,567, you can replace every 0 in the pattern with \d and call the replace function with , \1 instead of ,000 This is untested, but should work... Let me know. regards, Claudius ___ 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] Re: AS3 events framework ...
Thanks all. Rich that is my problem, you've said: You can dispatch from one instance and listen from another So the second instance has to be instantiated somewhere else in the application? What if the handler for the event isn't in the same class where I instantiate the event? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] regexp question
hey that's great sid - thanks a On 4 Jul 2008, at 12:26, Sidney de Koning wrote: Hi Allandt, Have you found this tool already? http://www.gskinner.com/blog/ archives/2008/03/regexr_free_onl.html It allows you to test your regex pattern expecially for AS And you can find a cheatsheat on RegEx on www.ilovejackdaniels.com and there is ofcourse alot on whttp://www.regular-expressions.info/ quickstart.html and http://www.regular-expressions.info/tutorial.html Hope this will get you started, Sid On Jul 4, 2008, at 11:32 AM, Allandt Bik-Elliott (Receptacle) wrote: hi again i've been trying different things and it seems that the [^0] or [^ \d] is stopping it working. (I needed to use $1 rather than \1 to reference the first group in the String.replace statement) here is what i've got so far var sYear:String = 1234567; var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*[^\d])/g; sYear = sYear.replace(pattern, ,$1); //traces 1234567 if i drop the NOT part var sYear:String = 1234567; var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*)/g; sYear = sYear.replace(pattern, ,$1); //traces ,123,4567 This stuff is really new to me so i really appreciate the help thanks a On 4 Jul 2008, at 01:09, Claudius Ceteras wrote: Hi, is there a way of counting back from the end of the number and inserting the comma (even without a regular expression)? if i use the g modifier in the regexp (so var pattern:RegExp = /000/g;), it will only pick up the first 000 (and every multiple thereafter) instead of leaving the first 0 (which is expected behaviour but something i'd like to get around) How about positive lookaheads? /(000)(?=(?:000)*[^0])/g If you want this also to work for 1234567 = 1,234,567, you can replace every 0 in the pattern with \d and call the replace function with ,\1 instead of ,000 This is untested, but should work... Let me know. regards, Claudius ___ 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] Sounds loaded - but is silent
This is a dilemma that is a tough case. I am having cross-domain loading issue. I am having an loadPolicyFile which makes my swf to LOAD the mp3's from the other server. -without the policyFIle it wouldnt load the mp3's at all. but, now they are being loaded. But they are not played. no sound. and the same default.swf being played at the same domainboth loads and PLAYS the music. but from another domain - it is being loaded but not played. WHy, and how? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] regexp question
Hi, var sYear:String = 1234567; var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*[^\d])/g; sYear = sYear.replace(pattern, ,$1); //traces 1234567 That's because [^\d] expects a non-digit after the number Try this: var sYear:String = The year when all happened was 1234567 indeed // :) To get this to also work with just the year you may replace [^\d] with (?:[^\d]|$) which expects a non-digit or the end of the string regards Claudius ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] regexp question
To get this to also work with just the year you may replace [^\d] with (?:[^\d]|$) which expects a non-digit or the end of the string Or even better Replace [^\d] with \b which should also work. regards Claudius ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] regexp question
the \b boundary worked a treat - i'm just researching why it worked now thanks for all your help guys a On 4 Jul 2008, at 13:17, Claudius Ceteras wrote: To get this to also work with just the year you may replace [^\d] with (?:[^\d]|$) which expects a non-digit or the end of the string Or even better Replace [^\d] with \b which should also work. regards Claudius ___ 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] regexp question
the \b boundary worked a treat - i'm just researching why it worked now /(\d\d\d)(?=(?:\d\d\d)*\b)/g Find all groups of three digits (\d\d\d) , which are followed by positive lookahead: (?= ) 0, 3, 6, 9, ... Digits, followed by a word boundary (?:\d\d\d)*\b Word boundaries match at the end of the number, so because it only matches three digits groups which are followed by a number of digits which is divisible by 3, it doesnt find 123 in 1234567, but 234 (because it's followed by 3 digits followed by a word boundary) and 456 (because it's followed by 0 digits followed by a wod boundary) Btw, (?: ) is a non-capturing group, (?= ) is a positive lookahead. You can google for both... regards Claudius ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] regexp question
wow - that's really helpful - thanks a lot for your time claudius best a On 4 Jul 2008, at 14:56, Claudius Ceteras wrote: the \b boundary worked a treat - i'm just researching why it worked now /(\d\d\d)(?=(?:\d\d\d)*\b)/g Find all groups of three digits (\d\d\d) , which are followed by positive lookahead: (?= ) 0, 3, 6, 9, ... Digits, followed by a word boundary (?:\d\d\d)*\b Word boundaries match at the end of the number, so because it only matches three digits groups which are followed by a number of digits which is divisible by 3, it doesnt find 123 in 1234567, but 234 (because it's followed by 3 digits followed by a word boundary) and 456 (because it's followed by 0 digits followed by a wod boundary) Btw, (?: ) is a non-capturing group, (?= ) is a positive lookahead. You can google for both... regards Claudius ___ 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] drag and rotate, where do I begin?
Downloaded, but the code is not quite readable... I'm studying it tho. Thanks for your help. On Thu, Jul 3, 2008 at 4:52 AM, jonathan howe [EMAIL PROTECTED] wrote: I see a link into the place where they got the physics right in the project description: http://www.ffiles.com/flash/physics_and_motion/drag_and_rotation_with_easing_1649.html Have you tried registering and downloading - maybe it contains source? --jonathan On Thu, Jul 3, 2008 at 6:32 AM, Leandro Ferreira [EMAIL PROTECTED] wrote: Sure, drag and throw is not a problem, nor is rotation based on an arbitrary point, but deciding how an object should rotate based on where the user pressed and how he dragged it. But thanks anyway. About ready-made classes: with APE or box2D I could manage to recreate this, but that's not the point: what I want is to understand how it's done. Anyone? Leandro Ferreira On Thu, Jul 3, 2008 at 1:19 AM, Ashim D'Silva [EMAIL PROTECTED] wrote: Basically it's using velocity well. The dragging and throwing is pretty easy to figure out with basic physics (velocity and decay/friction). The rotation is a little trickier I imagine using some sort of Matrix transformations to dynamically decide a point to rotate around. Look for rotations around an arbitratrary point. I don't have enough knowledge to actually help you out directly but hopefully this will lead you in some direction. Maybe there are some ready made classes... Ashim -- Random Lines 3D My online portfolio www.therandomlines.com 2008/7/3 Leandro Ferreira [EMAIL PROTECTED]: Hi there, I was trying to understand how this( http://www.ffiles.com/flash/templates/drag_and_rotate_website_1670.html) kind of movement works, but I have no idea on what to search for. At first I got an physics book about classical mechanics, but didn't find it useful, and can't find the exact theories involved in order to look for and applied use. Then I began working 'intuitively' in it, with some trigonometics and so, but things got ugly and now I'm kind of stuck. Does anyone here know where can I find some information/article/readable source about this? Thanks, Leandro Ferreira ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Random Lines 3D My online portfolio www.therandomlines.com ___ 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 -- -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 mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Sounds loaded - but is silent
Maybe it is a cross domain issue - but also consider that there was an error uploading to whatever domain you're using. Grab the file and make sure it plays - one quirk with the sound player (in Flash 9 at lease), is that it'll say its loading and playing anything. It's easily fooled - pass it a JPG, it'll load and say its playing as a sound. So just make sure nothing crazy happened in your upload to the other domain and the sound isn't broken. Martin Klasson wrote: This is a dilemma that is a tough case. I am having cross-domain loading issue. I am having an loadPolicyFile which makes my swf to LOAD the mp3's from the other server. -without the policyFIle it wouldnt load the mp3's at all. but, now they are being loaded. But they are not played. no sound. and the same default.swf being played at the same domainboth loads and PLAYS the music. but from another domain - it is being loaded but not played. WHy, and how? ___ 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