home |  
Sell Downloads - Ejunkie
open db network by 19.5 degrees
LYRICS | FREE E-BOOKS | SELL DOWNLOADS WITH PAYPAL
 in   
contribute for fun & profit
brink
-Array functions..
-Flash Remoting ..
-str_pad functio..
-Detecting mouse..
-Ltrim, Rtrim an..
-Opening externa..
-Modifying Flash..
-Smoothing effec..
-Array functions..
-Drawing / Vecto..
 
See all Flash Tutorials
 
-Extensions/Plug..
-FLA..
-Flash Software..
-Flash Tutorials..
 
See all Flash
 
All Resources > Flash > Flash Tutorials > ACTIONSCRIPT TUTORIALS
spread the word around  send this page to a friend   read/write comments/corrections/additions comments  rate this 

str_pad function for flash

by 19.5 Degrees
 
 
views: 9096 | rating: 4/10
 


function str_pad (str,places,pad,side) {
while (length(str)<places) {
if (side=="left")
str = pad add str;
else
str = str add pad;
}
return (str);
}

// paramater description:
// str: the string to be padded
// places: the total length of the returned padded string
// pad: the string to be used as pad
// side: where should the pad be applied, "left" or "right"

//usage:

trace (str_pad("robin","10","right","*"));

//will return

robin*****


« PREVIOUS
  INDEX
NEXT »

spread the word around
read comments

ITEC
posted by: ITEC
on: Dec 24, 07 10:51 pm

Hi
does anyone know how to open all swfs forcibly with Flash player? The problem is that on some machines particularly with VISTA it defaults to IExplorer and all swfs open with IExplorer not with Flash player! Can anyone help..please.
We do not want to use loadmovie as it won't solve our purpose. Nor can we use projector files since there are too many files in this project and it would not be possible to make all of them as projectors. We have just kept the launch file as a projector followed by swfs.

post reply | read replies (0)



Great
posted by: Simon
on: Apr 10, 05 10:42 pm

I was converting some php code into Actionscript and came across the str_pad function and your port for actionscript. Works great and saved me some time writing my own.

Thanks :)
Simon

post reply | read replies (1)



read more commentspost comment 



home | contact | contribute | terms of use | privacy policy |