Re: [Flashcoders] regex in switch statement

2009-05-15 Thread Sidney de Koning

Hi MM,

I think its better practice to define that regex in a variable and  
switch on that variable.


HTH,

Sidney de Koning

On May 15, 2009, at 2:12 PM, Mendelsohn, Michael wrote:


Hi list...

Is it possible to use a regular expression as a case in a switch  
statement?  I've been searching around and haven't found anything  
specifically for actionscript.


Thanks,
- MM

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Sidney de Koning - be a geek, in rockstar style!
Flash / AIR Developer @ www.funky-monkey.nl
Technical Writer @ www.insideria.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] regex in switch statement

2009-05-15 Thread Mendelsohn, Michael
Thanks for responding Sidney.  I think if I set a var prior to the switch, it 
might not work because there are so many strings going into the switch.  I'm 
trying to optimize this that would apply to only some of all the cases:

switch(str){
case (W1) :
case (W2) :
case (W3) :
break;
case (M1) :
case (M2) :
case (M3) :
break;
case (K1) :
case (K2) :
case (K3) :
break;
}
}

...into something shorter like this:
switch(str){ 
case(/(W|M|K)\d/i):
break;
}



 I think its better practice to define that regex in a variable and  
switch on that variable.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] regex in switch statement

2009-05-15 Thread Mendelsohn, Michael
That didn't work for me.  :-/

- MM



 Oke, i think you can, since it matches the input given with the case.   
i didnt test it.
But cant you store the regex in a var and put that in the case?

like so:

var myRegEx:RegExp = /(W|M|K)\d/i;

var stringToMatch = ;

switch(stringToMatch) {
case myRegEx:
break;
}

Otherwise cant you swithc on the result of the executed regex?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] FileReferenceList - no upload function?

2009-05-15 Thread Paul Freedman
I haven't had to build ftp functionality in years. I hope someone is familiar 
with the problem and can address this simply.

The class FileReference allows the user to browse to and select one file, and 
the class FileReferenceList allows for the selection of multiple files. But 
only FileReference has an upload() function. 

How do you upload (or download, for that matter) using FileReferenceList?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] FileReferenceList - no upload function?

2009-05-15 Thread Dave Watts
 I haven't had to build ftp functionality in years. I hope someone is familiar 
 with the problem and can address this simply.

FileReference doesn't do FTP uploads, to the best of my knowledge,
only HTTP uploads.

 The class FileReference allows the user to browse to and select one file, and 
 the class FileReferenceList allows for the selection
 of multiple files. But only FileReference has an upload() function.

 How do you upload (or download, for that matter) using FileReferenceList?

FileReferenceList contains a filelist property, which is an array of
FileReference objects. You iterate through the array and call the
upload method for each.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] FileReferenceList - no upload function?

2009-05-15 Thread Steven Sacks

http://74.125.155.132/search?q=cache:Z9ZpwotYRtkJ:www.mikestead.co.uk/2009/01/04/upload-multiple-files-with-a-single-request-in-flash/+AS3+Socket+send+progress+brokencd=3hl=enct=clnkgl=usclient=firefox-a


On May 15, 2009, at 11:19 AM, Paul Freedman wrote:

I haven't had to build ftp functionality in years. I hope someone is  
familiar with the problem and can address this simply.


The class FileReference allows the user to browse to and select one  
file, and the class FileReferenceList allows for the selection of  
multiple files. But only FileReference has an upload() function.


How do you upload (or download, for that matter) using  
FileReferenceList?


___
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] FileReferenceList - no upload function?

2009-05-15 Thread Bob Wohl
The file reference has an upload, the list is just an array of
fileReference Objects. You would step through your list uploading file
by file (better for handling errors vs. success than to just loop
them).

something like:
file = fileList[i]
file.upload(url)

B.

On Fri, May 15, 2009 at 11:19 AM, Paul Freedman p...@freedmania.com wrote:
 I haven't had to build ftp functionality in years. I hope someone is familiar 
 with the problem and can address this simply.

 The class FileReference allows the user to browse to and select one file, and 
 the class FileReferenceList allows for the selection of multiple files. But 
 only FileReference has an upload() function.

 How do you upload (or download, for that matter) using FileReferenceList?

 ___
 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] Rounded Polygons; rounded triangles

2009-05-15 Thread John Giotta
I've searched for polygon draw classes and functions, but I can't find
anything that can do rounded corner polygons. Anyone on the list come
across or written a decent set of code that can?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Is there an AS3 equivalent of AJAX Suggest (like Facebook autofill searchbox)? is it even possible?

2009-05-15 Thread Carl Welch

Hi all,

I need to make an AS3 version this:
 http://www.w3schools.com/ajax/ajax_example_suggest.asp

I'm thinking I'll query the database for all of the users store that  
in an array or xml and then attach a listener to the textfield that  
will search the array everytime a character is added to the textfield


Has anyone out there attempted anything like this? Anyone know of an  
existing class?



thanks!

--
Carl Welch
http://www.carlwelch.com
http://blog.jointjam.com
carlwelchdes...@gmail.com
805.403.4819





___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] regex in switch statement

2009-05-15 Thread John Giotta
This is very odd request. With switch... case, its only useful if you
have the same condition expression. Your regex example is a similar
expression, but no where the same. No I think you better off with
if...else in this matter.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders