Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > FlashLite / Portable Devices Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-15-2006, 09:14 AM   #1
PogiEnGanda
Registered User
 
Join Date: Jan 2006
Posts: 10
Default How to manipulate Strings in Flash 4

I mean, what is the equivalent string.charAt() in Flash 4.

How can you do something like these:
String s = "This is statement 1.
This is statement 2."

parse the string with "\n" so it would be stored in an array:
array_0 = "This is statement 1.";
array_1 = "This is statement 2.";
PogiEnGanda is offline   Reply With Quote
Old 02-21-2006, 07:29 PM   #2
sophistikat
Game On
 
sophistikat's Avatar
 
Join Date: Mar 2005
Location: Barrie, ON
Posts: 2,519
Default

why in gods green earth are you using flash 4?
sophistikat is offline   Reply With Quote
Old 03-02-2006, 07:55 AM   #3
PogiEnGanda
Registered User
 
Join Date: Jan 2006
Posts: 10
Default

I need to because actually im running an application through Flash Lite 1.1 player. By the way, I hope this forum has a Flash Lite 1.1 / 2.0 section.

Quote:
Originally Posted by sophistikat
why in gods green earth are you using flash 4?
PogiEnGanda is offline   Reply With Quote
Old 03-02-2006, 03:39 PM   #4
sophistikat
Game On
 
sophistikat's Avatar
 
Join Date: Mar 2005
Location: Barrie, ON
Posts: 2,519
Default

i don't have flash 4 installed with me but lets give this a shot
ActionScript Code:
myString = "This is statement 1.This is statement 2"; var myArray = myString.split(".");
should output
Code:
Variable _level0.myString = "This is statement 1.This is statement 2"
Variable _level0.myArray = [object #1, class 'Array'] [
    0:"This is statement 1",
    1:"This is statement 2"
  ]
EDIT: Sh**, that wont work; split() was only available until flash 5
EDIT: Give this a read while i try to find the answer for you
http://www.macromedia.com/devnet/dev...flashlite.html

Last edited by sophistikat; 03-02-2006 at 03:41 PM..
sophistikat is offline   Reply With Quote
Old 03-02-2006, 09:14 PM   #5
sophistikat
Game On
 
sophistikat's Avatar
 
Join Date: Mar 2005
Location: Barrie, ON
Posts: 2,519
Default

Hi Pogi, just finished talking to some web developer in macromedia and he said nope, the string class and its methods weren't introduced until flash 5.
sophistikat is offline   Reply With Quote
Old 03-03-2006, 05:13 PM   #6
sophistikat
Game On
 
sophistikat's Avatar
 
Join Date: Mar 2005
Location: Barrie, ON
Posts: 2,519
Default Good News Pogi

i found this script that helps you brake down a string in flash 4
ActionScript Code:
str = "This is a string of stuff!"; delim = "st"; arrName = "arr"; // //split code: split str on delimeter into an 'array' copy = str; len = 0; dl = length (delim); if (dl == 0) {     x = 0; } else {     x = -1; } while (++x + dl < length (copy)) {     f = substring (copy, 0, x);     s = substring (copy, x + 1, dl);     e = substring (copy, x + dl + 1, length (copy) - x);     if (s eq delim) {         eval (arrName add (len++)) = f;         copy = e;         if (dl == 0) {             x = 0;         } else {             x = -1;         }     } } eval (arrName add (len++)) = copy; //end split code // // loop through 'array' count = 0; while (count < len) {     trace (eval ('arr' add count));     count++; }
sophistikat 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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
one template, many looks? subquark ActionScript 1.0 (and below) 1161 09-03-2009 04:45 PM
Any Flash to DVD experts out there? apertureboy Other Flash General Questions 1 10-14-2005 04:46 AM
scrollBar on Flash Exchange cdeg Components 5 05-03-2004 08:13 PM
PHP strings into Flash Tbone Server-Side Scripting 4 03-23-2003 03:14 AM


All times are GMT. The time now is 08:34 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.