Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-09-2006, 06:34 PM   #1
Xeef
Off-Line
 
Xeef's Avatar
 
Join Date: Aug 2004
Location: Ibiza/Spain language :Hungarian/German/ abit English
Posts: 6,539
Default convert "C:\Windows" to "C:/Windows"

i think there is No way to do so

ActionScript Code:
trace("\a" == "\e"); //true trace("\a" == "\f"); //false trace("\a" == "\g"); //true

http://www.actionscript.org/forums/s...288#post435288

Data is coming from a server !

Last edited by Xeef; 01-09-2006 at 06:37 PM..
Xeef is offline   Reply With Quote
Old 01-12-2006, 06:41 AM   #2
Headshotz
TEAM INTERNET
 
Headshotz's Avatar
 
Join Date: Jul 2005
Location: Batcave
Posts: 2,759
Send a message via MSN to Headshotz
Default



ActionScript Code:
var str_A = "C:\Program\textfile.txt"; if (str_A == "C:\Program\textfile.txt") {     var str_A = "C:\\Program\\textfile.txt"; } var str_B = str_A.split("\ ").join("/"); trace(str_A+" = A"); trace(str_B+" = B");

Maybe only the doubleslash will work
__________________
The author of windows file copy dialogue visits some friends:
"I'm just outside of town so I should be there in about 15 minutes"
"Actually it's looking more like 6 days"
"No, wait, 30 seconds"
Headshotz is offline   Reply With Quote
Old 01-12-2006, 07:12 AM   #3
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
Default

can you turn this into a while()
ActionScript Code:
var str:String = "C:\Program\textfile.txt"; //while (str.indexOf("\\") != -1) { var num1 = str.indexOf("\\"); var sub_str1 = str.slice(0, num1); sub_str1 += "/"; str = str.slice(num1, str.length); trace(str);// \rogram   extfile.txt <<---Miss the characters is where the problem becomes. trace(sub_str1);C:/ //} var str:String = "C:\Program\textfile.txt"; trace( str.split("")) // C,:,\,r,o,g,r,a,m, ,e,x,t,f,i,l,e,.,t,x,t
Acutally, the \ excapes the letter after it. So it appears there really is not way.

And why is this false, while the rest are true?
ActionScript Code:
trace("\a" == "\f");
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman

Last edited by Flash Gordon; 01-12-2006 at 07:40 AM..
Flash Gordon is offline   Reply With Quote
Old 01-12-2006, 07:16 AM   #4
Headshotz
TEAM INTERNET
 
Headshotz's Avatar
 
Join Date: Jul 2005
Location: Batcave
Posts: 2,759
Send a message via MSN to Headshotz
Default

ActionScript Code:
confused = true;

Hehe, developers crappy joke
__________________
The author of windows file copy dialogue visits some friends:
"I'm just outside of town so I should be there in about 15 minutes"
"Actually it's looking more like 6 days"
"No, wait, 30 seconds"
Headshotz is offline   Reply With Quote
Old 01-12-2006, 02:08 PM   #5
JEBoothjr
Registered User
 
JEBoothjr's Avatar
 
Join Date: Dec 2002
Location: Ohio
Posts: 408
Send a message via AIM to JEBoothjr
Default

trace("\a" == "\f");

this returns false because \f is a code for a "form feed" similar to \n for a new line or \t for a tab.
JEBoothjr is offline   Reply With Quote
Old 01-15-2006, 09:25 AM   #6
Headshotz
TEAM INTERNET
 
Headshotz's Avatar
 
Join Date: Jul 2005
Location: Batcave
Posts: 2,759
Send a message via MSN to Headshotz
Default

Hum, it seems we are doomed!
__________________
The author of windows file copy dialogue visits some friends:
"I'm just outside of town so I should be there in about 15 minutes"
"Actually it's looking more like 6 days"
"No, wait, 30 seconds"
Headshotz is offline   Reply With Quote
Old 01-20-2006, 02:47 AM   #7
astgtciv
Resu Deretsiger
 
astgtciv's Avatar
 
Join Date: Jul 2005
Location: San Francisco
Posts: 2,324
Default

What does "data coming from the server" mean exactly here? Surely, this must be different than simply writing the data out in a string to be compiled down into a swf. When that is done, it seems that during the compilation process "\x" (where 'x' is a letter - A, b, p, etc.) is interpreted as an escape code. Some of those escape codes mean something (e.g., "\n" will get compiled down to a newline (ASCII Code 10), most don't mean anything (e.g. "\a") - and will simply be replaced by the "\" character. But if the data is "coming from the server", then it must already be coming as valid character data, and doing str.split("\\").join("/") would replace all the "\" characters by "/"... This is not the same as writing out var strA="C:\Program Files\etc" in Studio and then compiling it, right?
astgtciv is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some handy web services mmm..pi..3.14.. ActionScript 2.0 145 11-17-2009 11:17 AM
convert string letters to ASCII and back chartrandi ActionScript 1.0 (and below) 8 12-04-2008 04:40 PM
How to convert .swf Movieclips to .MOV/.AVI/DVD???? cozza Projectors and CDs 21 07-10-2006 08:54 AM
how to Convert characters to ascii values? algo Simple Stuff (Newbies) 4 09-17-2005 05:18 PM
Convert Flash to VHS maxfilev ActionScript 1.0 (and below) 4 02-14-2005 10:23 AM


All times are GMT. The time now is 01:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.